From 5b106083e79b0f6c2f3850fa1c0ac0a69b81e595 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 19 May 2016 06:48:35 -0700 Subject: [PATCH] Check if setlocale succeeded --- test/format-test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/format-test.cc b/test/format-test.cc index 52ff8a1e..31f9d574 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1214,8 +1214,8 @@ TEST(FormatterTest, FormatIntLocale) { #else const char *locale = "English_United States"; #endif - std::setlocale(LC_ALL, locale); - EXPECT_EQ("1,234,567", format("{:n}", 1234567)); + if (std::setlocale(LC_ALL, locale)) + EXPECT_EQ("1,234,567", format("{:n}", 1234567)); } TEST(FormatterTest, FormatFloat) {