|
16 | 16 |
|
17 | 17 | #include <regex> |
18 | 18 | #include <cassert> |
| 19 | +#include <cstdio> |
19 | 20 |
|
20 | 21 | #include "test_macros.h" |
21 | 22 | #include "platform_support.h" // locale name macros |
22 | 23 |
|
23 | | -int main(int, char**) |
24 | | -{ |
25 | | - { |
26 | | - std::regex_traits<char> t; |
27 | | - assert(t.getloc().name() == "C"); |
28 | | - } |
29 | | -#ifndef TEST_HAS_NO_WIDE_CHARACTERS |
30 | | - { |
31 | | - std::regex_traits<wchar_t> t; |
32 | | - assert(t.getloc().name() == "C"); |
33 | | - } |
34 | | -#endif |
35 | | - { |
36 | | - std::locale::global(std::locale(LOCALE_en_US_UTF_8)); |
37 | | - std::regex_traits<char> t; |
38 | | - assert(t.getloc().name() == LOCALE_en_US_UTF_8); |
39 | | - } |
40 | | -#ifndef TEST_HAS_NO_WIDE_CHARACTERS |
41 | | - { |
42 | | - std::locale::global(std::locale(LOCALE_en_US_UTF_8)); |
43 | | - std::regex_traits<wchar_t> t; |
44 | | - assert(t.getloc().name() == LOCALE_en_US_UTF_8); |
45 | | - } |
46 | | -#endif |
47 | | - |
| 24 | +int main(int, char**) { |
| 25 | + std::fprintf(stderr, "Entering main()\n"); |
| 26 | + { |
| 27 | + std::regex_traits<char> t; |
| 28 | + std::fprintf(stderr, "Running t.getloc()\n"); |
| 29 | + assert(t.getloc().name() == "C"); |
| 30 | + } |
| 31 | + { |
| 32 | + std::fprintf(stderr, "Creating locale\n"); |
| 33 | + std::locale loc(LOCALE_en_US_UTF_8); |
| 34 | + |
| 35 | + std::fprintf(stderr, "Setting locale globally\n"); |
| 36 | + std::locale::global(loc); |
| 37 | + std::regex_traits<char> t; |
| 38 | + std::fprintf(stderr, "Running t.getloc()\n"); |
| 39 | + assert(t.getloc().name() == LOCALE_en_US_UTF_8); |
| 40 | + } |
48 | 41 | return 0; |
49 | 42 | } |
0 commit comments