I backed out changes to get_one and get_one_wide. I incorrectly thought it used
the timezone, but trying to get the actual output causes it to print a bunch of
non-sense characters at the end. Investigation is needed. Those tests are just
marked XFAIL on linux now.
http://reviews.llvm.org/D4999
Files:
test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
Index: test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
@@ -12,6 +12,9 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
+// TODO: Investigation needed.
+// XFAIL: linux
+
// <locale>
// class time_get_byname<charT, InputIterator>
@@ -60,7 +63,12 @@
}
{
const my_facet f(LOCALE_en_US_UTF_8, 1);
+ // NOTE: GLIBC uses 12 hour time for en_US.
+# if !defined(__GLIBC__)
const char in[] = "23:55:59";
+# else
+ const char in[] = "11:55:59 PM";
+# endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
Index: test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
@@ -12,6 +12,9 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
+// TODO: Investigation needed.
+// XFAIL: linux
+
// <locale>
// class time_get_byname<charT, InputIterator>
@@ -60,7 +63,12 @@
}
{
const my_facet f(LOCALE_en_US_UTF_8, 1);
+ // NOTE: GLIBC uses 12 hour time for en_US.
+# if !defined(__GLIBC__)
const wchar_t in[] = L"23:55:59";
+# else
+ const wchar_t in[] = L"11:55:59 PM";
+# endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
Index: test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
@@ -65,9 +65,18 @@
}
{
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
+# if !defined(__GLIBC__)
const char in[] = "\xD0\xBF\xD0\xBE\xD0\xBD\xD0\xB5"
"\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
"\xD0\xBD\xD0\xB8\xD0\xBA";
+# else
+ // NOTE: GLIBC uses U041F instead of 043F. It seems to be the difference
+ // between an upper and lower case letter. This changes the second
+ // byte from \xBF to \x9F.
+ const char in[] = "\xD0\x9F\xD0\xBE\xD0\xBD\xD0\xB5"
+ "\xD0\xB4\xD0\xB5\xD0\xBB\xD1\x8C"
+ "\xD0\xBD\xD0\xB8\xD0\xBA";
+# endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
Index: test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
@@ -65,7 +65,13 @@
}
{
const my_facet f(LOCALE_ru_RU_UTF_8, 1);
+# if !defined(__linux__)
const wchar_t in[] = L"\x43F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A";
+# else
+ // NOTE: GLIBC uses U041F instead of 043F. It seems to be the difference
+ // between an upper and lower case letter.
+ const wchar_t in[] = L"\x41F\x43E\x43D\x435\x434\x435\x43B\x44C\x43D\x438\x43A";
+# endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get_weekday(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);
Index: test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
@@ -10,6 +10,10 @@
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.fr_FR.UTF-8
+// GLIBC uses lower case names and their short forms end with a dot.
+// The last test returns "Today is samedi which is abbreviated sam.."
+// XFAIL: linux
+
// <locale>
// template <class CharT, class OutputIterator = ostreambuf_iterator<CharT> >
Index: test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
===================================================================
--- test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
+++ test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// Investigation needed. It seems like it might just be bad tests.
+// XFAIL: linux
+
// <locale>
// class time_put<charT, OutputIterator>
@@ -179,11 +182,14 @@
std::string ex(str, iter.base());
assert(ex == "09");
}
+ // %OB is a BSD libc extension.
+#if !defined(__GLIBC__)
{
iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'B', 'O');
std::string ex(str, iter.base());
assert(ex == "May");
}
+#endif
{
iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'e');
std::string ex(str, iter.base());
@@ -299,11 +305,14 @@
std::string ex(str, iter.base());
assert(ex == "52");
}
+ // %v is a BSD libc extension
+#if !defined(__GLIBC__)
{
iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'v');
std::string ex(str, iter.base());
assert(ex == " 2-May-2009");
}
+#endif
{
iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'W');
std::string ex(str, iter.base());
@@ -355,11 +364,17 @@
assert(ex == "%");
}
{
+ // NOTE: fails on linux. More investigation needed. Seems to
+ // be a difference in the implementation of GLIBC.
+ // I don't think this is a portible test.
iter = f.put(output_iterator<char*>(str), ios, '*', &t, '%', 'J');
std::string ex(str, iter.base());
assert(ex == "J%");
}
{
+ // NOTE: fails on linux. More investigation needed. Seems to
+ // be a difference in the implementation of GLIBC.
+ // I don't think this is a portible test.
iter = f.put(output_iterator<char*>(str), ios, '*', &t, 'J');
std::string ex(str, iter.base());
assert(ex == "J");
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits