public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix std::wstring allocator tests
@ 2016-08-02 19:37 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2016-08-02 19:37 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

I had checks for defined(_GLIBCXX_USE_WCHAR_T) in these tests, which
aren't needed because the testsuite skips directories called wchar_t
if wide characters aren't supported. Some tests were also testing char
not wchar_t!

	* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
	Remove reundant check for _GLIBCXX_USE_WCHAR_T and fix char type.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.

Tested powerpc64-linux, committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 5565 bytes --]

commit 65882ebc7e36154862f8ae9fd2a9e3e0627839c7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Aug 2 20:19:35 2016 +0100

    Fix std::wstring allocator tests
    
    	* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
    	Remove reundant check for _GLIBCXX_USE_WCHAR_T and fix char type.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
    	Likewise.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
    	Likewise.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
    	Likewise.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
    	Likewise.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
    	Likewise.
    	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
    	Likewise.

diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc
index 2ed238a..110f4d9 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc
@@ -21,9 +21,9 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::propagating_allocator;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc
index fefa77f..3ac15bb 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc
@@ -21,9 +21,9 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::propagating_allocator;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc
index 3306438..1563abb 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc
@@ -22,7 +22,7 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
+#if _GLIBCXX_USE_CXX11_ABI
 using C = wchar_t;
 const C c = L'a';
 using traits = std::char_traits<C>;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move.cc
index 84504bc..1cee2ac 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move.cc
@@ -21,9 +21,9 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
 
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::uneq_allocator;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc
index d1efc0b..8c94d79 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc
@@ -21,9 +21,9 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::propagating_allocator;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc
index 0ed6940..6c462a6 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc
@@ -21,9 +21,9 @@
 #include <string>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::propagating_allocator;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc
index dd496e9..667d475 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc
@@ -21,9 +21,9 @@
 #include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
  
-#if _GLIBCXX_USE_CXX11_ABI && defined(_GLIBCXX_USE_WCHAR_T)
-using C = char;
-const C c = 'a';
+#if _GLIBCXX_USE_CXX11_ABI
+using C = wchar_t;
+const C c = L'a';
 using traits = std::char_traits<C>;
 
 using __gnu_test::propagating_allocator;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-02 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 19:37 [PATCH] Fix std::wstring allocator tests Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).