aboutsummaryrefslogtreecommitdiff
path: root/test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.pass.cpp')
-rw-r--r--test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.pass.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.pass.cpp b/test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.pass.cpp
new file mode 100644
index 000000000000..99a33c71c893
--- /dev/null
+++ b/test/std/input.output/iostreams.base/std.ios.manip/fmtflags.manip/unitbuf.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& unitbuf(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::unitbuf(ios);
+ assert(&r == &ios);
+ assert(ios.flags() & std::ios::unitbuf);
+}