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

Function test_murmur_hash_128_3

dlib/test/hash.cpp:136–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134 }
135
136 void test_murmur_hash_128_3()
137 {
138 byte_orderer bo;
139 dlib::rand rnd;
140 for (int i = 0; i < 100; ++i)
141 {
142 uint64 buf[2] = { rnd.get_random_64bit_number(),
143 rnd.get_random_64bit_number(),
144 };
145
146 const uint32 seed = rnd.get_random_32bit_number();
147
148 bo.host_to_little(buf);
149 std::pair<uint64,uint64> temp1, temp2;
150
151 // Make sure the 3 integer version of murmur hash does the same thing
152 // as the memory block version.
153 temp1 = murmur_hash3_128bit(buf, sizeof(buf), seed);
154 temp2 = murmur_hash3_128bit_3(buf[0], buf[1], seed);
155 DLIB_TEST( temp1.first == temp2.first);
156 DLIB_TEST( temp1.second == temp2.second);
157 }
158 }
159
160 void test_murmur_hash_64_2()
161 {

Callers 1

perform_testMethod · 0.85

Calls 5

murmur_hash3_128bitFunction · 0.85
murmur_hash3_128bit_3Function · 0.85
host_to_littleMethod · 0.80

Tested by

no test coverage detected