Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t/helper: merge test-hashmap into test-tool
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sat, 24 Mar 2018 07:44:43 +0000
(08:44 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 27 Mar 2018 15:45:47 +0000
(08:45 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
patch
|
blob
|
history
t/helper/test-hashmap.c
patch
|
blob
|
history
t/helper/test-tool.c
patch
|
blob
|
history
t/helper/test-tool.h
patch
|
blob
|
history
t/t0011-hashmap.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c680668
)
diff --git
a/Makefile
b/Makefile
index d0bc6cfecfd86e67ac6d5d80f50f5368cb107c8c..f6c3ddc703bb797a19a3c10e465f648ad7c3adec 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-662,13
+662,13
@@
TEST_BUILTINS_OBJS += test-dump-cache-tree.o
TEST_BUILTINS_OBJS += test-dump-split-index.o
TEST_BUILTINS_OBJS += test-example-decorate.o
TEST_BUILTINS_OBJS += test-genrandom.o
TEST_BUILTINS_OBJS += test-dump-split-index.o
TEST_BUILTINS_OBJS += test-example-decorate.o
TEST_BUILTINS_OBJS += test-genrandom.o
+TEST_BUILTINS_OBJS += test-hashmap.o
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
TEST_BUILTINS_OBJS += test-sha1.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
TEST_PROGRAMS_NEED_X += test-fake-ssh
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
TEST_BUILTINS_OBJS += test-sha1.o
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
TEST_PROGRAMS_NEED_X += test-fake-ssh
-TEST_PROGRAMS_NEED_X += test-hashmap
TEST_PROGRAMS_NEED_X += test-index-version
TEST_PROGRAMS_NEED_X += test-line-buffer
TEST_PROGRAMS_NEED_X += test-match-trees
TEST_PROGRAMS_NEED_X += test-index-version
TEST_PROGRAMS_NEED_X += test-line-buffer
TEST_PROGRAMS_NEED_X += test-match-trees
diff --git
a/t/helper/test-hashmap.c
b/t/helper/test-hashmap.c
index 9ae9281c071254019ccca3486b3a6762d9c0085f..23d2b172fe708f711a15613e906637cd948324ef 100644
(file)
--- 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"
#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]
/*
* 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)
{
*/
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
*/
*
* 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;
{
struct strbuf line = STRBUF_INIT;
struct hashmap map;
diff --git
a/t/helper/test-tool.c
b/t/helper/test-tool.c
index f52cbcfe670844a769b9459b68e1911c21a458ba..81bafced8b0ddaf87d4f6f727561d9840aff91d5 100644
(file)
--- 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 },
{ "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 },
};
{ "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 f7ec6ae0c34bd0a7c0958fb0dd509b81f95592cd..fba4bd80b9591fea9bf28b7f8997001495ff9ff7 100644
(file)
--- 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__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);
int cmd__lazy_init_name_hash(int argc, const char **argv);
int cmd__sha1(int argc, const char **argv);
diff --git
a/t/t0011-hashmap.sh
b/t/t0011-hashmap.sh
index 9c217d948c14dfd75f73e27a0911fd194eb11bce..3f1f505e8937f391666a1b7e6d9b972a5f146974 100755
(executable)
--- a/
t/t0011-hashmap.sh
+++ b/
t/t0011-hashmap.sh
@@
-4,7
+4,7
@@
test_description='test hashmap and string hash functions'
. ./test-lib.sh
test_hashmap() {
. ./test-lib.sh
test_hashmap() {
- echo "$1" | test-hashmap $3 > actual &&
+ echo "$1" | test-
tool
hashmap $3 > actual &&
echo "$2" > expect &&
test_cmp expect actual
}
echo "$2" > expect &&
test_cmp expect actual
}
@@
-232,7
+232,7
@@
test_expect_success 'grow / shrink' '
echo value40 >> expect &&
echo size >> in &&
echo 64 39 >> expect &&
echo value40 >> expect &&
echo size >> in &&
echo 64 39 >> expect &&
- cat in | test-hashmap > out &&
+ cat in | test-
tool
hashmap > out &&
test_cmp expect out
'
test_cmp expect out
'