Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65589 - sandbox/opaque/libs/opaque/test
From: vicente.botet_at_[hidden]
Date: 2010-09-25 10:45:06


Author: viboes
Date: 2010-09-25 10:45:04 EDT (Sat, 25 Sep 2010)
New Revision: 65589
URL: http://svn.boost.org/trac/boost/changeset/65589

Log:
Opaque: Add more test
Text files modified:
   sandbox/opaque/libs/opaque/test/Jamfile.v2 | 10 +++++++++-
   sandbox/opaque/libs/opaque/test/multi_level_conversion.cpp | 17 ++---------------
   sandbox/opaque/libs/opaque/test/private_opaque_test.cpp | 28 ++++++++++++++++++++++++++++
   3 files changed, 39 insertions(+), 16 deletions(-)

Modified: sandbox/opaque/libs/opaque/test/Jamfile.v2
==============================================================================
--- sandbox/opaque/libs/opaque/test/Jamfile.v2 (original)
+++ sandbox/opaque/libs/opaque/test/Jamfile.v2 2010-09-25 10:45:04 EDT (Sat, 25 Sep 2010)
@@ -43,11 +43,19 @@
    test-suite "opaque"
         :
         [ run test.cpp ]
+ ;
+
+ test-suite "public"
+ :
         [ run public_opaque_test.cpp ]
- [ run private_opaque_test.cpp ]
         [ run multi_level_conversion.cpp ]
         ;
 
+ test-suite "private"
+ :
+ [ run private_opaque_test.cpp ]
+ ;
+
    test-suite "compile_fail"
         :
         [ compile-fail add_siblings_fail.cpp ]

Modified: sandbox/opaque/libs/opaque/test/multi_level_conversion.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/multi_level_conversion.cpp (original)
+++ sandbox/opaque/libs/opaque/test/multi_level_conversion.cpp 2010-09-25 10:45:04 EDT (Sat, 25 Sep 2010)
@@ -79,7 +79,7 @@
     (potential_energy::substituables)
 );
 
-void public_multiple_levels_fail() {
+void public_multiple_levels() {
     {
     double d=1;
     mass1_leng2_per_time2 x(d);
@@ -91,26 +91,13 @@
     x = p; // 2 levels
     d = p; // 3 levels
     }
-#if 1
- {
- int d=1;
- mass1_leng2_per_time2 x(d);
- energy e(d);
- potential_energy p(d);
-
- x = e;
- e = p;
- x = p; // 2 levels
- d = p; // 3 levels
- }
-#endif
 }
 
 
 test_suite* init_unit_test_suite(int, char*[])
 {
   test_suite* test = BOOST_TEST_SUITE("public_multiple_levels");
- test->add(BOOST_TEST_CASE(&public_multiple_levels_fail));
+ test->add(BOOST_TEST_CASE(&public_multiple_levels));
 
   return test;
 }

Modified: sandbox/opaque/libs/opaque/test/private_opaque_test.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/private_opaque_test.cpp (original)
+++ sandbox/opaque/libs/opaque/test/private_opaque_test.cpp 2010-09-25 10:45:04 EDT (Sat, 25 Sep 2010)
@@ -111,6 +111,30 @@
 
 }
 
+void unariy_plus_test() {
+ private_unsigned a(1);
+ BOOST_CHECK(+a==a);
+}
+
+void unariy_minus_test() {
+ private_unsigned a(1);
+ BOOST_CHECK(-a==private_unsigned(-1));
+}
+
+void pre_increment_test() {
+ private_unsigned a(1);
+ private_unsigned b(2);
+ BOOST_CHECK(++a==b);
+}
+
+void post_increment_test() {
+ private_unsigned a(1);
+ private_unsigned b(1);
+ BOOST_CHECK(a++==b);
+ BOOST_CHECK(a==private_unsigned(2));
+}
+
+
 test_suite* init_unit_test_suite(int, char*[])
 {
   test_suite* test = BOOST_TEST_SUITE("private");
@@ -124,6 +148,10 @@
   test->add(BOOST_TEST_CASE(&private_ge_test));
   test->add(BOOST_TEST_CASE(&private_add_test));
   test->add(BOOST_TEST_CASE(&private_substract_test));
+ test->add(BOOST_TEST_CASE(&unariy_plus_test));
+ test->add(BOOST_TEST_CASE(&unariy_minus_test));
+ test->add(BOOST_TEST_CASE(&pre_increment_test));
+ test->add(BOOST_TEST_CASE(&post_increment_test));
 
   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