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

Function test_murmur_hash_128_4

dlib/test/hash.cpp:111–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 }
110
111 void test_murmur_hash_128_4()
112 {
113 byte_orderer bo;
114 dlib::rand rnd;
115 for (int i = 0; i < 100; ++i)
116 {
117 uint32 buf[4] = { rnd.get_random_32bit_number(),
118 rnd.get_random_32bit_number(),
119 rnd.get_random_32bit_number(),
120 rnd.get_random_32bit_number()
121 };
122
123 bo.host_to_little(buf);
124
125 std::pair<uint64,uint64> temp1, temp2;
126
127 // Make sure the 4 integer version of murmur hash does the same thing
128 // as the memory block version.
129 temp1 = murmur_hash3_128bit(buf, sizeof(buf), 0);
130 temp2 = murmur_hash3_128bit(buf[0], buf[1], buf[2], buf[3]);
131 DLIB_TEST( temp1.first == temp2.first);
132 DLIB_TEST( temp1.second == temp2.second);
133 }
134 }
135
136 void test_murmur_hash_128_3()
137 {

Callers 1

perform_testMethod · 0.85

Calls 3

murmur_hash3_128bitFunction · 0.85
host_to_littleMethod · 0.80

Tested by

no test coverage detected