Commit 6fef1ab344326bbdeb45fd653e3c13c233600a35

Ben Straub 2013-01-03T07:47:51

Tests should clean up after themselves

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)