]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/22_locale/num_put/put/char/38210.cc
1 // Copyright (C) 2008-2021 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 // 22.2.2.2.1 num_put members
22 #include <testsuite_hooks.h>
29 ostringstream oss1
, oss2
, oss3
, oss4
;
30 string result1
, result2
, result3
, result4
;
32 const num_put
<char>& ng1
= use_facet
<num_put
<char> >(oss1
.getloc());
33 const num_put
<char>& ng2
= use_facet
<num_put
<char> >(oss2
.getloc());
34 const num_put
<char>& ng3
= use_facet
<num_put
<char> >(oss3
.getloc());
35 const num_put
<char>& ng4
= use_facet
<num_put
<char> >(oss4
.getloc());
40 ng1
.put(oss1
.rdbuf(), oss1
, '*', p
);
42 VERIFY( result1
== "**0x1" );
45 oss2
.setf(ios_base::right
, ios_base::adjustfield
);
46 ng2
.put(oss2
.rdbuf(), oss2
, '*', p
);
48 VERIFY( result2
== "**0x1" );
51 oss3
.setf(ios_base::internal
, ios_base::adjustfield
);
52 ng3
.put(oss3
.rdbuf(), oss3
, '*', p
);
54 VERIFY( result3
== "0x**1" );
57 oss4
.setf(ios_base::left
, ios_base::adjustfield
);
58 ng4
.put(oss4
.rdbuf(), oss4
, '*', p
);
60 VERIFY( result4
== "0x1**" );