summaryrefslogtreecommitdiff
path: root/test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp')
-rw-r--r--test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp b/test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp
new file mode 100644
index 0000000000000..d9ec47b7907ae
--- /dev/null
+++ b/test/std/input.output/iostreams.base/ios.base/fmtflags.state/setf_fmtflags.pass.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// fmtflags setf(fmtflags fmtfl)
+
+#include <ios>
+#include <cassert>
+
+class test
+ : public std::ios
+{
+public:
+ test()
+ {
+ init(0);
+ }
+};
+
+int main()
+{
+ test t;
+ assert(t.flags() == (test::skipws | test::dec));
+ test::fmtflags f = t.setf(test::hex | test::right);
+ assert(f == (test::skipws | test::dec));
+ assert(t.flags() == (test::skipws | test::dec | test::hex | test::right));
+}