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

Unified Diff: tests/ChecksumTest.cpp

Issue 14170010: rename SkBitmapChecksummer as SkBitmapHasher, and prepare for it to possibly use (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: sync_to_r8638 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
« no previous file with comments | « tests/BitmapHasherTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ChecksumTest.cpp
===================================================================
--- tests/ChecksumTest.cpp (revision 8638)
+++ tests/ChecksumTest.cpp (working copy)
@@ -7,11 +7,8 @@
*/
#include "Test.h"
-#include "SkBitmap.h"
-#include "SkBitmapChecksummer.h"
#include "SkChecksum.h"
#include "SkCityHash.h"
-#include "SkColor.h"
// Word size that is large enough to hold results of any checksum type.
typedef uint64_t checksum_result;
@@ -107,15 +104,6 @@
return result;
}
- // Fill in bitmap with test data.
- void CreateTestBitmap(SkBitmap &bitmap, SkBitmap::Config config, int width, int height,
- SkColor color) {
- bitmap.setConfig(config, width, height);
- REPORTER_ASSERT(fReporter, bitmap.allocPixels());
- bitmap.setIsOpaque(true);
- bitmap.eraseColor(color);
- }
-
void RunTest() {
// Test self-consistency of checksum algorithms.
fWhichAlgorithm = kSkChecksum;
@@ -156,25 +144,6 @@
GetTestDataChecksum(128) == GetTestDataChecksum(256));
REPORTER_ASSERT(fReporter,
GetTestDataChecksum(132) == GetTestDataChecksum(260));
-
- // Test SkBitmapChecksummer
- SkBitmap bitmap;
- // initial test case
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 333, 555, SK_ColorBLUE);
- REPORTER_ASSERT(fReporter,
- SkBitmapChecksummer::Compute64(bitmap) == 0x18f9df68b1b02f38ULL);
- // same pixel data but different dimensions should yield a different checksum
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorBLUE);
- REPORTER_ASSERT(fReporter,
- SkBitmapChecksummer::Compute64(bitmap) == 0x6b0298183f786c8eULL);
- // same dimensions but different color should yield a different checksum
- CreateTestBitmap(bitmap, SkBitmap::kARGB_8888_Config, 555, 333, SK_ColorGREEN);
- REPORTER_ASSERT(fReporter,
- SkBitmapChecksummer::Compute64(bitmap) == 0xc6b4b3f6fadaaf37ULL);
- // 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,
- SkBitmapChecksummer::Compute64(bitmap) == 0xc6b4b3f6fadaaf37ULL);
}
Reporter* fReporter;
« no previous file with comments | « tests/BitmapHasherTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698