OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [testsuite/] [27_io/] [manipulators/] [standard/] [char/] [1.cc] - Blame information for rev 19

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 jlechner
// Copyright (C) 2002, 2004 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
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 __attribute__((unused)) = 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
int
79
main()
80
{
81
  test01();
82
  return 0;
83
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.