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]

[v3] Fix a 27_io testcase


Hi,

as noticed by Kaveh, tested x86-linux, committed.

(took the occasion to rotate the ChangeLog)

Paolo.

//////////////////
2005-01-01  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/27_io/basic_istream/extractors_character/char/1.cc: Fix,
	null-terminate array1 at the outset.
	* testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc:
	Likewise.
diff -urN libstdc++-v3-orig/testsuite/27_io/basic_istream/extractors_character/char/1.cc libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc
--- libstdc++-v3-orig/testsuite/27_io/basic_istream/extractors_character/char/1.cc	2003-09-23 22:03:07.000000000 +0200
+++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc	2005-01-01 21:35:25.000000000 +0100
@@ -1,6 +1,6 @@
 // 1999-07-26 bkoz
 
-// Copyright (C) 1999, 2003 Free Software Foundation
+// Copyright (C) 1999, 2003, 2005 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -41,8 +41,9 @@
 
   // template<_CharT, _Traits>
   //  basic_istream& operator>>(istream&, _CharT*)
-  int n = 20;
+  const int n = 20;
   char array1[n];
+  array1[0] = '\0';
   typedef std::ios::traits_type ctraits_type;
   ctraits_type::int_type i1, i2;
 
diff -urN libstdc++-v3-orig/testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc
--- libstdc++-v3-orig/testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc	2004-12-19 22:57:27.000000000 +0100
+++ libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc	2005-01-01 21:36:03.000000000 +0100
@@ -1,4 +1,4 @@
-// Copyright (C) 2004 Free Software Foundation
+// Copyright (C) 2004, 2005 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -39,8 +39,9 @@
 
   // template<_CharT, _Traits>
   //  basic_istream& operator>>(istream&, _CharT*)
-  int n = 20;
+  const int n = 20;
   wchar_t array1[n];
+  array1[0] = L'\0';
   typedef std::wios::traits_type ctraits_type;
   ctraits_type::int_type i1, i2;
 

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