diff options
author | Vicent Marti <tanoku@gmail.com> | 2013-01-03 22:07:41 +0400 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2013-01-03 22:07:41 +0400 |
commit | f6fded8f9110aa05fe3d947d9e53cbd5cc13d1d5 (patch) | |
tree | 7698f06fdb887b5ea4bef471c66104161e88a80d /tests-clar/config | |
parent | 600d8dbf6dccff5a9d86dd5ae01a53de46471796 (diff) |
Proper cleanup jeez
Diffstat (limited to 'tests-clar/config')
-rw-r--r-- | tests-clar/config/read.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests-clar/config/read.c b/tests-clar/config/read.c index b603acb5c..9c02307ad 100644 --- a/tests-clar/config/read.c +++ b/tests-clar/config/read.c @@ -1,10 +1,5 @@ #include "clar_libgit2.h" -void test_config_read__cleanup(void) -{ - cl_fixture_cleanup("./empty"); -} - void test_config_read__simple_read(void) { git_config *cfg; @@ -436,11 +431,18 @@ void test_config_read__simple_read_from_specific_level(void) git_config_free(cfg); } +static void clean_empty_config(void *unused) +{ + GIT_UNUSED(unused); + cl_fixture_cleanup("./empty"); +} + void test_config_read__can_load_and_parse_an_empty_config_file(void) { git_config *cfg; int i; + cl_set_cleanup(&clean_empty_config, NULL); cl_git_mkfile("./empty", ""); cl_git_pass(git_config_open_ondisk(&cfg, "./empty")); cl_assert_equal_i(GIT_ENOTFOUND, git_config_get_int32(&i, cfg, "nope.neither")); |