]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_streambuf/cons/57394.cc
1 // Copyright (C) 2014-2016 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-options "-std=gnu++11" }
19 // { dg-require-namedlocale "de_DE.ISO8859-15" }
21 // 27.6.3 template class basic_streambuf
24 #include <testsuite_hooks.h>
26 struct streambuf
: std::streambuf
30 setp(pbuf
, std::end(pbuf
));
31 setg(gbuf
, gbuf
, gbuf
);
34 streambuf(const std::locale
& loc
) : streambuf()
39 // implement tests as member functions to be able to call protected members
40 void test_copy() const;
41 void test_assign() const;
42 void test_swap() const;
48 void streambuf::test_copy() const
50 bool test
__attribute__((unused
)) = true;
54 VERIFY( eback() == a
.eback() );
55 VERIFY( gptr() == a
.gptr() );
56 VERIFY( egptr() == a
.egptr() );
57 VERIFY( pbase() == a
.pbase() );
58 VERIFY( pptr() == a
.pptr() );
59 VERIFY( epptr() == a
.epptr() );
60 VERIFY( getloc() == a
.getloc() );
63 void streambuf::test_assign() const
65 bool test
__attribute__((unused
)) = true;
70 VERIFY( eback() == a
.eback() );
71 VERIFY( gptr() == a
.gptr() );
72 VERIFY( egptr() == a
.egptr() );
73 VERIFY( pbase() == a
.pbase() );
74 VERIFY( pptr() == a
.pptr() );
75 VERIFY( epptr() == a
.epptr() );
76 VERIFY( getloc() == a
.getloc() );
79 void streambuf::test_swap() const
81 bool test
__attribute__((unused
)) = true;
89 VERIFY( eback() == b
.eback() );
90 VERIFY( gptr() == b
.gptr() );
91 VERIFY( egptr() == b
.egptr() );
92 VERIFY( pbase() == b
.pbase() );
93 VERIFY( pptr() == b
.pptr() );
94 VERIFY( epptr() == b
.epptr() );
95 VERIFY( getloc() == b
.getloc() );
97 VERIFY( c
.eback() == a
.eback() );
98 VERIFY( c
.gptr() == a
.gptr() );
99 VERIFY( c
.egptr() == a
.egptr() );
100 VERIFY( c
.pbase() == a
.pbase() );
101 VERIFY( c
.pptr() == a
.pptr() );
102 VERIFY( c
.epptr() == a
.epptr() );
103 VERIFY( c
.getloc() == a
.getloc() );
108 std::locale
loc(ISO_8859(15,de_DE
));