summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-03-24 08:44:43 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-27 08:45:47 -0700
commit7c18cbd562af9f00877baad5f46b057d47b1c493 (patch)
tree54113988cb9d6ced44d7f27d3e7d0bd68ea68022 /t/helper
parentt/helper: merge test-genrandom into test-tool (diff)
downloadtgif-7c18cbd562af9f00877baad5f46b057d47b1c493.tar.xz
t/helper: merge test-hashmap into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-hashmap.c5
-rw-r--r--t/helper/test-tool.c1
-rw-r--r--t/helper/test-tool.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 9ae9281c07..23d2b172fe 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -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;
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index f52cbcfe67..81bafced8b 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -17,6 +17,7 @@ static struct test_cmd cmds[] = {
{ "dump-split-index", cmd__dump_split_index },
{ "example-decorate", cmd__example_decorate },
{ "genrandom", cmd__genrandom },
+ { "hashmap", cmd__hashmap },
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
{ "sha1", cmd__sha1 },
};
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index f7ec6ae0c3..fba4bd80b9 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -11,6 +11,7 @@ int cmd__dump_cache_tree(int argc, const char **argv);
int cmd__dump_split_index(int argc, const char **argv);
int cmd__example_decorate(int argc, const char **argv);
int cmd__genrandom(int argc, const char **argv);
+int cmd__hashmap(int argc, const char **argv);
int cmd__lazy_init_name_hash(int argc, const char **argv);
int cmd__sha1(int argc, const char **argv);