]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/manipulators/standard/char/1.cc
Reshuffle 27_io testsuite.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / manipulators / standard / char / 1.cc
1 // Copyright (C) 2002 Free Software Foundation, Inc.
2 //
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 2, or (at your option)
7 // any later version.
8
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.
13
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING. If not, write to the Free
16 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 // USA.
18
19 // 27.6.3 - Standard manipulators
20
21 #include <sstream>
22 #include <iomanip>
23 #include <testsuite_hooks.h>
24
25 void
26 test01()
27 {
28 using namespace std;
29 bool test = true;
30
31 string s("john coltrane, a love supreme");
32 istringstream iss(s);
33 ostringstream oss;
34
35 // resetiosflags
36 resetiosflags(ios_base::boolalpha);
37 iss >> resetiosflags(ios_base::boolalpha);
38 VERIFY(iss.good());
39 oss << resetiosflags(ios_base::boolalpha);
40 VERIFY(oss.good());
41
42 // setiosflags
43 setiosflags(ios_base::skipws);
44 iss >> setiosflags(ios_base::skipws);
45 VERIFY(iss.good());
46 oss << setiosflags(ios_base::skipws);
47 VERIFY(oss.good());
48
49 // setbase
50 setbase(8);
51 iss >> setbase(8);
52 VERIFY(iss.good());
53 oss << setbase(8);
54 VERIFY(oss.good());
55
56 // setfil
57 setfill('a');
58 iss >> setfill('a');
59 VERIFY(iss.good());
60 oss << setfill('a');
61 VERIFY(oss.good());
62
63 // setprecision
64 setprecision(4);
65 iss >> setprecision(4);
66 VERIFY(iss.good());
67 oss << setprecision(4);
68 VERIFY(oss.good());
69
70 // setprecision
71 setw(7);
72 iss >> setw(7);
73 VERIFY(iss.good());
74 oss << setw(7);
75 VERIFY(oss.good());
76 }
77
78
79 int
80 main()
81 {
82 test01();
83 return 0;
84 }