Patchwork regex traits test not testing wchar_t

login
register
mail settings
Submitter Ed Smith-Rowland
Date Sept. 11, 2013, 1:34 a.m.
Message ID <522FC89E.7070602@verizon.net>
Download mbox | patch
Permalink /patch/274094/
State New
Headers show

Comments

Ed Smith-Rowland - Sept. 11, 2013, 1:34 a.m.
On 09/09/2013 06:45 PM, Paolo Carlini wrote:
> Hi,
>
> On 09/09/2013 11:54 PM, 3dw4rd@verizon.net wrote:
>> All,
>>
>> I noticed this while prepping an experiment in binary number output.  
>> I think a test of std::regex_traits<char> was simply copied to the 
>> wchar_t directory without changing the guts of the test.
>>
>> Testing (on x86_64-linux) is ongoing but here is the patch and log.  
>> I wanted to give fold a chance to look it over.
> Ok if testing passes.
>
> Thanks,
> Paolo.
>
Passed testing on x86_64-linux.
Committed.

2013-09-10  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* testsuite/28_regex/traits/wchar_t/value.cc: Change template args
	from char to wchar_t, literals from 'x' to L'x'.

Patch

Index: testsuite/28_regex/traits/wchar_t/value.cc
===================================================================
--- testsuite/28_regex/traits/wchar_t/value.cc	(revision 202407)
+++ testsuite/28_regex/traits/wchar_t/value.cc	(working copy)
@@ -25,20 +25,20 @@ 
 #include <regex>
 #include <testsuite_hooks.h>
 
-// Tests the value() function of the regex_traits<char> class.
+// Tests the value() function of the regex_traits<wchar_t> class.
 void test01()
 {
   bool test __attribute__((unused)) = true;
-  std::regex_traits<char> t;
-  VERIFY( t.value('7', 8)  == 7 );
-  VERIFY( t.value('7', 10) == 7 );
-  VERIFY( t.value('7', 16) == 7 );
-  VERIFY( t.value('9', 8)  == -1 );
-  VERIFY( t.value('9', 10) == 9 );
-  VERIFY( t.value('9', 16) == 9 );
-  VERIFY( t.value('d', 8)  == -1 );
-  VERIFY( t.value('d', 10) == -1 );
-  VERIFY( t.value('d', 16) == 13 );
+  std::regex_traits<wchar_t> t;
+  VERIFY( t.value(L'7', 8)  == 7 );
+  VERIFY( t.value(L'7', 10) == 7 );
+  VERIFY( t.value(L'7', 16) == 7 );
+  VERIFY( t.value(L'9', 8)  == -1 );
+  VERIFY( t.value(L'9', 10) == 9 );
+  VERIFY( t.value(L'9', 16) == 9 );
+  VERIFY( t.value(L'd', 8)  == -1 );
+  VERIFY( t.value(L'd', 10) == -1 );
+  VERIFY( t.value(L'd', 16) == 13 );
 }
 
 int