diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-08 22:47:06 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-08 22:47:06 +0400 |
commit | 1e96c9d5341e5f2b0e1af9a1088cc30d3ffb9a01 (patch) | |
tree | 83117a8715e3a412bcc284891ce26c6de939f903 /tests-clar/config | |
parent | 99dfb538addc06c2f40d29371c52dd43f0d6ceb1 (diff) |
config: add _next() and _iterator_free()
Make it look like the refs iterator API.
Diffstat (limited to 'tests-clar/config')
-rw-r--r-- | tests-clar/config/multivar.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests-clar/config/multivar.c b/tests-clar/config/multivar.c index b7283b32f..afb993c18 100644 --- a/tests-clar/config/multivar.c +++ b/tests-clar/config/multivar.c @@ -70,6 +70,22 @@ static void check_get_multivar_foreach( } } +static void check_get_multivar(git_config *cfg, int expected) +{ + git_config_iterator *iter; + git_config_entry *entry; + int n = 0; + + cl_git_pass(git_config_get_multivar(&iter, cfg, _name, NULL)); + + while (git_config_next(&entry, iter) == 0) + n++; + + cl_assert_equal_i(expected, n); + git_config_iterator_free(iter); + +} + void test_config_multivar__get(void) { git_config *cfg; @@ -101,6 +117,8 @@ void test_config_multivar__get(void) cl_git_pass(git_config_add_file_ondisk(cfg, "config/config11", GIT_CONFIG_LEVEL_SYSTEM, 1)); check_get_multivar_foreach(cfg, 2, 1); + check_get_multivar(cfg, 2); + git_config_free(cfg); } |