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 | 7b6665ba2aa559cc446fea5ad772cd649f4644c5 (patch) | |
tree | d51d682852cd94d0312f00de275ae14a7eb55aed /common/ini/ini_config_ut.c | |
parent | 5028079084bf8c70213f9ba2ae8e4d37c74300ac (diff) | |
download | sssd-7b6665ba2aa559cc446fea5ad772cd649f4644c5.tar.gz sssd-7b6665ba2aa559cc446fea5ad772cd649f4644c5.tar.bz2 sssd-7b6665ba2aa559cc446fea5ad772cd649f4644c5.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 'common/ini/ini_config_ut.c')
-rw-r--r-- | common/ini/ini_config_ut.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/ini/ini_config_ut.c b/common/ini/ini_config_ut.c index 3ce08aea..6fbade6e 100644 --- a/common/ini/ini_config_ut.c +++ b/common/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) { |