This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix testsuite failures with --disable-wchar_t


This fixes some FAILs seen with --disable-wchar_t, and for targets
where that's the default.

Tested powerpc64le-linux, committed to trunk.


commit e559cc2e962b0d7ec394d38c767f7d212da276aa
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Oct 3 00:28:00 2015 +0100

    Fix testsuite failures with --disable-wchar_t
    
    	* testsuite/21_strings/basic_string/literals/types.cc: Guard use of
    	wchar_t with _GLIBCXX_USE_WCHAR_T.
    	* testsuite/21_strings/basic_string/literals/values.cc: Likewise.
    	* testsuite/21_strings/basic_string/requirements/citerators.cc:
    	Likewise.
    	* testsuite/22_locale/messages/13631.cc: Likewise.
    	* testsuite/experimental/string_view/literals/types.cc: Likewise.
    	* testsuite/experimental/string_view/literals/values.cc: Likewise.

diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
index 5a31acf..8922bf2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
@@ -32,8 +32,10 @@ test01()
   static_assert(std::is_same<decltype(u8"Hello"s), std::string>::value,
 		"u8\"Hello\"s is std::string");
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   static_assert(std::is_same<decltype(L"Hello"s), std::wstring>::value,
 		"L\"Hello\"s is std::wstring");
+#endif
 
   static_assert(std::is_same<decltype(u"Hello"s), std::u16string>::value,
 		"u\"Hello\"s is std::u16string");
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
index b8dc7d9..bf60b9e 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
@@ -27,15 +27,19 @@ test01()
   using namespace std::literals::string_literals;
 
   std::string planet = "Mercury"s;
+#ifdef _GLIBCXX_USE_WCHAR_T
   std::wstring wplanet = L"Venus"s;
+#endif
   std::string u8planet = u8"Mars"s;
-  std::u16string u16planet = u"Juiter"s;
+  std::u16string u16planet = u"Jupiter"s;
   std::u32string u32planet = U"Saturn"s;
 
   VERIFY( planet == std::string("Mercury") );
+#ifdef _GLIBCXX_USE_WCHAR_T
   VERIFY( wplanet == std::wstring(L"Venus") );
+#endif
   VERIFY( u8planet == std::string(u8"Mars") );
-  VERIFY( u16planet == std::u16string(u"Juiter") );
+  VERIFY( u16planet == std::u16string(u"Jupiter") );
   VERIFY( u32planet == std::u32string(U"Saturn") );
 }
 
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc
index f1dfff1..533b3a6 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc
@@ -24,6 +24,8 @@
 int main()
 {
   __gnu_test::citerator<std::string> test1;
+#ifdef _GLIBCXX_USE_WCHAR_T
   __gnu_test::citerator<std::wstring> test2;
+#endif
   return 0;
 }
diff --git a/libstdc++-v3/testsuite/22_locale/messages/13631.cc b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
index 9feb42c..fb93c00 100644
--- a/libstdc++-v3/testsuite/22_locale/messages/13631.cc
+++ b/libstdc++-v3/testsuite/22_locale/messages/13631.cc
@@ -57,6 +57,7 @@ void test01()
 
 void test02()
 {
+#ifdef _GLIBCXX_USE_WCHAR_T
   bool test __attribute__((unused)) = true;
 
   // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
@@ -89,6 +90,7 @@ void test02()
   msgs_facet.close(msgs);
 
   VERIFY( translation1 == translation2 );
+#endif
 }
 
 int main()
diff --git a/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc b/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc
index 8b91c99..bc2b2fc 100644
--- a/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc
+++ b/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc
@@ -32,8 +32,10 @@ test01()
   static_assert(std::is_same<decltype(u8"Hello"sv), std::experimental::string_view>::value,
 		"u8\"Hello\"s is std::string_view");
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   static_assert(std::is_same<decltype(L"Hello"sv), std::experimental::wstring_view>::value,
 		"L\"Hello\"s is std::wstring_view");
+#endif
 
   static_assert(std::is_same<decltype(u"Hello"sv), std::experimental::u16string_view>::value,
 		"u\"Hello\"s is std::u16string_view");
diff --git a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc
index d96383b..3dd6b78 100644
--- a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc
+++ b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc
@@ -27,15 +27,19 @@ test01()
   using namespace std::experimental::literals::string_view_literals;
 
   std::experimental::string_view planet = "Mercury"sv;
+#ifdef _GLIBCXX_USE_WCHAR_T
   std::experimental::wstring_view wplanet = L"Venus"sv;
+#endif
   std::experimental::string_view u8planet = u8"Mars"sv;
-  std::experimental::u16string_view u16planet = u"Juiter"sv;
+  std::experimental::u16string_view u16planet = u"Jupiter"sv;
   std::experimental::u32string_view u32planet = U"Saturn"sv;
 
   VERIFY( planet == std::experimental::string_view("Mercury") );
+#ifdef _GLIBCXX_USE_WCHAR_T
   VERIFY( wplanet == std::experimental::wstring_view(L"Venus") );
+#endif
   VERIFY( u8planet == std::experimental::string_view(u8"Mars") );
-  VERIFY( u16planet == std::experimental::u16string_view(u"Juiter") );
+  VERIFY( u16planet == std::experimental::u16string_view(u"Jupiter") );
   VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") );
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]