diff options
author | Ben Straub <bs@github.com> | 2013-01-03 21:10:38 +0400 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-01-03 21:10:38 +0400 |
commit | 600d8dbf6dccff5a9d86dd5ae01a53de46471796 (patch) | |
tree | ac1d09e8e3ae38d96c071a8869544f0959cf06ec /tests-clar/index/tests.c | |
parent | bffbeebbec2878c5329e63b40ecae3715423eac6 (diff) |
Move test cleanup into cleanup functions
Diffstat (limited to 'tests-clar/index/tests.c')
-rw-r--r-- | tests-clar/index/tests.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests-clar/index/tests.c b/tests-clar/index/tests.c index 8359ce027..d2ad71cc6 100644 --- a/tests-clar/index/tests.c +++ b/tests-clar/index/tests.c @@ -24,6 +24,7 @@ static struct test_entry test_entries[] = { {48, "src/revobject.h", 1448, 0x4C3F7FE2} }; +static char *path_to_cleanup = NULL; // Helpers static void copy_file(const char *src, const char *dst) @@ -74,6 +75,9 @@ void test_index_tests__initialize(void) void test_index_tests__cleanup(void) { + if (path_to_cleanup) + cl_fixture_cleanup(path_to_cleanup); + path_to_cleanup = NULL; } @@ -246,7 +250,7 @@ void test_index_tests__add(void) git_index_free(index); git_repository_free(repo); - cl_fixture_cleanup("myrepo"); + path_to_cleanup = "myrepo"; } void test_index_tests__add_from_workdir_to_a_bare_repository_returns_EBAREPO(void) |