mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-02-11 04:39:53 +08:00
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
This commit is contained in:
parent
031f05fd00
commit
0066be9716
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 698
|
Version: 699
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 698
|
#define LIBYUV_VERSION 699
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -35,6 +35,13 @@ TEST_F(libyuvTest, Djb2_Test) {
|
|||||||
align_buffer_64(src_a, kMaxTest)
|
align_buffer_64(src_a, kMaxTest)
|
||||||
align_buffer_64(src_b, 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<const uint8*>(fox), 131, 5381);
|
||||||
|
const uint32 kExpectedFoxHash = 2611006483;
|
||||||
|
EXPECT_EQ(kExpectedFoxHash, foxhash);
|
||||||
|
|
||||||
for (int i = 0; i < kMaxTest; ++i) {
|
for (int i = 0; i < kMaxTest; ++i) {
|
||||||
src_a[i] = (random() & 0xff);
|
src_a[i] = (random() & 0xff);
|
||||||
src_b[i] = (random() & 0xff);
|
src_b[i] = (random() & 0xff);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user