Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64568 - sandbox/SOC/2010/process/libs/process/test
From: boris_at_[hidden]
Date: 2010-08-03 09:58:40


Author: bschaeling
Date: 2010-08-03 09:58:38 EDT (Tue, 03 Aug 2010)
New Revision: 64568
URL: http://svn.boost.org/trac/boost/changeset/64568

Log:
Added another handle test case
Text files modified:
   sandbox/SOC/2010/process/libs/process/test/handle.cpp | 28 +++++++++++++++++++++++++++-
   1 files changed, 27 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2010/process/libs/process/test/handle.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/handle.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/test/handle.cpp 2010-08-03 09:58:38 EDT (Tue, 03 Aug 2010)
@@ -25,7 +25,7 @@
 #define BOOST_TEST_MAIN
 #include "util/boost.hpp"
 
-BOOST_AUTO_TEST_CASE(test_handle)
+BOOST_AUTO_TEST_CASE(test_handle_readwrite)
 {
     bpb::pipe p(bpb::pipe::input_stream);
 
@@ -71,3 +71,29 @@
     BOOST_REQUIRE(!WriteFile(write_end.native(), "test", 4, &written, NULL));
 #endif
 }
+
+BOOST_AUTO_TEST_CASE(test_handle_methods)
+{
+#if defined(BOOST_POSIX_API)
+ bp::handle h(STDOUT_FILENO);
+#elif defined(BOOST_WINDOWS_API)
+ bp::handle h(GetStdHandle(STD_OUTPUT_HANDLE));
+#endif
+ bp::handle h2 = h;
+ BOOST_CHECK(h.valid());
+ BOOST_CHECK(h2.valid());
+#if defined(BOOST_POSIX_API)
+ BOOST_CHECK_EQUAL(h.native(), STDOUT_FILENO);
+#elif defined(BOOST_WINDOWS_API)
+ BOOST_CHECK_EQUAL(h.native(), GetStdHandle(STD_OUTPUT_HANDLE));
+#endif
+ BOOST_CHECK(h.valid());
+ BOOST_CHECK(h2.valid());
+#if defined(BOOST_POSIX_API)
+ BOOST_CHECK_EQUAL(h.release(), STDOUT_FILENO);
+#elif defined(BOOST_WINDOWS_API)
+ BOOST_CHECK_EQUAL(h.release(), GetStdHandle(STD_OUTPUT_HANDLE));
+#endif
+ BOOST_CHECK(!h.valid());
+ BOOST_CHECK(!h2.valid());
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk