Skip to content

Commit 28c1c07

Browse files
spectre10gitster
authored andcommitted
t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c
helper/test-oidmap.c along with t0016-oidmap.sh test the oidmap.h library which is built on top of hashmap.h. Migrate them to the unit testing framework for better performance, concise code and better debugging. Along with the migration also plug memory leaks and make the test logic independent for all the tests. The migration removes 'put' tests from t0016, because it is used as setup to all the other tests, so testing it separately does not yield any benefit. Mentored-by: Christian Couder <[email protected]> Mentored-by: Kaartic Sivaraam <[email protected]> Reviewed-by: Josh Steadmon <[email protected]> Helped-by: Phillip Wood <[email protected]> Helped-by: Junio C Hamano <[email protected]> Signed-off-by: Ghanshyam Thakkar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 790a17f commit 28c1c07

File tree

6 files changed

+182
-238
lines changed

6 files changed

+182
-238
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ TEST_BUILTINS_OBJS += test-match-trees.o
809809
TEST_BUILTINS_OBJS += test-mergesort.o
810810
TEST_BUILTINS_OBJS += test-mktemp.o
811811
TEST_BUILTINS_OBJS += test-oid-array.o
812-
TEST_BUILTINS_OBJS += test-oidmap.o
813812
TEST_BUILTINS_OBJS += test-online-cpus.o
814813
TEST_BUILTINS_OBJS += test-pack-mtimes.o
815814
TEST_BUILTINS_OBJS += test-parse-options.o
@@ -1337,6 +1336,7 @@ UNIT_TEST_PROGRAMS += t-ctype
13371336
UNIT_TEST_PROGRAMS += t-example-decorate
13381337
UNIT_TEST_PROGRAMS += t-hash
13391338
UNIT_TEST_PROGRAMS += t-mem-pool
1339+
UNIT_TEST_PROGRAMS += t-oidmap
13401340
UNIT_TEST_PROGRAMS += t-oidtree
13411341
UNIT_TEST_PROGRAMS += t-prio-queue
13421342
UNIT_TEST_PROGRAMS += t-reftable-basics

t/helper/test-oidmap.c

Lines changed: 0 additions & 123 deletions
This file was deleted.

t/helper/test-tool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static struct test_cmd cmds[] = {
4444
{ "mergesort", cmd__mergesort },
4545
{ "mktemp", cmd__mktemp },
4646
{ "oid-array", cmd__oid_array },
47-
{ "oidmap", cmd__oidmap },
4847
{ "online-cpus", cmd__online_cpus },
4948
{ "pack-mtimes", cmd__pack_mtimes },
5049
{ "parse-options", cmd__parse_options },

t/helper/test-tool.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ int cmd__lazy_init_name_hash(int argc, const char **argv);
3737
int cmd__match_trees(int argc, const char **argv);
3838
int cmd__mergesort(int argc, const char **argv);
3939
int cmd__mktemp(int argc, const char **argv);
40-
int cmd__oidmap(int argc, const char **argv);
4140
int cmd__online_cpus(int argc, const char **argv);
4241
int cmd__pack_mtimes(int argc, const char **argv);
4342
int cmd__parse_options(int argc, const char **argv);

t/t0016-oidmap.sh

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)