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

Method perform_test

dlib/test/hash.cpp:261–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 {}
260
261 void perform_test (
262 )
263 {
264 print_spinner();
265
266 test_hamming_stuff();
267
268 murmur_hash_test();
269 murmur_hash_128_test();
270
271 std::string str1 = "some random string";
272 matrix<unsigned char> mat(2,2);
273
274 mat = 1,2,3,4;
275
276 matrix<uint64> mat2(2,3);
277
278 mat2 = 1,2,3,4,5,6;
279
280 to_little(mat2);
281
282 std::vector<unsigned char> v(4);
283 v[0] = 'c';
284 v[1] = 'a';
285 v[2] = 't';
286 v[3] = '!';
287
288 std::vector<uint16> v2(4);
289 v[0] = 'c';
290 v[1] = 'a';
291 v[2] = 't';
292 v[3] = '!';
293 to_little(v2);
294
295 std::map<unsigned char, unsigned char> m;
296 m['c'] = 'C';
297 m['a'] = 'A';
298 m['t'] = 'T';
299
300 dlog << LINFO << "hash(str1): "<< dlib::hash(str1);
301 dlog << LINFO << "hash(v): "<< dlib::hash(v);
302 dlog << LINFO << "hash(v2): "<< dlib::hash(v2);
303 dlog << LINFO << "hash(m): "<< dlib::hash(m);
304 dlog << LINFO << "hash(mat): "<< dlib::hash(mat);
305 dlog << LINFO << "hash(mat2): "<< dlib::hash(mat2);
306
307 uint32 ui1 = 123485393;
308 uint64 ui2 = ui1;
309 ui2 *= ui2;
310 ui2 *= ui2;
311 dlog << LINFO << "hash(ui1): "<< dlib::hash(ui1);
312 dlog << LINFO << "hash(ui2): "<< dlib::hash(ui2);
313 dlog << LINFO << "hash(make_pair(ui2,ui1)): "<< dlib::hash(make_pair(ui2,ui1));
314 dlog << LINFO << "hash(make_pair(ui2,ui2)): "<< dlib::hash(make_pair(ui2,ui2));
315 dlog << LINFO << "hash(make_pair(ui1,ui1)): "<< dlib::hash(make_pair(ui1,ui1));
316 dlog << LINFO << "hash(ui1,3): "<< dlib::hash(ui1,3);
317 dlog << LINFO << "hash(ui2,3): "<< dlib::hash(ui2,3);
318 dlog << LINFO << "hash(make_pair(ui2,ui1),3): "<< dlib::hash(make_pair(ui2,ui1),3);

Callers

nothing calls this directly

Calls 12

print_spinnerFunction · 0.85
test_hamming_stuffFunction · 0.85
murmur_hash_testFunction · 0.85
murmur_hash_128_testFunction · 0.85
to_littleFunction · 0.85
murmur_hash3Function · 0.85
test_murmur_hash_128_4Function · 0.85
test_murmur_hash_128_3Function · 0.85
test_murmur_hash_64_2Function · 0.85
test_murmur_hash_64_3Function · 0.85
hashFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected