From 3d5d346aa5e794f95107a1685702e0cebfeaca2e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 27 Jun 2019 03:03:45 +0900 Subject: [PATCH] test: add testcase for issue #12883 --- src/test/test-conf-parser.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c index 1738938..597265e 100644 --- a/src/test/test-conf-parser.c +++ b/src/test/test-conf-parser.c @@ -231,6 +231,13 @@ static const char* const config_file[] = { "setting1=1\n", /* repeated settings */ "[Section]\n" + "[Section]\n" + "setting1=1\n" + "setting1=2\\\n" + " \n" /* empty line breaks continuation */ + "setting1=1\n", /* repeated settings */ + + "[Section]\n" "setting1=1\\\n" /* normal continuation */ "2\\\n" "3\n", @@ -330,32 +337,32 @@ static void test_config_parse(unsigned i, const char *s) { CONFIG_PARSE_WARN, NULL); switch (i) { - case 0 ... 3: + case 0 ... 4: assert_se(r == 0); assert_se(streq(setting1, "1")); break; - case 4 ... 9: + case 5 ... 10: assert_se(r == 0); assert_se(streq(setting1, "1 2 3")); break; - case 10: + case 11: assert_se(r == 0); assert_se(streq(setting1, "1\\\\ \\\\2")); break; - case 11: + case 12: assert_se(r == 0); assert_se(streq(setting1, x1000("ABCD"))); break; - case 12 ... 13: + case 13 ... 14: assert_se(r == 0); assert_se(streq(setting1, x1000("ABCD") " foobar")); break; - case 14 ... 15: + case 15 ... 16: assert_se(r == -ENOBUFS); assert_se(setting1 == NULL); break; -- 2.7.4