From 86ebf13d1117909e618094e6a459ec301cdc0ca3 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Wed, 27 Aug 2014 10:00:45 +0200 Subject: [PATCH] test other case in get_user_cfgfile_path() --- tests/util_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/util_test.c b/tests/util_test.c index a387263..12e70f7 100644 --- a/tests/util_test.c +++ b/tests/util_test.c @@ -36,8 +36,13 @@ void test_get_user_cfgfile_path() { char *file; int ret = get_user_cfgfile_path("/foo/bar", "test", "root", &file); - fprintf(stderr, "foo: %s\n", file); + assert(ret == 1); assert(strcmp(file, "/foo/bar/test") == 0); + free(file); + ret = get_user_cfgfile_path(NULL, "test", "root", &file); + assert(ret == 1); + assert(strcmp(file, "/root/.yubico/test") == 0); + free(file); } #endif /* HAVE_CR */