aboutsummaryrefslogtreecommitdiff
path: root/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper')
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp34
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp27
-rw-r--r--test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp27
3 files changed, 88 insertions, 0 deletions
diff --git a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp
new file mode 100644
index 000000000000..47343388501d
--- /dev/null
+++ b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/freeze.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// void freeze(bool freezefl = true);
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+ {
+ std::strstream out;
+ out.freeze();
+ assert(!out.fail());
+ out << 'a';
+ assert(out.fail());
+ out.clear();
+ out.freeze(false);
+ out << 'a';
+ out << char(0);
+ assert(out.str() == std::string("a"));
+ out.freeze(false);
+ }
+}
diff --git a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp
new file mode 100644
index 000000000000..18b6350d58c0
--- /dev/null
+++ b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/pcount.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// int pcount() const;
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+ {
+ std::strstream out;
+ assert(out.pcount() == 0);
+ out << 123 << ' ' << 4.5 << ' ' << "dog";
+ assert(out.pcount() == 11);
+ }
+}
diff --git a/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp
new file mode 100644
index 000000000000..5c273dc45d2d
--- /dev/null
+++ b/test/std/depr/depr.str.strstreams/depr.strstream/depr.strstream.oper/str.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <strstream>
+
+// class strstream
+
+// char* str();
+
+#include <strstream>
+#include <cassert>
+
+int main()
+{
+ {
+ std::strstream out;
+ out << 123 << ' ' << 4.5 << ' ' << "dog" << std::ends;
+ assert(out.str() == std::string("123 4.5 dog"));
+ out.freeze(false);
+ }
+}