// 1999-10-11 bkoz
-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 1999-2023 Free Software Foundation, Inc.
//
// 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
// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
+// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
// 27.5.2 template class basic_streambuf
#include <streambuf>
+#include <cstring>
#include <testsuite_hooks.h>
class testbuf : public std::streambuf
testbuf(): std::streambuf()
{ }
- bool
+ void
check_pointers()
- {
- bool test = true;
- VERIFY( this->eback() == NULL );
- VERIFY( this->gptr() == NULL );
- VERIFY( this->egptr() == NULL );
- VERIFY( this->pbase() == NULL );
- VERIFY( this->pptr() == NULL );
- VERIFY( this->epptr() == NULL );
- return test;
+ {
+ VERIFY( !this->eback() );
+ VERIFY( !this->gptr() );
+ VERIFY( !this->egptr() );
+ VERIFY( !this->pbase() );
+ VERIFY( !this->pptr() );
+ VERIFY( !this->epptr() );
}
int_type
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
testbuf buf01;
- int i01 = 3;
// sputn/xsputn
- char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
- int i02 = std::strlen(lit02);
+ char lit02[] = "isotope 217: the unstable molecule on thrill jockey";
+ const int i02 = std::strlen(lit02);
+
char carray[i02 + 1];
std::memset(carray, 0, i02 + 1);