| 53 | #define TEST_SIZE 100000 |
| 54 | |
| 55 | static unsigned int hash(unsigned int method, unsigned int i, const char *key) |
| 56 | { |
| 57 | unsigned int hash = 0; |
| 58 | switch (method & 3) |
| 59 | { |
| 60 | case HASH_METHOD_FNV: |
| 61 | hash = strhash(key); |
| 62 | break; |
| 63 | case HASH_METHOD_I: |
| 64 | hash = i; |
| 65 | break; |
| 66 | case HASH_METHOD_IDIV10: |
| 67 | hash = i / 10; |
| 68 | break; |
| 69 | case HASH_METHOD_0: |
| 70 | hash = 0; |
| 71 | break; |
| 72 | } |
| 73 | |
| 74 | if (method & HASH_METHOD_X2) |
| 75 | hash = 2 * hash; |
| 76 | return hash; |
| 77 | } |
| 78 | |
| 79 | /* |
| 80 | * Test performance of hashmap.[ch] |
no test coverage detected