fix mac build of gr unit test
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 1 Apr 2011 14:51:07 +0000 (14:51 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 1 Apr 2011 14:51:07 +0000 (14:51 +0000)
Review URL: http://codereview.appspot.com/4351042/

git-svn-id: http://skia.googlecode.com/svn/trunk@1034 2bbb7eff-a529-9590-31e7-b0007b416f81

gpu/src/gr_unittests.cpp

index ef6b1e77dc68e8bc6839e519bb4f4b237eeef189..fd27f199a925ba10ebee09df4bf0c73b9f45c8fa 100644 (file)
@@ -75,6 +75,9 @@ static void test_bsearch() {
     }
 }
 
+// bogus empty class for GrBinHashKey
+class BogusEntry {};
+
 static void test_binHashKey()
 {
     const char* testStringA = "abcdA";
@@ -83,11 +86,7 @@ static void test_binHashKey()
         kDataLenUsedForKey = 5
     };
 
-    class Entry {
-        // bogus empty class
-    };
-
-    typedef GrBinHashKey<Entry, kDataLenUsedForKey> KeyType;
+    typedef GrBinHashKey<BogusEntry, kDataLenUsedForKey> KeyType;
 
     KeyType keyA;
     int passCnt = 0;
@@ -96,7 +95,7 @@ static void test_binHashKey()
         keyA.keyData(reinterpret_cast<const uint8_t*>(testStringA), kDataLenUsedForKey);
     }
     GrAssert(passCnt == 1); //We expect the static allocation to suffice
-    GrBinHashKey<Entry, kDataLenUsedForKey-1> keyBust;
+    GrBinHashKey<BogusEntry, kDataLenUsedForKey-1> keyBust;
     passCnt = 0;
     while (keyBust.doPass()) {
         ++passCnt;
@@ -135,13 +134,13 @@ static void test_binHashKey()
     GrAssert(keyA.compare(keyA2) == 0);
 
     //Test ownership tranfer and copying with key on heap
-    GrBinHashKey<Entry, kDataLenUsedForKey-1> keyBust2;
+    GrBinHashKey<BogusEntry, kDataLenUsedForKey-1> keyBust2;
     keyBust2.deepCopyFrom(keyBust);
     GrAssert(keyBust.fIsValid);
     GrAssert(keyBust2.fIsValid);
     GrAssert(keyBust.getHash() == keyBust2.getHash());
     GrAssert(keyBust.compare(keyBust2) == 0);
-    GrBinHashKey<Entry, kDataLenUsedForKey-1> keyBust3;
+    GrBinHashKey<BogusEntry, kDataLenUsedForKey-1> keyBust3;
     keyBust3.deepCopyFrom(keyBust);
     GrAssert(keyBust.fIsValid == false);
     GrAssert(keyBust3.fIsValid);