Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-01-03 22:07:41 +0400
committerVicent Marti <tanoku@gmail.com>2013-01-03 22:07:41 +0400
commitf6fded8f9110aa05fe3d947d9e53cbd5cc13d1d5 (patch)
tree7698f06fdb887b5ea4bef471c66104161e88a80d /tests-clar/config
parent600d8dbf6dccff5a9d86dd5ae01a53de46471796 (diff)
Proper cleanup jeez
Diffstat (limited to 'tests-clar/config')
-rw-r--r--tests-clar/config/read.c12
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"));