Merge branch 'ew/repack-with-bitmaps-by-default'
[gitweb.git] / t / helper / test-hashmap.c
index 9ae9281c071254019ccca3486b3a6762d9c0085f..aaf17b0ddf9e8ddd1270f613f8c71841c6644eb9 100644 (file)
@@ -1,3 +1,4 @@
+#include "test-tool.h"
 #include "git-compat-util.h"
 #include "hashmap.h"
 #include "strbuf.h"
@@ -77,7 +78,7 @@ static unsigned int hash(unsigned int method, unsigned int i, const char *key)
 
 /*
  * Test performance of hashmap.[ch]
- * Usage: time echo "perfhashmap method rounds" | test-hashmap
+ * Usage: time echo "perfhashmap method rounds" | test-tool hashmap
  */
 static void perf_hashmap(unsigned int method, unsigned int rounds)
 {
@@ -144,7 +145,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
  *
  * perfhashmap method rounds -> test hashmap.[ch] performance
  */
-int cmd_main(int argc, const char **argv)
+int cmd__hashmap(int argc, const char **argv)
 {
        struct strbuf line = STRBUF_INIT;
        struct hashmap map;
@@ -172,14 +173,7 @@ int cmd_main(int argc, const char **argv)
                        p2 = strtok(NULL, DELIM);
                }
 
-               if (!strcmp("hash", cmd) && p1) {
-
-                       /* print results of different hash functions */
-                       printf("%u %u %u %u\n",
-                              strhash(p1), memhash(p1, strlen(p1)),
-                              strihash(p1), memihash(p1, strlen(p1)));
-
-               } else if (!strcmp("add", cmd) && p1 && p2) {
+               if (!strcmp("add", cmd) && p1 && p2) {
 
                        /* create entry with key = p1, value = p2 */
                        entry = alloc_test_entry(hash, p1, p2);