Skip to content

Commit

Permalink
t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
spectre10 authored and gitster committed Jul 3, 2024
1 parent 790a17f commit 28c1c07
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 238 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,6 @@ TEST_BUILTINS_OBJS += test-match-trees.o
TEST_BUILTINS_OBJS += test-mergesort.o
TEST_BUILTINS_OBJS += test-mktemp.o
TEST_BUILTINS_OBJS += test-oid-array.o
TEST_BUILTINS_OBJS += test-oidmap.o
TEST_BUILTINS_OBJS += test-online-cpus.o
TEST_BUILTINS_OBJS += test-pack-mtimes.o
TEST_BUILTINS_OBJS += test-parse-options.o
Expand Down Expand Up @@ -1337,6 +1336,7 @@ UNIT_TEST_PROGRAMS += t-ctype
UNIT_TEST_PROGRAMS += t-example-decorate
UNIT_TEST_PROGRAMS += t-hash
UNIT_TEST_PROGRAMS += t-mem-pool
UNIT_TEST_PROGRAMS += t-oidmap
UNIT_TEST_PROGRAMS += t-oidtree
UNIT_TEST_PROGRAMS += t-prio-queue
UNIT_TEST_PROGRAMS += t-reftable-basics
Expand Down
123 changes: 0 additions & 123 deletions t/helper/test-oidmap.c

This file was deleted.

1 change: 0 additions & 1 deletion t/helper/test-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static struct test_cmd cmds[] = {
{ "mergesort", cmd__mergesort },
{ "mktemp", cmd__mktemp },
{ "oid-array", cmd__oid_array },
{ "oidmap", cmd__oidmap },
{ "online-cpus", cmd__online_cpus },
{ "pack-mtimes", cmd__pack_mtimes },
{ "parse-options", cmd__parse_options },
Expand Down
1 change: 0 additions & 1 deletion t/helper/test-tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ int cmd__lazy_init_name_hash(int argc, const char **argv);
int cmd__match_trees(int argc, const char **argv);
int cmd__mergesort(int argc, const char **argv);
int cmd__mktemp(int argc, const char **argv);
int cmd__oidmap(int argc, const char **argv);
int cmd__online_cpus(int argc, const char **argv);
int cmd__pack_mtimes(int argc, const char **argv);
int cmd__parse_options(int argc, const char **argv);
Expand Down
112 changes: 0 additions & 112 deletions t/t0016-oidmap.sh

This file was deleted.

Loading

0 comments on commit 28c1c07

Please sign in to comment.