Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: tests/GrBinHashKeyTest.cpp

Issue 402693003: Replace GrTHash with SkTDynamicHash (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix compiler complaints Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/gpu/GrBinHashKey.h ('K') | « tests/DynamicHashTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GrBinHashKeyTest.cpp
diff --git a/tests/GrBinHashKeyTest.cpp b/tests/GrBinHashKeyTest.cpp
index fbcf4822a7e548bd525b68a0e3f80557793a52ab..2efd2f9324d8d74668cd2609d638f1b55a6692fb 100644
--- a/tests/GrBinHashKeyTest.cpp
+++ b/tests/GrBinHashKeyTest.cpp
@@ -12,19 +12,16 @@
#include "Test.h"
-DEF_TEST(GrBinHashKey, reporter) {
+template<typename KeyType> static void TestHash(skiatest::Reporter* reporter) {
const char* testStringA_ = "abcdABCD";
const char* testStringB_ = "abcdBBCD";
const uint32_t* testStringA = reinterpret_cast<const uint32_t*>(testStringA_);
const uint32_t* testStringB = reinterpret_cast<const uint32_t*>(testStringB_);
- enum {
- kDataLenUsedForKey = 8
- };
- GrBinHashKey<kDataLenUsedForKey> keyA;
+ KeyType keyA;
keyA.setKeyData(testStringA);
// test copy constructor and comparison
- GrBinHashKey<kDataLenUsedForKey> keyA2(keyA);
+ KeyType keyA2(keyA);
REPORTER_ASSERT(reporter, keyA == keyA2);
REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash());
// test re-init
@@ -32,10 +29,19 @@ DEF_TEST(GrBinHashKey, reporter) {
REPORTER_ASSERT(reporter, keyA == keyA2);
REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash());
// test sorting
- GrBinHashKey<kDataLenUsedForKey> keyB;
+ KeyType keyB;
keyB.setKeyData(testStringB);
- REPORTER_ASSERT(reporter, keyA < keyB);
REPORTER_ASSERT(reporter, keyA.getHash() != keyB.getHash());
}
+
+DEF_TEST(GrBinHashKey, reporter) {
+ enum {
+ kDataLenUsedForKey = 8
+ };
+
+ TestHash<GrBinHashKey<kDataLenUsedForKey> >(reporter);
+ TestHash<GrMurmur3HashKey<kDataLenUsedForKey> >(reporter);
+}
+
#endif
« src/gpu/GrBinHashKey.h ('K') | « tests/DynamicHashTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698