MCPcopy Create free account
hub / github.com/davisking/dlib / test_murmur_hash_64_3

Function test_murmur_hash_64_3

dlib/test/hash.cpp:181–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179 }
180
181 void test_murmur_hash_64_3()
182 {
183 byte_orderer bo;
184 dlib::rand rnd;
185 for (int i = 0; i < 100; ++i)
186 {
187 uint32 buf[2] = {rnd.get_random_32bit_number(),
188 rnd.get_random_32bit_number()};
189 const uint32 seed = rnd.get_random_32bit_number();
190
191
192 bo.host_to_little(buf);
193 uint32 temp1, temp2;
194
195 // Make sure the 2 integer version of murmur hash does the same thing
196 // as the memory block version.
197 temp1 = murmur_hash3(&buf, sizeof(buf), seed);
198 temp2 = murmur_hash3_3(buf[0], buf[1], seed);
199 DLIB_TEST(temp1 == temp2);
200 }
201 }
202
203// ----------------------------------------------------------------------------------------
204

Callers 1

perform_testMethod · 0.85

Calls 4

murmur_hash3Function · 0.85
murmur_hash3_3Function · 0.85
host_to_littleMethod · 0.80

Tested by

no test coverage detected