diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-09-11 11:09:02 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-15 09:55:17 -0400 |
commit | b92e1d539926b946f338aad67a853fde62ab9ec0 (patch) | |
tree | b81a55ac15c0a6936f177a050f1d2b2038b59102 /ini/ini_config_ut.c | |
parent | 5b423064d5bfe413a49ff370c3f7f908af510533 (diff) | |
download | ding-libs-b92e1d539926b946f338aad67a853fde62ab9ec0.tar.gz ding-libs-b92e1d539926b946f338aad67a853fde62ab9ec0.tar.xz ding-libs-b92e1d539926b946f338aad67a853fde62ab9ec0.zip |
INI Error handling and interface cleanup
Inspired by issue #173 I reviewed the
other function of the interface and
found a lot of problems with its
error handling.
Also made INI use collection public interfaces.
Diffstat (limited to 'ini/ini_config_ut.c')
-rw-r--r-- | ini/ini_config_ut.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 3ce08ae..6fbade6 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -35,6 +35,20 @@ int basic_test(void) struct collection_item *ini_config = NULL; struct collection_item *error_set = NULL; + error = config_for_app("test", NULL, NULL, + &ini_config, INI_STOP_ON_NONE, &error_set); + if (error != EINVAL) { + printf("Expected error EINVAL got somethign else: %d\n",error); + return EINVAL; + } + + error = config_for_app("test", "foo", "bar", + &ini_config, INI_STOP_ON_ANY, &error_set); + if (error != ENOENT) { + printf("Expected error ENOENT got somethign else: %d\n",error); + return ENOENT; + } + error = config_for_app("test", "./ini.conf", "./ini.d", &ini_config, INI_STOP_ON_NONE, &error_set); if (error) { |