]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/process/test/pipe.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / process / test / pipe.cpp
index 809ebb941a5ee0d5f7cb9a9764568173de429f6e..cb0caf8dc3e266fe20808472e62d862852966bb9 100644 (file)
@@ -102,6 +102,110 @@ BOOST_AUTO_TEST_CASE(stream, *boost::unit_test::timeout(2))
     BOOST_CHECK_EQUAL(i, j);
 }
 
+BOOST_AUTO_TEST_CASE(stream_move, *boost::unit_test::timeout(2))
+{
+
+    bp::pipe pipe;
+
+    bp::pstream os(pipe);
+    bp::ipstream is(pipe);
+
+    int i = 42, j = 0, k = 0;
+
+    os << i << std::endl;
+    os << std::endl;
+    is >> j;
+
+    BOOST_CHECK_EQUAL(i, j);
+
+    bp::pstream os2 = std::move(os);
+    bp::ipstream is2 = std::move(is);
+    os2 << i << std::endl;
+    os2 << std::endl;
+    is2 >> k;
+
+    BOOST_CHECK_EQUAL(i, k);
+}
+
+BOOST_AUTO_TEST_CASE(ostream_move, *boost::unit_test::timeout(2))
+{
+
+    bp::pipe pipe;
+
+    bp::opstream os(pipe);
+    bp::ipstream is(pipe);
+
+    int i = 42, j = 0, k = 0;
+
+    os << i << std::endl;
+    os << std::endl;
+    is >> j;
+
+    BOOST_CHECK_EQUAL(i, j);
+
+    bp::opstream os2 = std::move(os);
+    bp::ipstream is2 = std::move(is);
+    os2 << i << std::endl;
+    os2 << std::endl;
+    is2 >> k;
+
+    BOOST_CHECK_EQUAL(i, k);
+}
+
+BOOST_AUTO_TEST_CASE(stream_move_assignment, *boost::unit_test::timeout(2))
+{
+
+    bp::pipe pipe;
+
+    bp::pstream os(pipe);
+    bp::ipstream is(pipe);
+
+    int i = 42, j = 0, k = 0;
+
+    os << i << std::endl;
+    os << std::endl;
+    is >> j;
+
+    BOOST_CHECK_EQUAL(i, j);
+
+    bp::pstream os2;
+    os2 = std::move(os);
+    bp::ipstream is2;
+    is2 = std::move(is);
+    os2 << i << std::endl;
+    os2 << std::endl;
+    is2 >> k;
+
+    BOOST_CHECK_EQUAL(i, k);
+}
+
+BOOST_AUTO_TEST_CASE(ostream_move_assignment, *boost::unit_test::timeout(2))
+{
+
+    bp::pipe pipe;
+
+    bp::opstream os(pipe);
+    bp::ipstream is(pipe);
+
+    int i = 42, j = 0, k = 0;
+
+    os << i << std::endl;
+    os << std::endl;
+    is >> j;
+
+    BOOST_CHECK_EQUAL(i, j);
+
+    bp::opstream os2;
+    os2 = std::move(os);
+    bp::ipstream is2;
+    is2 = std::move(is);
+    os2 << i << std::endl;
+    os2 << std::endl;
+    is2 >> k;
+
+    BOOST_CHECK_EQUAL(i, k);
+}
+
 BOOST_AUTO_TEST_CASE(stream_line, *boost::unit_test::timeout(2))
 {
 
@@ -268,4 +372,4 @@ BOOST_AUTO_TEST_CASE(stream_close_scope, *boost::unit_test::timeout(5))
 }
 
 
-BOOST_AUTO_TEST_SUITE_END();
\ No newline at end of file
+BOOST_AUTO_TEST_SUITE_END();