blob: 21d8041e97e710b9052f58c61bc7ac599efec2ba [file] [log] [blame]
tanjent@gmail.comf67ce942011-03-14 09:11:18 +00001#include "Platform.h"
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +00002#include "Hashes.h"
tanjent@gmail.comad4b3632010-11-05 01:20:58 +00003#include "KeysetTest.h"
4#include "SpeedTest.h"
5#include "AvalancheTest.h"
6#include "DifferentialTest.h"
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +00007
tanjent@gmail.comf67ce942011-03-14 09:11:18 +00008#include <stdio.h>
tanjent@gmail.comad4b3632010-11-05 01:20:58 +00009#include <time.h>
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000010
11bool g_testAll = false;
12
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000013bool g_testSanity = false;
14bool g_testSpeed = false;
15bool g_testDiff = false;
16bool g_testAvalanche = false;
17bool g_testCyclic = false;
18bool g_testSparse = false;
19bool g_testPermutation = false;
20bool g_testWindow = false;
21bool g_testText = false;
22bool g_testZeroes = false;
23bool g_testSeed = false;
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000024
tanjent@gmail.comf67ce942011-03-14 09:11:18 +000025//-----------------------------------------------------------------------------
tanjent@gmail.com31a9e8e2010-11-09 20:29:19 +000026
27int64_t g_hashcount = 0;
28int64_t g_bytecount = 0;
29
30void counterhash ( const void * , const int len, const uint32_t , void * out )
31{
32 g_hashcount++;
33 g_bytecount += len;
34
35 *(uint32_t*)out = rand_u32();
36}
37
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000038//-----------------------------------------------------------------------------
39
40struct HashInfo
41{
42 pfHash hash;
43 int hashbits;
44 const char * name;
45 const char * desc;
46};
47
48HashInfo g_hashes[] =
49{
tanjent@gmail.com31a9e8e2010-11-09 20:29:19 +000050 { counterhash, 32, "count", "Counts how many times the hash function is called" },
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000051 { randhash_32, 32, "rand32", "Random number generator, 32-bit" },
52 { randhash_64, 64, "rand64", "Random number generator, 64-bit" },
53 { randhash_128, 128, "rand128", "Random number generator, 128-bit" },
54
55 { crc32, 32, "crc32", "CRC-32" },
56 { DoNothingHash, 32, "donothing32", "Do-Nothing Function (only valid for speed test comparison)" },
57
58 { md5_32, 32, "md5_32a", "MD5, first 32 bits of result" },
59 { sha1_32a, 32, "sha1_32a", "SHA1, first 32 bits of result" },
60
61 { FNV, 32, "FNV", "Fowler-Noll-Vo hash, 32-bit" },
62 { lookup3_test, 32, "lookup3", "Bob Jenkins' lookup3" },
63 { SuperFastHash, 32, "superfast", "Paul Hsieh's SuperFastHash" },
tanjent@gmail.combabb5532011-02-28 06:03:12 +000064 { MurmurOAAT, 32, "MurmurOAAT", "Murmur one-at-a-time" },
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000065
66 // MurmurHash2
67
68 { MurmurHash2_test, 32, "Murmur2", "MurmurHash2 for x86, 32-bit" },
69 { MurmurHash2A_test, 32, "Murmur2A", "MurmurHash2A for x86, 32-bit" },
70 { MurmurHash64A_test, 64, "Murmur2B", "MurmurHash2 for x64, 64-bit" },
71 { MurmurHash64B_test, 64, "Murmur2C", "MurmurHash2 for x86, 64-bit" },
72
73 // MurmurHash3
74
75 { MurmurHash3_x86_32, 32, "Murmur3A", "MurmurHash3 for x86, 32-bit" },
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000076 { MurmurHash3_x86_128, 128, "Murmur3C", "MurmurHash3 for x86, 128-bit" },
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000077 { MurmurHash3_x64_128, 128, "Murmur3F", "MurmurHash3 for x64, 128-bit" },
78
79};
80
81HashInfo * findHash ( const char * name )
82{
83 for(int i = 0; i < sizeof(g_hashes) / sizeof(HashInfo); i++)
84 {
85 if(_stricmp(name,g_hashes[i].name) == 0) return &g_hashes[i];
86 }
87
88 return NULL;
89}
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +000090
91//----------------------------------------------------------------------------
92
93template < typename hashtype >
94void test ( hashfunc<hashtype> hash, const char * hashname )
95{
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000096 const int hashbits = sizeof(hashtype) * 8;
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +000097
tanjent@gmail.comad4b3632010-11-05 01:20:58 +000098 printf("-------------------------------------------------------------------------------\n");
99 printf("--- Testing %s\n\n",hashname);
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000100
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000101 //-----------------------------------------------------------------------------
102 // Sanity tests
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000103
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000104 if(g_testSanity || g_testAll)
105 {
106 printf("[[[ Sanity Tests ]]]\n\n");
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000107
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000108 QuickBrownFox(hash,hashbits);
109 SanityTest(hash,hashbits);
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000110 AppendedZeroesTest(hash,hashbits);
111 printf("\n");
112 }
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000113
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000114 //-----------------------------------------------------------------------------
115 // Speed tests
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000116
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000117 if(g_testSpeed || g_testAll)
118 {
119 printf("[[[ Speed Tests ]]]\n\n");
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000120
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000121 BulkSpeedTest(hash);
122 printf("\n");
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000123
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000124 for(int i = 1; i < 32; i++)
125 {
126 double cycles;
127
128 TinySpeedTest(hash,sizeof(hashtype),i,true,cycles);
129 }
130
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000131 /*
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000132 for(int i = 32; i <= 2048; i += 32)
133 {
134 double cycles;
135
136
137 TinySpeedTest(hash,sizeof(hashtype),i,true,cycles);
138 }
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000139 */
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000140
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000141 printf("\n");
142 }
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000143
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000144 //-----------------------------------------------------------------------------
145 // Differential tests
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000146
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000147 if(g_testDiff || g_testAll)
148 {
149 printf("[[[ Differential Tests ]]]\n\n");
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000150
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000151 bool result = true;
152 bool dumpCollisions = false;
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000153
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000154 result &= DiffTest< Blob<64>, hashtype >(hash,5,1000,dumpCollisions);
155 result &= DiffTest< Blob<128>, hashtype >(hash,4,1000,dumpCollisions);
156 result &= DiffTest< Blob<256>, hashtype >(hash,3,1000,dumpCollisions);
157
158 if(!result) printf("*********FAIL*********\n");
159 printf("\n");
160 }
161
162 //-----------------------------------------------------------------------------
163 // Avalanche tests.
164
165 // 2 million reps is enough to measure bias down to ~0.25%
166
167 if(g_testAvalanche || g_testAll)
168 {
169 printf("[[[ Avalanche Tests ]]]\n\n");
170
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000171 //const int hashbits = sizeof(hashtype) * 8;
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000172 bool result = true;
173
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000174 /*
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000175 result &= AvalancheTest< Blob< 32>, hashtype > (hash,300000);
176 result &= AvalancheTest< Blob< 40>, hashtype > (hash,300000);
177 result &= AvalancheTest< Blob< 48>, hashtype > (hash,300000);
178 result &= AvalancheTest< Blob< 56>, hashtype > (hash,300000);
179
180 result &= AvalancheTest< Blob< 64>, hashtype > (hash,300000);
181 result &= AvalancheTest< Blob< 72>, hashtype > (hash,300000);
182 result &= AvalancheTest< Blob< 80>, hashtype > (hash,300000);
183 result &= AvalancheTest< Blob< 88>, hashtype > (hash,300000);
184 result &= AvalancheTest< Blob< 96>, hashtype > (hash,300000);
185 result &= AvalancheTest< Blob<104>, hashtype > (hash,300000);
186 result &= AvalancheTest< Blob<112>, hashtype > (hash,300000);
187 result &= AvalancheTest< Blob<120>, hashtype > (hash,300000);
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000188 */
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000189
190 result &= AvalancheTest< Blob<128>, hashtype > (hash,300000);
191 result &= AvalancheTest< Blob<136>, hashtype > (hash,300000);
192 result &= AvalancheTest< Blob<144>, hashtype > (hash,300000);
193 result &= AvalancheTest< Blob<152>, hashtype > (hash,300000);
194 result &= AvalancheTest< Blob<160>, hashtype > (hash,300000);
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000195
196 /*
197 result &= AvalancheTest< Blob<168>, hashtype > (hash,300000);
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000198 result &= AvalancheTest< Blob<176>, hashtype > (hash,300000);
199 result &= AvalancheTest< Blob<184>, hashtype > (hash,300000);
200 result &= AvalancheTest< Blob<192>, hashtype > (hash,300000);
201 result &= AvalancheTest< Blob<200>, hashtype > (hash,300000);
202 result &= AvalancheTest< Blob<208>, hashtype > (hash,300000);
203 result &= AvalancheTest< Blob<216>, hashtype > (hash,300000);
204 result &= AvalancheTest< Blob<224>, hashtype > (hash,300000);
205 result &= AvalancheTest< Blob<232>, hashtype > (hash,300000);
206 result &= AvalancheTest< Blob<240>, hashtype > (hash,300000);
207 result &= AvalancheTest< Blob<248>, hashtype > (hash,300000);
208
209 result &= AvalancheTest< Blob<256>, hashtype > (hash,300000);
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000210 */
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000211
212 //result &= AvalancheTest< Blob<hashbits * 2>, hashtype > (hash,200000);
213 //result &= AvalancheTest< Blob<768>, hashtype > (hash,2000000);
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000214
215 // The bit independence test is slow and not particularly useful...
216 //result &= BicTest < Blob<hashbits * 2>, hashtype > ( hash, 1000000 );
217
218 if(!result) printf("*********FAIL*********\n");
219 printf("\n");
220 }
221
222 //-----------------------------------------------------------------------------
223 // Keyset 'Cyclic'
224
225 if(g_testCyclic || g_testAll)
226 {
227 printf("[[[ Keyset 'Cyclic' Tests ]]]\n\n");
228
229 bool result = true;
230 bool drawDiagram = false;
231
232 result &= CyclicKeyTest<hashtype>(hash,sizeof(hashtype)+0,8,10000000,drawDiagram);
233 result &= CyclicKeyTest<hashtype>(hash,sizeof(hashtype)+1,8,10000000,drawDiagram);
234 result &= CyclicKeyTest<hashtype>(hash,sizeof(hashtype)+2,8,10000000,drawDiagram);
235 result &= CyclicKeyTest<hashtype>(hash,sizeof(hashtype)+3,8,10000000,drawDiagram);
236 result &= CyclicKeyTest<hashtype>(hash,sizeof(hashtype)+4,8,10000000,drawDiagram);
237
238 if(!result) printf("*********FAIL*********\n");
239 printf("\n");
240 }
241
242 //-----------------------------------------------------------------------------
243 // Keyset 'Sparse'
244
245 if(g_testSparse || g_testAll)
246 {
247 printf("[[[ Keyset 'Sparse' Tests ]]]\n\n");
248
249 bool result = true;
250 bool drawDiagram = false;
251
252 result &= SparseKeyTest< 32,hashtype>(hash,6,true,true,true,drawDiagram);
253 result &= SparseKeyTest< 40,hashtype>(hash,6,true,true,true,drawDiagram);
254 result &= SparseKeyTest< 48,hashtype>(hash,5,true,true,true,drawDiagram);
255 result &= SparseKeyTest< 56,hashtype>(hash,5,true,true,true,drawDiagram);
256 result &= SparseKeyTest< 64,hashtype>(hash,5,true,true,true,drawDiagram);
257 result &= SparseKeyTest< 96,hashtype>(hash,4,true,true,true,drawDiagram);
258 result &= SparseKeyTest< 256,hashtype>(hash,3,true,true,true,drawDiagram);
259 result &= SparseKeyTest<2048,hashtype>(hash,2,true,true,true,drawDiagram);
260
261 if(!result) printf("*********FAIL*********\n");
262 printf("\n");
263 }
264
265 //-----------------------------------------------------------------------------
266 // Keyset 'Permutation'
267
268 if(g_testPermutation || g_testAll)
269 {
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000270 {
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000271 // This one breaks lookup3, surprisingly
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000272
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000273 printf("[[[ Keyset 'Combination Lowbits' Tests ]]]\n\n");
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000274
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000275 bool result = true;
276 bool drawDiagram = false;
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000277
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000278 uint32_t blocks[] =
279 {
280 0x00000000,
281
282 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007,
283 };
284
285 result &= CombinationKeyTest<hashtype>(hash,8,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
286
287 if(!result) printf("*********FAIL*********\n");
288 printf("\n");
289 }
290
291 {
292 printf("[[[ Keyset 'Combination Highbits' Tests ]]]\n\n");
293
294 bool result = true;
295 bool drawDiagram = false;
296
297 uint32_t blocks[] =
298 {
299 0x00000000,
300
301 0x20000000, 0x40000000, 0x60000000, 0x80000000, 0xA0000000, 0xC0000000, 0xE0000000
302 };
303
304 result &= CombinationKeyTest<hashtype>(hash,8,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
305
306 if(!result) printf("*********FAIL*********\n");
307 printf("\n");
308 }
309
310 {
311 printf("[[[ Keyset 'Combination 0x8000000' Tests ]]]\n\n");
312
313 bool result = true;
314 bool drawDiagram = false;
315
316 uint32_t blocks[] =
317 {
318 0x00000000,
319
320 0x80000000,
321 };
322
323 result &= CombinationKeyTest<hashtype>(hash,20,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
324
325 if(!result) printf("*********FAIL*********\n");
326 printf("\n");
327 }
328
329 {
330 printf("[[[ Keyset 'Combination 0x0000001' Tests ]]]\n\n");
331
332 bool result = true;
333 bool drawDiagram = false;
334
335 uint32_t blocks[] =
336 {
337 0x00000000,
338
339 0x00000001,
340 };
341
342 result &= CombinationKeyTest<hashtype>(hash,20,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
343
344 if(!result) printf("*********FAIL*********\n");
345 printf("\n");
346 }
347
348 {
349 printf("[[[ Keyset 'Combination Hi-Lo' Tests ]]]\n\n");
350
351 bool result = true;
352 bool drawDiagram = false;
353
354 uint32_t blocks[] =
355 {
356 0x00000000,
357
358 0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005, 0x00000006, 0x00000007,
359
360 0x80000000, 0x40000000, 0xC0000000, 0x20000000, 0xA0000000, 0x60000000, 0xE0000000
361 };
362
363 result &= CombinationKeyTest<hashtype>(hash,6,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
364
365 if(!result) printf("*********FAIL*********\n");
366 printf("\n");
367 }
368
369 //----------
370
371 /*
372 {
373 printf("[[[ Keyset 'Permutation' Tests ]]]\n\n");
374
375 bool result = true;
376 bool drawDiagram = false;
377
378 // This very sparse set of blocks is particularly hard for SuperFastHash
379
380 uint32_t blocks[] =
381 {
382 0x00000000,
383 0x00000001,
384 0x00000002,
385
386 0x00000400,
387 0x00008000,
388
389 0x00080000,
390 0x00200000,
391
392 0x20000000,
393 0x40000000,
394 0x80000000,
395 };
396
397 result &= PermutationKeyTest<hashtype>(hash,blocks,sizeof(blocks) / sizeof(uint32_t),true,true,drawDiagram);
398
399 if(!result) printf("*********FAIL*********\n");
400 printf("\n");
401 }
402 */
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000403 }
404
405 //-----------------------------------------------------------------------------
406 // Keyset 'Window'
407
408 // Skip distribution test for these - they're too easy to distribute well,
409 // and it generates a _lot_ of testing
410
411 if(g_testWindow || g_testAll)
412 {
413 printf("[[[ Keyset 'Window' Tests ]]]\n\n");
414
415 bool result = true;
416 bool testCollision = true;
417 bool testDistribution = false;
418 bool drawDiagram = false;
419
420 result &= WindowedKeyTest< Blob<hashbits*2>, hashtype > ( hash, 20, testCollision, testDistribution, drawDiagram );
421
422 if(!result) printf("*********FAIL*********\n");
423 printf("\n");
424 }
425
426 //-----------------------------------------------------------------------------
427 // Keyset 'Text'
428
429 if(g_testText || g_testAll)
430 {
431 printf("[[[ Keyset 'Text' Tests ]]]\n\n");
432
433 bool result = true;
434 bool drawDiagram = false;
435
436 const char * alnum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
437
438 result &= TextKeyTest( hash, "Foo", alnum,4, "Bar", drawDiagram );
439 result &= TextKeyTest( hash, "FooBar", alnum,4, "", drawDiagram );
440 result &= TextKeyTest( hash, "", alnum,4, "FooBar", drawDiagram );
441
442 if(!result) printf("*********FAIL*********\n");
443 printf("\n");
444 }
445
446 //-----------------------------------------------------------------------------
447 // Keyset 'Zeroes'
448
449 if(g_testZeroes || g_testAll)
450 {
451 printf("[[[ Keyset 'Zeroes' Tests ]]]\n\n");
452
453 bool result = true;
454 bool drawDiagram = false;
455
456 result &= ZeroKeyTest<hashtype>( hash, drawDiagram );
457
458 if(!result) printf("*********FAIL*********\n");
459 printf("\n");
460 }
461
462 //-----------------------------------------------------------------------------
463 // Keyset 'Seed'
464
465 if(g_testSeed || g_testAll)
466 {
467 printf("[[[ Keyset 'Seed' Tests ]]]\n\n");
468
469 bool result = true;
470 bool drawDiagram = false;
471
472 result &= SeedTest<hashtype>( hash, 1000000, drawDiagram );
473
474 if(!result) printf("*********FAIL*********\n");
475 printf("\n");
476 }
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000477}
478
479//-----------------------------------------------------------------------------
480
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000481void testHash ( const char * name )
482{
483 HashInfo * pInfo = findHash(name);
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000484
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000485 if(pInfo == NULL)
486 {
487 printf("Invalid hash '%s' specified\n",name);
488 return;
489 }
490 else
491 {
492 if(pInfo->hashbits == 32)
493 {
494 test<uint32_t>( pInfo->hash, pInfo->desc );
495 }
496 else if(pInfo->hashbits == 64)
497 {
498 test<uint64_t>( pInfo->hash, pInfo->desc );
499 }
500 else if(pInfo->hashbits == 128)
501 {
502 test<uint128_t>( pInfo->hash, pInfo->desc );
503 }
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000504 else if(pInfo->hashbits == 256)
505 {
506 test<uint256_t>( pInfo->hash, pInfo->desc );
507 }
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000508 else
509 {
510 printf("Invalid hash bit width %d for hash '%s'",pInfo->hashbits,pInfo->name);
511 }
512 }
513}
514//-----------------------------------------------------------------------------
515
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000516int main ( int argc, char ** argv )
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000517{
tanjent@gmail.comf67ce942011-03-14 09:11:18 +0000518 SetAffinity(2);
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000519
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000520 int timeBegin = clock();
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000521
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000522 g_testAll = true;
523
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000524 //g_testSanity = true;
525 //g_testSpeed = true;
526 //g_testAvalanche = true;
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000527 //g_testCyclic = true;
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000528 //g_testDiff = true;
529 //g_testSparse = true;
530 //g_testPermutation = true;
tanjent@gmail.combabb5532011-02-28 06:03:12 +0000531 //g_testZeroes = true;
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000532
tanjent@gmail.com31a9e8e2010-11-09 20:29:19 +0000533 //testHash("count");
tanjent@gmail.com31a9e8e2010-11-09 20:29:19 +0000534 //printf("Called the hash function %I64d times, %I64d bytes hashed\n",g_hashcount,g_bytecount);
535
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000536 testHash("murmur3a");
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000537
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000538 //----------
539
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000540 int timeEnd = clock();
tanjent@gmail.com7e5c3632010-11-02 00:50:04 +0000541
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000542 printf("\n");
543 printf("Testing took %f seconds\n",double(timeEnd-timeBegin)/double(CLOCKS_PER_SEC));
544 printf("-------------------------------------------------------------------------------\n");
tanjent@gmail.comad4b3632010-11-05 01:20:58 +0000545 return 0;
tanjent@gmail.com2aa29c32011-03-19 08:53:53 +0000546}