Skip to content

Commit 9ffdadd

Browse files
committed
Add test with different locale to Value test
1 parent 845c1fd commit 9ffdadd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/scratch_classes/value_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,9 @@ TEST(ValueTest, ToLong)
11611161

11621162
TEST(ValueTest, ToDouble)
11631163
{
1164+
std::string oldLocale = std::setlocale(LC_NUMERIC, nullptr);
1165+
std::setlocale(LC_NUMERIC, "sk_SK.UTF-8");
1166+
11641167
Value v = 2147483647;
11651168
ASSERT_EQ(v.toDouble(), 2147483647.0);
11661169
v = -2147483647;
@@ -1270,6 +1273,8 @@ TEST(ValueTest, ToDouble)
12701273
v = "0b100112001";
12711274
ASSERT_TRUE(v.isString());
12721275
ASSERT_EQ(v.toDouble(), 0);
1276+
1277+
std::setlocale(LC_NUMERIC, oldLocale.c_str());
12731278
}
12741279

12751280
TEST(ValueTest, ToBool)

0 commit comments

Comments
 (0)