diff --git a/tests-clar/network/fetchlocal.c b/tests-clar/network/fetchlocal.c index 9ffbedbfe..ee3bd9db3 100644 --- a/tests-clar/network/fetchlocal.c +++ b/tests-clar/network/fetchlocal.c @@ -11,9 +11,9 @@ static void transfer_cb(const git_transfer_progress *stats, void *payload) (*callcount)++; } -void test_network_fetchlocal__cleanup(void) +static void cleanup_local_repo(void *path) { - cl_fixture_cleanup("foo"); + cl_fixture_cleanup((char *)path); } void test_network_fetchlocal__complete(void) @@ -24,6 +24,8 @@ void test_network_fetchlocal__complete(void) git_strarray refnames = {0}; const char *url = cl_git_fixture_url("testrepo.git"); + + cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); @@ -40,6 +42,12 @@ void test_network_fetchlocal__complete(void) git_repository_free(repo); } +static void cleanup_sandbox(void *unused) +{ + GIT_UNUSED(unused); + cl_git_sandbox_cleanup(); +} + void test_network_fetchlocal__partial(void) { git_repository *repo = cl_git_sandbox_init("partial-testrepo"); @@ -48,6 +56,7 @@ void test_network_fetchlocal__partial(void) git_strarray refnames = {0}; const char *url; + cl_set_cleanup(&cleanup_sandbox, NULL); cl_git_pass(git_reference_list(&refnames, repo, GIT_REF_LISTALL)); cl_assert_equal_i(1, (int)refnames.count); @@ -65,6 +74,4 @@ void test_network_fetchlocal__partial(void) git_strarray_free(&refnames); git_remote_free(origin); - - cl_git_sandbox_cleanup(); } diff --git a/tests-clar/odb/alternates.c b/tests-clar/odb/alternates.c index c4b364b16..be7bfa9cd 100644 --- a/tests-clar/odb/alternates.c +++ b/tests-clar/odb/alternates.c @@ -6,7 +6,7 @@ static git_buf destpath, filepath; static const char *paths[] = { "A.git", "B.git", "C.git", "D.git", "E.git", "F.git", "G.git" }; -static git_filebuf file; +static git_filebuf file; static git_repository *repo; void test_odb_alternates__cleanup(void) @@ -16,7 +16,7 @@ void test_odb_alternates__cleanup(void) git_buf_free(&destpath); git_buf_free(&filepath); - for (i=0; i