summaryrefslogtreecommitdiff
path: root/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-06 18:46:46 +0000
commit61b9a7258a7693d7f3674a5a1daf7b036ff1d382 (patch)
treeec41ed70ffca97240e76f9a78bb2dedba28f310c /test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip
parentf857581820d15e410e9945d2fcd5f7163be25a96 (diff)
Notes
Diffstat (limited to 'test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip')
-rw-r--r--test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/defaultfloat.pass.cpp30
-rw-r--r--test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/fixed.pass.cpp29
-rw-r--r--test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/hexfloat.pass.cpp30
-rw-r--r--test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/scientific.pass.cpp29
4 files changed, 118 insertions, 0 deletions
diff --git a/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/defaultfloat.pass.cpp b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/defaultfloat.pass.cpp
new file mode 100644
index 0000000000000..f202bc4c88121
--- /dev/null
+++ b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/defaultfloat.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+
+// class ios_base
+
+// ios_base& defaultfloat(ios_base& str);
+
+#include <ios>
+#include <streambuf>
+#include <cassert>
+
+struct testbuf : public std::streambuf {};
+
+int main()
+{
+ testbuf sb;
+ std::ios ios(&sb);
+ std::ios_base& r = std::defaultfloat(ios);
+ assert(&r == &ios);
+ assert(!(ios.flags() & std::ios::fixed));
+ assert(!(ios.flags() & std::ios::scientific));
+}
diff --git a/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/fixed.pass.cpp b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/fixed.pass.cpp
new file mode 100644
index 0000000000000..55bf2648f3ed4
--- /dev/null
+++ b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/fixed.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+
+// class ios_base
+
+// ios_base& fixed(ios_base& str);
+
+#include <ios>
+#include <streambuf>
+#include <cassert>
+
+struct testbuf : public std::streambuf {};
+
+int main()
+{
+ testbuf sb;
+ std::ios ios(&sb);
+ std::ios_base& r = std::fixed(ios);
+ assert(&r == &ios);
+ assert(ios.flags() & std::ios::fixed);
+}
diff --git a/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/hexfloat.pass.cpp b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/hexfloat.pass.cpp
new file mode 100644
index 0000000000000..2920cca83d0ec
--- /dev/null
+++ b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/hexfloat.pass.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+
+// class ios_base
+
+// ios_base& hexfloat(ios_base& str);
+
+#include <ios>
+#include <streambuf>
+#include <cassert>
+
+struct testbuf : public std::streambuf {};
+
+int main()
+{
+ testbuf sb;
+ std::ios ios(&sb);
+ std::ios_base& r = std::hexfloat(ios);
+ assert(&r == &ios);
+ assert(ios.flags() & std::ios::fixed);
+ assert(ios.flags() & std::ios::scientific);
+}
diff --git a/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/scientific.pass.cpp b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/scientific.pass.cpp
new file mode 100644
index 0000000000000..53cfd8171f39a
--- /dev/null
+++ b/test/std/input.output/iostreams.base/std.ios.manip/floatfield.manip/scientific.pass.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <ios>
+
+// class ios_base
+
+// ios_base& scientific(ios_base& str);
+
+#include <ios>
+#include <streambuf>
+#include <cassert>
+
+struct testbuf : public std::streambuf {};
+
+int main()
+{
+ testbuf sb;
+ std::ios ios(&sb);
+ std::ios_base& r = std::scientific(ios);
+ assert(&r == &ios);
+ assert(ios.flags() & std::ios::scientific);
+}