diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config/include.c | 23 | ||||
-rw-r--r-- | tests/config/refresh.c | 64 | ||||
-rw-r--r-- | tests/config/write.c | 5 |
3 files changed, 0 insertions, 92 deletions
diff --git a/tests/config/include.c b/tests/config/include.c index 58bc690ff..167814e59 100644 --- a/tests/config/include.c +++ b/tests/config/include.c @@ -51,29 +51,6 @@ void test_config_include__homedir(void) cl_sandbox_set_search_path_defaults(); } -void test_config_include__refresh(void) -{ - git_config *cfg; - const char *str; - - cl_fixture_sandbox("config"); - - cl_git_pass(git_config_open_ondisk(&cfg, "config/config-include")); - - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "huzzah"); - - /* Change the included file and see if we refresh */ - cl_git_mkfile("config/config-included", "[foo \"bar\"]\nbaz = hurrah"); - cl_git_pass(git_config_refresh(cfg)); - - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "hurrah"); - - git_config_free(cfg); - cl_fixture_cleanup("config"); -} - /* We need to pretend that the variables were defined where the file was included */ void test_config_include__ordering(void) { diff --git a/tests/config/refresh.c b/tests/config/refresh.c deleted file mode 100644 index 08cd45b95..000000000 --- a/tests/config/refresh.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "clar_libgit2.h" - -#define TEST_FILE "config.refresh" - -void test_config_refresh__initialize(void) -{ -} - -void test_config_refresh__cleanup(void) -{ - cl_fixture_cleanup(TEST_FILE); -} - -void test_config_refresh__update_value(void) -{ - git_config *cfg; - int32_t v; - - cl_git_mkfile(TEST_FILE, "[section]\n\tvalue = 1\n\n"); - - /* By freeing the config, we make sure we flush the values */ - cl_git_pass(git_config_open_ondisk(&cfg, TEST_FILE)); - - cl_git_pass(git_config_get_int32(&v, cfg, "section.value")); - cl_assert_equal_i(1, v); - - cl_git_rewritefile(TEST_FILE, "[section]\n\tvalue = 10\n\n"); - - cl_git_pass(git_config_refresh(cfg)); - - cl_git_pass(git_config_get_int32(&v, cfg, "section.value")); - cl_assert_equal_i(10, v); - - git_config_free(cfg); -} - -void test_config_refresh__delete_value(void) -{ - git_config *cfg; - int32_t v; - - cl_git_mkfile(TEST_FILE, "[section]\n\tvalue = 1\n\n"); - - /* By freeing the config, we make sure we flush the values */ - cl_git_pass(git_config_open_ondisk(&cfg, TEST_FILE)); - - cl_git_pass(git_config_get_int32(&v, cfg, "section.value")); - cl_assert_equal_i(1, v); - cl_git_fail(git_config_get_int32(&v, cfg, "section.newval")); - - cl_git_rewritefile(TEST_FILE, "[section]\n\tnewval = 10\n\n"); - - cl_git_fail_with(GIT_ENOTFOUND, git_config_get_int32(&v, cfg, "section.value")); - - cl_git_pass(git_config_get_int32(&v, cfg, "section.newval")); - - cl_git_pass(git_config_refresh(cfg)); - - cl_git_fail(git_config_get_int32(&v, cfg, "section.value")); - cl_git_pass(git_config_get_int32(&v, cfg, "section.newval")); - cl_assert_equal_i(10, v); - - git_config_free(cfg); -} diff --git a/tests/config/write.c b/tests/config/write.c index 0f11ae8da..067b7445b 100644 --- a/tests/config/write.c +++ b/tests/config/write.c @@ -340,10 +340,5 @@ void test_config_write__outside_change(void) cl_git_pass(git_config_get_int32(&tmp, cfg, "old.value")); cl_assert_equal_i(6, tmp); - cl_git_pass(git_config_refresh(cfg)); - - cl_git_pass(git_config_get_int32(&tmp, cfg, "old.value")); - cl_assert_equal_i(6, tmp); - git_config_free(cfg); } |