From 27c9029108862422def952e026e71657f8c6f625 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Sun, 15 Jun 2014 13:49:48 +0300 Subject: [PATCH] test_cfparser: allow run from top dir --- test/test_cfparser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_cfparser.c b/test/test_cfparser.c index 2409c83..894e70d 100644 --- a/test/test_cfparser.c +++ b/test/test_cfparser.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "test_common.h" @@ -117,10 +118,14 @@ static struct CfContext cfdesc2 = { rsects, &cf1 }; static void test_rel(void *ptr) { char buf[128]; + const char *fn = "test_cfparser.ini"; cleanup(); - int_check(1, cf_load_file(&cfdesc2, "test_cfparser.ini")); + if (file_size(fn) < 0) + fn = "test/test_cfparser.ini"; + + int_check(1, cf_load_file(&cfdesc2, fn)); str_check(cf1.str1, "val1"); tt_assert(cf1.def1 == NULL); -- 2.39.5