Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

// string grouping() const;

#include <iostream>
#include <locale>
#include <limits>
#include <cassert>
Expand Down Expand Up @@ -89,27 +90,22 @@ int main(int, char**)
}
#endif

#if defined( _WIN32) || defined(_AIX)
std::string us_grouping = "\3";
#else
std::string us_grouping = "\3\3";
#endif
{
Fnf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == us_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fnt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == us_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
Fwf f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == us_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fwt f(LOCALE_en_US_UTF_8, 1);
assert(f.grouping() == us_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#endif

Expand All @@ -132,27 +128,22 @@ int main(int, char**)
}
#endif

#if defined( _WIN32) || defined(_AIX)
std::string ru_grouping = "\3";
#else
std::string ru_grouping = "\3\3";
#endif
{
Fnf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == ru_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fnt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == ru_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
Fwf f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == ru_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
{
Fwt f(LOCALE_ru_RU_UTF_8, 1);
assert(f.grouping() == ru_grouping);
assert(f.grouping() == "\3" || f.grouping() == "\3\3");
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,13 @@ int main(int, char**)
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
#if defined(_WIN32) || defined(_AIX)
assert(np.grouping() == "\3");
#else
assert(np.grouping() == "\3\3");
#endif
assert(np.grouping() == "\3" || np.grouping() == "\3\3");
}
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
{
typedef wchar_t C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
# if defined(_WIN32) || defined(_AIX)
assert(np.grouping() == "\3");
# else
assert(np.grouping() == "\3\3");
# endif
assert(np.grouping() == "\3" || np.grouping() == "\3\3");
}
#endif
}
Expand Down
Loading