[libcxx] r232383 - Don't hardcode the Czech locale name.
Ed Schouten
ed at nuxi.nl
Mon Mar 16 08:09:16 PDT 2015
Author: ed
Date: Mon Mar 16 10:09:15 2015
New Revision: 232383
URL: http://llvm.org/viewvc/llvm-project?rev=232383&view=rev
Log:
Don't hardcode the Czech locale name.
We already have a definition for the Czech locale name in
platform_support.h. Use this one instead.
While there, respect the common format of the tests. For most other
tests it's the case that test_iterators.h is placed right underneath the
other #includes (without an empty line). platform_support.h is included
after an empty line.
Modified:
libcxx/trunk/test/std/re/re.alg/re.alg.match/awk.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.match/basic.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.match/extended.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.search/awk.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.search/basic.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.search/extended.pass.cpp
libcxx/trunk/test/std/re/re.traits/lookup_collatename.pass.cpp
libcxx/trunk/test/std/re/re.traits/transform.pass.cpp
libcxx/trunk/test/std/re/re.traits/transform_primary.pass.cpp
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/awk.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/awk.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/awk.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/awk.pass.cpp Mon Mar 16 10:09:15 2015
@@ -19,9 +19,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
/* {
@@ -613,7 +614,7 @@ int main()
std::regex_constants::awk)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
*/ {
std::cmatch m;
const char s[] = "m";
@@ -1294,7 +1295,7 @@ int main()
std::regex_constants::awk)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/basic.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/basic.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/basic.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/basic.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -619,7 +620,7 @@ int main()
std::regex_constants::basic)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1287,7 +1288,7 @@ int main()
std::regex_constants::basic)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/ecma.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/ecma.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/ecma.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -581,7 +582,7 @@ int main()
assert(!std::regex_match(s, m, std::regex("[a[.hyphen.]z]")));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1246,7 +1247,7 @@ int main()
assert(!std::regex_match(s, m, std::wregex(L"[a[.hyphen.]z]")));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/extended.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/extended.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/extended.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/extended.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -617,7 +618,7 @@ int main()
std::regex_constants::extended)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1283,7 +1284,7 @@ int main()
std::regex_constants::extended)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/awk.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/awk.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/awk.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/awk.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -689,7 +690,7 @@ int main()
std::regex_constants::awk)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1460,7 +1461,7 @@ int main()
std::regex_constants::awk)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/basic.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/basic.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/basic.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/basic.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -691,7 +692,7 @@ int main()
std::regex_constants::basic)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1449,7 +1450,7 @@ int main()
std::regex_constants::basic)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/ecma.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/ecma.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/ecma.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/ecma.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -671,7 +672,7 @@ int main()
assert(!std::regex_search(s, m, std::regex("[a[.hyphen.]z]")));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1450,7 +1451,7 @@ int main()
assert(!std::regex_search(s, m, std::wregex(L"[a[.hyphen.]z]")));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/extended.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/extended.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/extended.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/extended.pass.cpp Mon Mar 16 10:09:15 2015
@@ -23,9 +23,10 @@
#include <regex>
#include <cassert>
-
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -689,7 +690,7 @@ int main()
std::regex_constants::extended)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::cmatch m;
const char s[] = "m";
@@ -1445,7 +1446,7 @@ int main()
std::regex_constants::extended)));
assert(m.size() == 0);
}
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
{
std::wcmatch m;
const wchar_t s[] = L"m";
Modified: libcxx/trunk/test/std/re/re.traits/lookup_collatename.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.traits/lookup_collatename.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.traits/lookup_collatename.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.traits/lookup_collatename.pass.cpp Mon Mar 16 10:09:15 2015
@@ -25,6 +25,8 @@
#include <cassert>
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
template <class char_type>
void
test(const char_type* A, const std::basic_string<char_type>& expected)
@@ -108,7 +110,7 @@ int main()
test("tild", std::string(""));
test("ch", std::string(""));
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
test("ch", std::string("ch"));
std::locale::global(std::locale("C"));
@@ -184,7 +186,7 @@ int main()
test(L"tild", std::wstring(L""));
test(L"ch", std::wstring(L""));
- std::locale::global(std::locale("cs_CZ.ISO8859-2"));
+ std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
test(L"ch", std::wstring(L"ch"));
std::locale::global(std::locale("C"));
}
Modified: libcxx/trunk/test/std/re/re.traits/transform.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.traits/transform.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.traits/transform.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.traits/transform.pass.cpp Mon Mar 16 10:09:15 2015
@@ -21,6 +21,8 @@
#include <cassert>
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -29,7 +31,7 @@ int main()
const char B[] = "B";
typedef forward_iterator<const char*> F;
assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
- t.imbue(std::locale("cs_CZ.ISO8859-2"));
+ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
}
{
@@ -38,7 +40,7 @@ int main()
const wchar_t B[] = L"B";
typedef forward_iterator<const wchar_t*> F;
assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
- t.imbue(std::locale("cs_CZ.ISO8859-2"));
+ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
}
}
Modified: libcxx/trunk/test/std/re/re.traits/transform_primary.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.traits/transform_primary.pass.cpp?rev=232383&r1=232382&r2=232383&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.traits/transform_primary.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.traits/transform_primary.pass.cpp Mon Mar 16 10:09:15 2015
@@ -22,6 +22,8 @@
#include <cassert>
#include "test_iterators.h"
+#include "platform_support.h" // locale name macros
+
int main()
{
{
@@ -31,7 +33,7 @@ int main()
typedef forward_iterator<const char*> F;
assert(t.transform_primary(F(A), F(A+1)) !=
t.transform_primary(F(Aacute), F(Aacute+1)));
- t.imbue(std::locale("cs_CZ.ISO8859-2"));
+ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
assert(t.transform_primary(F(A), F(A+1)) ==
t.transform_primary(F(Aacute), F(Aacute+1)));
}
@@ -42,7 +44,7 @@ int main()
typedef forward_iterator<const wchar_t*> F;
assert(t.transform_primary(F(A), F(A+1)) !=
t.transform_primary(F(Aacute), F(Aacute+1)));
- t.imbue(std::locale("cs_CZ.ISO8859-2"));
+ t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
assert(t.transform_primary(F(A), F(A+1)) ==
t.transform_primary(F(Aacute), F(Aacute+1)));
}
More information about the cfe-commits
mailing list