Lines Matching refs:hash

24     REPORTER_ASSERT(r, SkOpts::hash(nullptr, 0) == 0);
26 const uint32_t hash = SkOpts::hash(data, kBytes);
28 REPORTER_ASSERT(r, hash == SkOpts::hash(data, kBytes));
30 // Changing any single element should change the hash.
34 const uint32_t tweakedHash = SkOpts::hash(tweaked, kBytes);
35 REPORTER_ASSERT(r, tweakedHash != hash);
36 REPORTER_ASSERT(r, tweakedHash == SkOpts::hash(tweaked, kBytes));
48 // We noticed a few workloads that would cause hash collisions due to the way
51 // One of these two workloads ought to cause an unintentional hash collision on very similar
61 REPORTER_ASSERT(r, SkOpts::hash(a, sizeof(a)) != SkOpts::hash(b, sizeof(b)));
71 REPORTER_ASSERT(r, SkOpts::hash(a, sizeof(a)) != SkOpts::hash(b, sizeof(b)));
76 // We've decided to make SkOpts::hash() always return consistent results, so spot check a few:
81 REPORTER_ASSERT(r, SkOpts::hash(bytes, 0) == 0x00000000, "%08x", SkOpts::hash(bytes, 0));
82 REPORTER_ASSERT(r, SkOpts::hash(bytes, 1) == 0x00000000, "%08x", SkOpts::hash(bytes, 1));
83 REPORTER_ASSERT(r, SkOpts::hash(bytes, 2) == 0xf26b8303, "%08x", SkOpts::hash(bytes, 2));
84 REPORTER_ASSERT(r, SkOpts::hash(bytes, 7) == 0x18678721, "%08x", SkOpts::hash(bytes, 7));
85 REPORTER_ASSERT(r, SkOpts::hash(bytes, 32) == 0x9d1ef96b, "%08x", SkOpts::hash(bytes, 32));
86 REPORTER_ASSERT(r, SkOpts::hash(bytes, 63) == 0xc4b07d3a, "%08x", SkOpts::hash(bytes, 63));
87 REPORTER_ASSERT(r, SkOpts::hash(bytes, 64) == 0x3535a461, "%08x", SkOpts::hash(bytes, 64));
88 REPORTER_ASSERT(r, SkOpts::hash(bytes, 99) == 0x3f98a130, "%08x", SkOpts::hash(bytes, 99));
89 REPORTER_ASSERT(r, SkOpts::hash(bytes,255) == 0x3b9ceab2, "%08x", SkOpts::hash(bytes,255));