Skip to content

Commit 4b4a919

Browse files
committed
Reduce regex test
1 parent de4102e commit 4b4a919

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

libcxx/test/std/re/re.traits/getloc.pass.cpp

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,27 @@
1616

1717
#include <regex>
1818
#include <cassert>
19+
#include <cstdio>
1920

2021
#include "test_macros.h"
2122
#include "platform_support.h" // locale name macros
2223

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+
}
4841
return 0;
4942
}

0 commit comments

Comments
 (0)