exit_handler_intel_x64_unittests_io.cpp
Go to the documentation of this file.
1 //
2 // Bareflank Hypervisor
3 //
4 // Copyright (C) 2015 Assured Information Security, Inc.
5 // Author: Rian Quinn <quinnr@ainfosec.com>
6 // Author: Brendan Kerrigan <kerriganb@ainfosec.com>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
23 
24 #ifdef INCLUDE_LIBCXX_UNITTESTS
25 
26 #include <iomanip>
27 #include <iostream>
28 
29 void
30 exit_handler_intel_x64::unittest_1100_io_cout() const
31 {
32  std::cout << "hello world" << std::endl;
33  std::cout << 10 << std::endl;
34  std::cout << 10U << std::endl;
35  std::cout << 10L << std::endl;
36  std::cout << 10UL << std::endl;
37  std::cout << view_as_pointer(10UL) << std::endl;
38 }
39 
40 void
41 exit_handler_intel_x64::unittest_1101_io_manipulators() const
42 {
43  std::cout << std::boolalpha << true << '\n';
44  std::cout << std::boolalpha << false << '\n';
45  std::cout << std::noboolalpha << true << '\n';
46  std::cout << std::noboolalpha << false << '\n';
47 
48  std::cout << std::noshowbase << 3.14 << '\n';
49  std::cout << std::noshowpoint << 3.14 << '\n';
50  std::cout << std::noshowpos << 3.14 << '\n';
51  std::cout << std::noskipws << 3.14 << '\n';
52  std::cout << std::nounitbuf << 3.14 << '\n';
53  std::cout << std::nouppercase << 3.14 << '\n';
54 
55  std::cout << std::showbase << 3.14 << '\n';
56  std::cout << std::showpoint << 3.14 << '\n';
57  std::cout << std::showpos << 3.14 << '\n';
58  std::cout << std::skipws << 3.14 << '\n';
59  std::cout << std::unitbuf << 3.14 << '\n';
60  std::cout << std::uppercase << 3.14 << '\n';
61 
62  std::cout << std::hex << 1 << '\n';
63  std::cout << std::hex << 11 << '\n';
64  std::cout << std::oct << 1 << '\n';
65  std::cout << std::oct << 11 << '\n';
66  std::cout << std::dec << 1 << '\n';
67  std::cout << std::dec << 11 << '\n';
68  std::cout << std::setbase(10) << 1 << '\n';
69  std::cout << std::setbase(10) << 11 << '\n';
70 
71  std::cout << std::scientific << 3.14 << '\n';
72  std::cout << std::setprecision(2) << 3.14 << '\n';
73 
74  std::cout << std::fixed << 3.14 << '\n';
75  std::cout << std::fixed << 3.14 << '\n';
76 
77  std::cout << std::internal << 42 << '\n';
78  std::cout << std::left << 42 << '\n';
79  std::cout << std::right << 42 << '\n';
80 
81  std::cout << std::setfill('0') << std::setw(10) << 10 << std::endl;
82 
83  std::cout << std::endl;
84  std::cout << std::ends;
85  std::cout << std::flush;
86 }
87 
88 #endif
void flush()
Definition: main.cpp:40
const void * view_as_pointer(const T val)