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

Unified Diff: tests/BitmapHasherTest.cpp

Issue 1704783002: Delete dead code. SkBitmapHasher has not been used since gm. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « 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
diff --git a/tests/BitmapHasherTest.cpp b/tests/BitmapHasherTest.cpp
deleted file mode 100644
index 3b5170692d1aad8eedb955bbdfa9ce61e8ac51c6..0000000000000000000000000000000000000000
--- a/tests/BitmapHasherTest.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkBitmapHasher.h"
-
-#include "SkBitmap.h"
-#include "SkColor.h"
-#include "Test.h"
-
-// Word size that is large enough to hold results of any checksum type.
-typedef uint64_t checksum_result;
-
-// Fill in bitmap with test data.
-static void CreateTestBitmap(SkBitmap* bitmap, int width, int height,
- SkColor color, skiatest::Reporter* reporter) {
- bitmap->allocN32Pixels(width, height, kOpaque_SkAlphaType);
- bitmap->eraseColor(color);
-}
-
-DEF_TEST(BitmapHasher, reporter) {
- // Test SkBitmapHasher
- SkBitmap bitmap;
- uint64_t digest;
- // initial test case
- CreateTestBitmap(&bitmap, 333, 555, SK_ColorBLUE, reporter);
- REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
- REPORTER_ASSERT(reporter, digest == 0xfb2903562766ef87ULL);
- // same pixel data but different dimensions should yield a different checksum
- CreateTestBitmap(&bitmap, 555, 333, SK_ColorBLUE, reporter);
- REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
- REPORTER_ASSERT(reporter, digest == 0xfe04023fb97d0f61ULL);
- // same dimensions but different color should yield a different checksum
- CreateTestBitmap(&bitmap, 555, 333, SK_ColorGREEN, reporter);
- REPORTER_ASSERT(reporter, SkBitmapHasher::ComputeDigest(bitmap, &digest));
- REPORTER_ASSERT(reporter, digest == 0x2423c51cad6d1edcULL);
-}
« no previous file with comments | « src/utils/SkBitmapHasher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698