Tests should clean up after themselves
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
diff --git a/tests-clar/core/env.c b/tests-clar/core/env.c
index 9eb2fe5..d1d9888 100644
--- a/tests-clar/core/env.c
+++ b/tests-clar/core/env.c
@@ -122,6 +122,8 @@ void test_core_env__0(void)
}
}
#endif
+
+ cl_fixture_cleanup(*val);
}
git_buf_free(&path);
diff --git a/tests-clar/index/tests.c b/tests-clar/index/tests.c
index 30a5a31..8359ce0 100644
--- a/tests-clar/index/tests.c
+++ b/tests-clar/index/tests.c
@@ -246,6 +246,7 @@ void test_index_tests__add(void)
git_index_free(index);
git_repository_free(repo);
+ cl_fixture_cleanup("myrepo");
}
void test_index_tests__add_from_workdir_to_a_bare_repository_returns_EBAREPO(void)
diff --git a/tests-clar/network/fetchlocal.c b/tests-clar/network/fetchlocal.c
index 2494924..48f30e7 100644
--- a/tests-clar/network/fetchlocal.c
+++ b/tests-clar/network/fetchlocal.c
@@ -33,6 +33,7 @@ void test_network_fetchlocal__complete(void)
git_strarray_free(&refnames);
git_remote_free(origin);
git_repository_free(repo);
+ cl_fixture_cleanup("foo");
}
void test_network_fetchlocal__partial(void)
diff --git a/tests-clar/odb/alternates.c b/tests-clar/odb/alternates.c
index 785d3bc..c4b364b 100644
--- a/tests-clar/odb/alternates.c
+++ b/tests-clar/odb/alternates.c
@@ -11,8 +11,13 @@ static git_repository *repo;
void test_odb_alternates__cleanup(void)
{
+ size_t i;
+
git_buf_free(&destpath);
git_buf_free(&filepath);
+
+ for (i=0; i<ARRAY_SIZE(paths); i++)
+ cl_fixture_cleanup(paths[i]);
}
static void init_linked_repo(const char *path, const char *alternate)
diff --git a/tests-clar/status/worktree.c b/tests-clar/status/worktree.c
index a1f7f86..70fbca9 100644
--- a/tests-clar/status/worktree.c
+++ b/tests-clar/status/worktree.c
@@ -446,6 +446,7 @@ void test_status_worktree__first_commit_in_progress(void)
git_index_free(index);
git_repository_free(repo);
+ cl_fixture_cleanup("getting_started");
}
@@ -595,6 +596,7 @@ void test_status_worktree__bracket_in_filename(void)
git_index_free(index);
git_repository_free(repo);
+ cl_fixture_cleanup("with_bracket");
}
void test_status_worktree__space_in_filename(void)
@@ -659,6 +661,7 @@ void test_status_worktree__space_in_filename(void)
git_index_free(index);
git_repository_free(repo);
+ cl_fixture_cleanup("with_space");
}
static const char *filemode_paths[] = {
@@ -769,6 +772,7 @@ void test_status_worktree__disable_pathspec_match(void)
);
git_repository_free(repo);
+ cl_fixture_cleanup("pathspec");
}
@@ -821,6 +825,7 @@ void test_status_worktree__new_staged_file_must_handle_crlf(void)
git_config_free(config);
git_index_free(index);
git_repository_free(repo);
+ cl_fixture_cleanup("getting_started");
}
void test_status_worktree__line_endings_dont_count_as_changes_with_autocrlf(void)