From 0066be9716fdcd98f7e08ae79eb406903ead0463 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Wed, 22 May 2013 02:10:47 +0000 Subject: [PATCH] test hash of quick brown fox for known hash value BUG=none TESTED=out\release\libyuv_unittest --gtest_filter=libyuvTest.Djb2_Test R=johannkoenig@google.com Review URL: https://webrtc-codereview.appspot.com/1527004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@699 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/compare_test.cc | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.chromium b/README.chromium index ba40d16d4..a257370b2 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 698 +Version: 699 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index aa0515498..842578286 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 698 +#define LIBYUV_VERSION 699 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/compare_test.cc b/unit_test/compare_test.cc index 49e77d4da..742d044f0 100644 --- a/unit_test/compare_test.cc +++ b/unit_test/compare_test.cc @@ -35,6 +35,13 @@ TEST_F(libyuvTest, Djb2_Test) { align_buffer_64(src_a, kMaxTest) align_buffer_64(src_b, kMaxTest) + const char* fox = "The quick brown fox jumps over the lazy dog" + " and feels as if he were in the seventh heaven of typography" + " together with Hermann Zapf"; + uint32 foxhash = HashDjb2(reinterpret_cast(fox), 131, 5381); + const uint32 kExpectedFoxHash = 2611006483; + EXPECT_EQ(kExpectedFoxHash, foxhash); + for (int i = 0; i < kMaxTest; ++i) { src_a[i] = (random() & 0xff); src_b[i] = (random() & 0xff);