Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54394 - sandbox/async/libs/async/test
From: vicente.botet_at_[hidden]
Date: 2009-06-27 03:12:46


Author: viboes
Date: 2009-06-27 03:12:45 EDT (Sat, 27 Jun 2009)
New Revision: 54394
URL: http://svn.boost.org/trac/boost/changeset/54394

Log:
Boost.Async V0.2: Adding tests for unique_joiner to shared_joiner conversion
Text files modified:
   sandbox/async/libs/async/test/test_ae.hpp | 4 ++--
   sandbox/async/libs/async/test/test_threader.cpp | 39 ++++++++++++++++++++++++++++-----------
   2 files changed, 30 insertions(+), 13 deletions(-)

Modified: sandbox/async/libs/async/test/test_ae.hpp
==============================================================================
--- sandbox/async/libs/async/test/test_ae.hpp (original)
+++ sandbox/async/libs/async/test/test_ae.hpp 2009-06-27 03:12:45 EDT (Sat, 27 Jun 2009)
@@ -90,7 +90,6 @@
 }
 
 namespace aetst {
-#if 0
 template <typename AE>
 void do_test_member_lazy_fork(AE& ae) {
     test_value=0;
@@ -109,8 +108,9 @@
     BOOST_CHECK_EQUAL(act.has_value(), true);
     BOOST_CHECK_EQUAL(act.has_exception(), false);
     #endif
+ std::cout << "<<do_test_member_lazy_fork" << std::endl;
 }
-#endif
+
 template <typename AE>
 void do_test_member_fork(AE& ae) {
     test_value=0;

Modified: sandbox/async/libs/async/test/test_threader.cpp
==============================================================================
--- sandbox/async/libs/async/test/test_threader.cpp (original)
+++ sandbox/async/libs/async/test/test_threader.cpp 2009-06-27 03:12:45 EDT (Sat, 27 Jun 2009)
@@ -41,11 +41,11 @@
     aetst::do_test_member_fork(ae);
 }
 
-#if 0
 void do_test_member_lazy_fork() {
     basync::shared_threader ae;
     aetst::do_test_member_lazy_fork(ae);
 }
+#if 0
 #endif
 
 void do_test_member_fork_move_unique() {
@@ -238,7 +238,7 @@
     BOOST_CHECK_EQUAL(i, 3);
 }
 
-void do_test_joiner()
+void do_test_shared_joiner_cons()
 {
     typedef basync::unique_threader AE;
     typedef basync::unique_joiner<int> UACT;
@@ -246,19 +246,34 @@
     AE ae;
     test_value=0;
     UACT uact(ae.fork(simple_thread));
-#if 0
     SACT sact(uact);
-#else
+ int res_value = basync::get(sact);
+ BOOST_CHECK_EQUAL(test_value, 999);
+ BOOST_CHECK_EQUAL(res_value, 999);
+ BOOST_CHECK_EQUAL(basync::is_ready(sact), true);
+ BOOST_CHECK_EQUAL(basync::has_value(sact), true);
+ BOOST_CHECK_EQUAL(basync::has_exception(sact), false);
+ std::cout << "<<do_test_shared_joiner_cons" << std::endl;
+
+}
+
+void do_test_shared_joiner_assig()
+{
+ typedef basync::unique_threader AE;
+ typedef basync::unique_joiner<int> UACT;
+ typedef basync::shared_joiner<int> SACT;
+ AE ae;
+ test_value=0;
+ UACT uact(ae.fork(simple_thread));
     SACT sact;
     sact=uact;
-#endif
     int res_value = basync::get(sact);
     BOOST_CHECK_EQUAL(test_value, 999);
     BOOST_CHECK_EQUAL(res_value, 999);
     BOOST_CHECK_EQUAL(basync::is_ready(sact), true);
     BOOST_CHECK_EQUAL(basync::has_value(sact), true);
     BOOST_CHECK_EQUAL(basync::has_exception(sact), false);
- std::cout << "<<do_test_joiner" << std::endl;
+ std::cout << "<<do_test_shared_joiner_assig" << std::endl;
 
 }
 
@@ -267,7 +282,6 @@
     test_suite* test = BOOST_TEST_SUITE("shared_threader");
 
 #if 0
-
     test->add(BOOST_TEST_CASE(&do_test_member_fork));
     test->add(BOOST_TEST_CASE(&do_test_member_fork_bind));
     test->add(BOOST_TEST_CASE(&do_test_fork));
@@ -301,13 +315,16 @@
     test->add(BOOST_TEST_CASE(&do_test_fork_after_get));
 
 #if 0
- test->add(BOOST_TEST_CASE(&do_test_member_lazy_fork));
     test->add(BOOST_TEST_CASE(&do_test_other));
- test_suite* test = BOOST_TEST_SUITE("unique_threader");
+#endif
+#endif
+ test->add(BOOST_TEST_CASE(&do_test_member_lazy_fork));
+ //test_suite* test2 = BOOST_TEST_SUITE("unique_threader");
 
+#if 0
     test->add(BOOST_TEST_CASE(&do_test_member_fork_move_unique));
 #endif
-#endif
- test->add(BOOST_TEST_CASE(&do_test_joiner));
+ test->add(BOOST_TEST_CASE(&do_test_shared_joiner_cons));
+ test->add(BOOST_TEST_CASE(&do_test_shared_joiner_assig));
   return test;
 }


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