summaryrefslogtreecommitdiff
path: root/src/test/test_libconfig.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-11-21 15:59:07 +0300
committerGitHub <noreply@github.com>2016-11-21 15:59:07 +0300
commite0bff9d14ccbdc5f0311539fd24a474e7e02741d (patch)
tree085bcf17d42535c93083dba8f5870c2223684fd6 /src/test/test_libconfig.c
parent511219ae00986d41586f99421fef2126325f1e15 (diff)
parentc12429cd00ce531b2ff685c201d74e2576c2a4aa (diff)
downloadhercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.gz
hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.bz2
hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.xz
hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.zip
Merge pull request #1514 from HerculesWS/itemdb-fixes
Itemdb AegisName fixes
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);