summaryrefslogtreecommitdiff
path: root/src/test/test_libconfig.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-11-20 00:47:22 +0100
committerHaru <haru@dotalux.com>2016-11-20 18:10:47 +0100
commitc12429cd00ce531b2ff685c201d74e2576c2a4aa (patch)
tree085bcf17d42535c93083dba8f5870c2223684fd6 /src/test/test_libconfig.c
parent149a531652da670c3f9c796d73e17b5a985383c1 (diff)
downloadhercules-c12429cd00ce531b2ff685c201d74e2576c2a4aa.tar.gz
hercules-c12429cd00ce531b2ff685c201d74e2576c2a4aa.tar.bz2
hercules-c12429cd00ce531b2ff685c201d74e2576c2a4aa.tar.xz
hercules-c12429cd00ce531b2ff685c201d74e2576c2a4aa.zip
Removed support for apostrophes in libconfig key names
The apostrophe (`'`) is no longer an allowed symbol in libconfig key names. It is no longer necessary since it is no longer allowed in constant names. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/test/test_libconfig.c')
-rw-r--r--src/test/test_libconfig.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/test/test_libconfig.c b/src/test/test_libconfig.c
index 639cf64e8..e1a767195 100644
--- a/src/test/test_libconfig.c
+++ b/src/test/test_libconfig.c
@@ -691,19 +691,22 @@ static const char *test_libconfig_setting_names(void)
struct config_t config;
int32 i32;
const char *input = "/* Test File */\n"
- "Setting'with'apostrophes: 1;\n"
+ "1st_setting_with_numbers: 1;\n"
"Setting.with.periods: 2;\n"
"Setting: {\n"
" with: {\n"
" periods: 3;\n"
+ " 2nested: {\n"
+ " numbers1: 4;\n"
+ " };\n"
" };\n"
" nested: {\n"
" in: {\n"
- " groups: 4;\n"
+ " groups: 5;\n"
" };\n"
" };\n"
"};\n"
- "1st_setting_with_numbers: 5;\n"
+ "Setting_with_2_numbers_000: 6;\n"
"/* End test file */\n";
libconfig->init(&config);
@@ -713,9 +716,9 @@ static const char *test_libconfig_setting_names(void)
return "Unable to parse configuration.";
}
- if (libconfig->lookup_int(&config, "Setting'with'apostrophes", &i32) == CONFIG_FALSE || i32 != 1) {
+ if (libconfig->lookup_int(&config, "1st_setting_with_numbers", &i32) == CONFIG_FALSE || i32 != 1) {
libconfig->destroy(&config);
- return "Setting'with'apostrophes failed.";
+ return "1st_setting_with_numbers failed.";
}
if (libconfig->lookup_int(&config, "Setting.with.periods", &i32) == CONFIG_FALSE || i32 != 2) {
@@ -728,19 +731,24 @@ static const char *test_libconfig_setting_names(void)
return "Setting:with:periods failed.";
}
- if (libconfig->lookup_int(&config, "Setting:nested:in:groups", &i32) == CONFIG_FALSE || i32 != 4) {
+ if (libconfig->lookup_int(&config, "Setting/with/2nested/numbers1", &i32) == CONFIG_FALSE || i32 != 4) {
+ libconfig->destroy(&config);
+ return "Setting/with/2nested/numbers1 failed.";
+ }
+
+ if (libconfig->lookup_int(&config, "Setting:nested:in:groups", &i32) == CONFIG_FALSE || i32 != 5) {
libconfig->destroy(&config);
return "Setting:nested:in:groups failed.";
}
- if (libconfig->lookup_int(&config, "Setting/nested/in/groups", &i32) == CONFIG_FALSE || i32 != 4) {
+ if (libconfig->lookup_int(&config, "Setting/nested/in/groups", &i32) == CONFIG_FALSE || i32 != 5) {
libconfig->destroy(&config);
return "Setting/nested/in/groups failed.";
}
- if (libconfig->lookup_int(&config, "1st_setting_with_numbers", &i32) == CONFIG_FALSE || i32 != 5) {
+ if (libconfig->lookup_int(&config, "Setting_with_2_numbers_000", &i32) == CONFIG_FALSE || i32 != 6) {
libconfig->destroy(&config);
- return "1st_setting_with_numbers failed.";
+ return "Setting_with_2_numbers_000 failed.";
}
libconfig->destroy(&config);