summaryrefslogtreecommitdiffstats
path: root/config/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-06-14 16:39:42 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-06-19 14:32:59 +0200
commita0b7b206752e54118ef0b0ce88987e88ddb2d689 (patch)
tree54d2f955d097ab72afbe6ce85b6c5def3076a08e /config/src/tests
parent86e346744713ce715b94ae70a0233f46c4ab61c4 (diff)
Make double parsing independent of locale.
Diffstat (limited to 'config/src/tests')
-rw-r--r--config/src/tests/configparser/configparser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/config/src/tests/configparser/configparser.cpp b/config/src/tests/configparser/configparser.cpp
index f361a4b8162..23dbc77488b 100644
--- a/config/src/tests/configparser/configparser.cpp
+++ b/config/src/tests/configparser/configparser.cpp
@@ -108,6 +108,14 @@ TEST("require that escaped values are properly unescaped") {
ASSERT_EQUAL("a\nb\rc\\d\"eBg", value);
}
+IGNORE_TEST("verify that locale does not affect double parsing") { // Failing on some CentOS based environments
+ std::vector<vespalib::string> payload;
+ setlocale(LC_NUMERIC, "nb_NO.UTF-8");
+ payload.push_back("foo 3,14");
+ ASSERT_EXCEPTION(ConfigParser::parse<double>("foo", payload), InvalidConfigException, "Value 3,14 is not a legal double");
+ setlocale(LC_NUMERIC, "C");
+}
+
TEST("require that maps can be parsed")
{
writeFile("foo.cfg", "\nfooValue \"a\"\nfooMap{\"foo\"} 1336\nfooMap{\"bar\"} 1337\n");