This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[libstdc++ PATCH] Fix 22_locale/num_put_members*.cc tests


Hi!

char_traits<char_type>::find is declared as:

static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);

thus it is a bad idea to search in numpuntc_de.decimal_point()
characters for character equal to the length of the string.

Ok to commit?

2002-10-23  Jakub Jelinek  <jakub@redhat.com>

	* testsuite/22_locale/num_put_members_char.cc (test01): Swap size
	and decimal_point arguments of find.
	* testsuite/22_locale/num_put_members_wchar_t.cc (test01): Likewise.

--- libstdc++-v3/testsuite/22_locale/num_put_members_char.cc.jj	2002-09-30 17:33:35.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_put_members_char.cc	2002-10-23 15:58:36.000000000 +0200
@@ -202,8 +202,8 @@ void test01()
   result1 = oss.str();
   // No grouping characters.
   VERIFY( !char_traits<char>::find(result1.c_str(), 
-				   numpunct_de.decimal_point(), 
-				   result1.size()) );
+				   result1.size(),
+				   numpunct_de.decimal_point()) );
   // Should contain an 'x'.
   VERIFY( result1.find('x') == 1 );
 
--- libstdc++-v3/testsuite/22_locale/num_put_members_wchar_t.cc.jj	2002-09-30 17:33:35.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/num_put_members_wchar_t.cc	2002-10-23 15:59:11.000000000 +0200
@@ -203,8 +203,8 @@ void test01()
   result1 = oss.str();
   // No grouping characters.
   VERIFY( !char_traits<wchar_t>::find(result1.c_str(), 
-				   numpunct_de.decimal_point(), 
-				   result1.size()) );
+				   result1.size(),
+				   numpunct_de.decimal_point()) );
   // Should contain an 'x'.
   VERIFY( result1.find(L'x') == 1 );
 

	Jakub


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