| 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 | { |
no test coverage detected