1 // 2001-05-23 Benjamin Kosnik <bkoz@redhat.com>
3 // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 // 27.7.3.2 member functions (ostringstream_members)
24 #include <testsuite_hooks.h>
26 // 03: sanity checks for strings, stringbufs
30 bool test
__attribute__((unused
)) = false;
32 // Empty string sanity check.
34 std::string::iterator __i_start
= str01
.begin();
35 std::string::iterator __i_end
= str01
.end();
36 std::string::size_type len
= str01
.size();
37 test
= __i_start
== __i_end
;
40 // Full string sanity check.
41 std::string
str02("these golden days, i spend waiting for you:\n"
42 "Betty Carter on Verve with I'm Yours and You're Mine.");
43 __i_start
= str02
.begin();
44 __i_end
= str02
.end();
46 VERIFY( __i_start
!= __i_end
);
49 // Test an empty ostringstream for sanity.
50 std::ostringstream ostrstream0
;
51 std::string str03
= ostrstream0
.str();
52 __i_start
= str03
.begin();
53 __i_end
= str03
.end();
55 VERIFY( __i_start
== __i_end
);
57 VERIFY( str01
== str03
);