mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Fix gnc-numeric locale test on travis
- Change locale from de_DE to fr_FR.utf8 - Expect correct thousands separator This also partly undoes the previous commit (it removes the test for gcc 5 or more)
This commit is contained in:
@@ -350,13 +350,12 @@ std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>&
|
||||
std::locale loc = s.getloc();
|
||||
ss.imbue(loc);
|
||||
char dec_pt = '.';
|
||||
#if __GNUC__ >= 5
|
||||
try
|
||||
{
|
||||
dec_pt = std::use_facet<std::numpunct<char>>(loc).decimal_point();
|
||||
}
|
||||
catch(const std::bad_cast& err) {} //Don't do anything, num_sep is already set.
|
||||
#endif
|
||||
|
||||
ss.copyfmt(s);
|
||||
ss.width(0);
|
||||
if (n.denom() == 1)
|
||||
|
||||
@@ -211,18 +211,16 @@ TEST(gncnumeric_stream, output_stream)
|
||||
GncNumeric rational_string(123, 456);
|
||||
output << rational_string;
|
||||
EXPECT_EQ("123/456", output.str());
|
||||
#if __GNUC__ >= 5
|
||||
output.imbue(std::locale("de_DE"));
|
||||
output.imbue(std::locale("fr_FR.utf8"));
|
||||
output.str("");
|
||||
output << simple_int;
|
||||
EXPECT_EQ("123456", output.str());
|
||||
EXPECT_EQ("123 456", output.str());
|
||||
output.str("");
|
||||
output << decimal_string;
|
||||
EXPECT_EQ("123,456", output.str());
|
||||
output.str("");
|
||||
output << rational_string;
|
||||
EXPECT_EQ("123/456", output.str());
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(gncnumeric_stream, input_stream)
|
||||
|
||||
Reference in New Issue
Block a user