try to remove stdint.h
[liba.git] / test / hash.h
blobeb2fb4a29e9aa5de54ec1bc14b9f922427922429
1 #define MAIN(x) hash##x
2 #include "test.h"
3 #include "a/hash.h"
5 static void test_hash_bkdr(int argc, char *argv[])
7 int idx;
8 for (idx = 1; idx < argc; ++idx)
10 debug("case 0x%08" PRIX32 ": // %s\n break;\n", a_hash_bkdr(argv[idx], 0), argv[idx]);
14 static void test_hash_sdbm(int argc, char *argv[])
16 int idx;
17 for (idx = 1; idx < argc; ++idx)
19 debug("case 0x%08" PRIX32 ": // %s\n break;\n", a_hash_sdbm(argv[idx], 0), argv[idx]);
23 int main(int argc, char *argv[]) /* NOLINT(misc-definitions-in-headers) */
25 if (argc < 2)
27 test_hash_bkdr(argc, argv);
28 test_hash_sdbm(argc, argv);
29 return 0;
31 switch (a_hash_bkdr(argv[1], 0))
33 case 0x0E0928A2: /* hash */
34 case 0x0D3DEDB7: /* bkdr */
35 test_hash_bkdr(argc - 1, argv + 1);
36 break;
37 case 0x0F833EB8: /* sdbm */
38 test_hash_sdbm(argc - 1, argv + 1);
39 break;
40 default:
41 debug("hash\n");
42 debug("bkdr\n");
43 debug("sdbm\n");
45 return 0;