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

Unified Diff: tests/BitmapHasherTest.cpp

Issue 14054012: SkBitmapHasher: use 64-bit-truncated MD5 instead of 64-bit CityHash (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: mandate_little_endian Created 7 years, 8 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
« include/core/SkEndian.h ('K') | « src/utils/SkBitmapHasher.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BitmapHasherTest.cpp
===================================================================
--- tests/BitmapHasherTest.cpp (revision 8985)
+++ tests/BitmapHasherTest.cpp (working copy)
@@ -42,19 +42,35 @@
// initial test case
CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 333, 555, SK_ColorBLUE);
REPORTER_ASSERT(fReporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
+#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
+ REPORTER_ASSERT(fReporter, digest == 0xfb2903562766ef87ULL);
+#else
REPORTER_ASSERT(fReporter, digest == 0x18f9df68b1b02f38ULL);
+#endif
// same pixel data but different dimensions should yield a different checksum
CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorBLUE);
REPORTER_ASSERT(fReporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
+#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
+ REPORTER_ASSERT(fReporter, digest == 0xfe04023fb97d0f61ULL);
+#else
REPORTER_ASSERT(fReporter, digest == 0x6b0298183f786c8eULL);
+#endif
// same dimensions but different color should yield a different checksum
CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorGREEN);
REPORTER_ASSERT(fReporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
+#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
+ REPORTER_ASSERT(fReporter, digest == 0x2423c51cad6d1edcULL);
+#else
REPORTER_ASSERT(fReporter, digest == 0xc6b4b3f6fadaaf37ULL);
+#endif
// same pixel colors in a different config should yield the same checksum
CreateTestBitmap(bitmap, SkBitmap::kARGB_4444_Config, 555, 333, SK_ColorGREEN);
REPORTER_ASSERT(fReporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
+#ifdef BITMAPHASHER_USES_TRUNCATED_MD5
+ REPORTER_ASSERT(fReporter, digest == 0x2423c51cad6d1edcULL);
+#else
REPORTER_ASSERT(fReporter, digest == 0xc6b4b3f6fadaaf37ULL);
+#endif
}
Reporter* fReporter;
« include/core/SkEndian.h ('K') | « src/utils/SkBitmapHasher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698