Skip to content

Commit a6bcb3c

Browse files
peffgitster
authored andcommitted
t-hashmap: stop calling setup() for t_intern() test
Commit f24a9b7 (t-hashmap: mark unused parameters in callback function, 2024-08-17) noted that the t_intern() does not need its hashmap parameter, but we have to keep it to conform to the function pointer interface of setup(). But since the only thing setup() does is create and tear down the hashmap, we can just skip calling setup() entirely for this case, and drop the unused parameters. This simplifies the code a bit. Helped-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 5e75e50 commit a6bcb3c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/unit-tests/t-hashmap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ static void t_alloc(struct hashmap *map, unsigned int ignore_case)
322322
free(removed);
323323
}
324324

325-
static void t_intern(struct hashmap *map UNUSED,
326-
unsigned int ignore_case UNUSED)
325+
static void t_intern(void)
327326
{
328327
const char *values[] = { "value1", "Value1", "value2", "value2" };
329328

@@ -357,6 +356,6 @@ int cmd_main(int argc UNUSED, const char **argv UNUSED)
357356
TEST(setup(t_iterate, 0), "iterate works");
358357
TEST(setup(t_iterate, 1), "iterate (case insensitive) works");
359358
TEST(setup(t_alloc, 0), "grow / shrink works");
360-
TEST(setup(t_intern, 0), "string interning works");
359+
TEST(t_intern(), "string interning works");
361360
return test_done();
362361
}

0 commit comments

Comments
 (0)