From e45499816eab8abadbdd5bb6dd79b526a4ed6648 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Sat, 11 Feb 2023 23:03:39 +0100 Subject: Implement undo This also fixes a bunch of valgrind errors --- test/command.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/command.c') diff --git a/test/command.c b/test/command.c index be5fffc..09de7f4 100644 --- a/test/command.c +++ b/test/command.c @@ -53,6 +53,8 @@ void test_register_command() { "Expected number of commands to be 3 after inserting two more"); ASSERT(cmds.capacity > 1, "Expected capacity to have increased to accommodate new commands"); + + command_registry_destroy(&cmds); } void test_lookup_command() { @@ -70,6 +72,8 @@ void test_lookup_command() { "Expected to be able to look up inserted command by hash"); ASSERT_STR_EQ(cmd->name, "fake", "Expected the found function to have the correct name"); + + command_registry_destroy(&cmds); } int32_t failing_command(struct command_ctx ctx, int argc, const char *argv[]) { @@ -91,6 +95,8 @@ void test_execute_command() { struct command *fail_cmd = lookup_command(&cmds, "fejl"); int32_t res2 = execute_command(fail_cmd, &cmds, NULL, NULL, 0, NULL); ASSERT(res2 != 0, "Expected failing command to fail"); + + command_registry_destroy(&cmds); } void run_command_tests() { -- cgit v1.2.3