|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68857 - in sandbox/opaque/libs/opaque: example test test/new_class
From: vicente.botet_at_[hidden]
Date: 2011-02-13 17:38:43
Author: viboes
Date: 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
New Revision: 68857
URL: http://svn.boost.org/trac/boost/changeset/68857
Log:
Opaque: Move to lightweight_test avoiding kinking with Boost.Test
Text files modified:
sandbox/opaque/libs/opaque/example/ex1.cpp | 12 +-
sandbox/opaque/libs/opaque/example/ex2.cpp | 34 ++++----
sandbox/opaque/libs/opaque/example/ex3.cpp | 9 -
sandbox/opaque/libs/opaque/example/ex4.cpp | 9 -
sandbox/opaque/libs/opaque/test/Jamfile.v2 | 3
sandbox/opaque/libs/opaque/test/multi_level_conversion.cpp | 10 +-
sandbox/opaque/libs/opaque/test/new_class/hiding_less_than_fail.cpp | 2
sandbox/opaque/libs/opaque/test/new_class/hiding_plus_fail.cpp | 2
sandbox/opaque/libs/opaque/test/new_class/plus_fail.cpp | 2
sandbox/opaque/libs/opaque/test/new_class/regular_pass.cpp | 34 ++++----
sandbox/opaque/libs/opaque/test/new_class/using_divide_pass.cpp | 38 ++++-----
sandbox/opaque/libs/opaque/test/new_class/using_equal_pass.cpp | 40 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_greater_than_equal_pass.cpp | 42 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_greater_than_pass.cpp | 42 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_less_than_equal_pass.cpp | 42 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_less_than_pass.cpp | 42 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_minus_assign_pass.cpp | 38 ++++-----
sandbox/opaque/libs/opaque/test/new_class/using_multiply_assign_pass.cpp | 38 ++++-----
sandbox/opaque/libs/opaque/test/new_class/using_multiply_pass.cpp | 38 ++++-----
sandbox/opaque/libs/opaque/test/new_class/using_not_equal_pass.cpp | 40 +++++-----
sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp | 39 ++++-----
sandbox/opaque/libs/opaque/test/new_class/using_plus_pass.cpp | 38 ++++-----
sandbox/opaque/libs/opaque/test/new_class_test.cpp | 111 +++++++++++++----------------
sandbox/opaque/libs/opaque/test/new_type_test.cpp | 114 +++++++++++++-----------------
sandbox/opaque/libs/opaque/test/private_opaque_test.cpp | 116 +++++++++++++++----------------
sandbox/opaque/libs/opaque/test/public_opaque_test.cpp | 147 +++++++++++++++++++--------------------
26 files changed, 503 insertions(+), 579 deletions(-)
Modified: sandbox/opaque/libs/opaque/example/ex1.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/example/ex1.cpp (original)
+++ sandbox/opaque/libs/opaque/example/ex1.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,11 +10,10 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
using namespace boost::opaque;
-using namespace boost::unit_test;
#if 0
typedef int Int;
@@ -40,16 +39,15 @@
void t() {
- BOOST_CHECK(gt(Int(1),Int(0)));
+ BOOST_TEST(gt(Int(1),Int(0)));
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("ex1");
- test->add(BOOST_TEST_CASE(&t));
+ t();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/example/ex2.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/example/ex2.cpp (original)
+++ sandbox/opaque/libs/opaque/example/ex2.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,11 +10,10 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
using namespace boost::opaque;
-using namespace boost::unit_test;
BOOST_OPAQUE_PRIVATE_TYPEDEF(unsigned,game_score);
@@ -33,42 +32,41 @@
void accumulate_test() {
game_score gs1(1), gs2(2), res;
res= accumulate(gs1,gs2);
- BOOST_CHECK(gs1<gs2);
- BOOST_CHECK(gs1<=gs2);
- BOOST_CHECK(gs2>=gs1);
- BOOST_CHECK(res==game_score(3));
- BOOST_CHECK(game_score(3)==res);
+ BOOST_TEST(gs1<gs2);
+ BOOST_TEST(gs1<=gs2);
+ BOOST_TEST(gs2>=gs1);
+ BOOST_TEST(res==game_score(3));
+ BOOST_TEST(game_score(3)==res);
game_score res2;
res2=res+res;
- BOOST_CHECK(res+res==game_score(6));
+ BOOST_TEST(res+res==game_score(6));
}
void next_id_test() {
serial_number sn(1), res;
res= next_id(sn);
- BOOST_CHECK(res==serial_number(2));
- BOOST_CHECK(serial_number(2)==res);
+ BOOST_TEST(res==serial_number(2));
+ BOOST_TEST(serial_number(2)==res);
- BOOST_CHECK(res+res==serial_number(4));
+ BOOST_TEST(res+res==serial_number(4));
- BOOST_CHECK(sn<res);
+ BOOST_TEST(sn<res);
}
//~ void mix_test_fail() {
//~ game_score sn(1), res;
//~ res= next_id(sn);
- //~ BOOST_CHECK(serial_number(3)==game_score(3));
+ //~ BOOST_TEST(serial_number(3)==game_score(3));
//~ }
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("ex2");
- test->add(BOOST_TEST_CASE(&accumulate_test));
- test->add(BOOST_TEST_CASE(&next_id_test));
+ accumulate_test();
+ next_id_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/example/ex3.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/example/ex3.cpp (original)
+++ sandbox/opaque/libs/opaque/example/ex3.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,11 +10,9 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
using namespace boost;
using namespace boost::opaque;
-using namespace boost::unit_test;
// Listing 7
#if 1
@@ -43,13 +41,12 @@
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("ex3");
- test->add(BOOST_TEST_CASE(&public_multiple_levels_test));
+ public_multiple_levels_test();
- return test;
+ return 0;
}
Modified: sandbox/opaque/libs/opaque/example/ex4.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/example/ex4.cpp (original)
+++ sandbox/opaque/libs/opaque/example/ex4.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -9,11 +9,9 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
using namespace boost;
using namespace boost::opaque;
-using namespace boost::unit_test;
// Listing 1
// Cartesian 3D coordinate types
@@ -37,12 +35,11 @@
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* tests = BOOST_TEST_SUITE("ex4");
- tests->add(BOOST_TEST_CASE(&test));
+ test();
- return tests;
+ return 0;
}
Modified: sandbox/opaque/libs/opaque/test/Jamfile.v2
==============================================================================
--- sandbox/opaque/libs/opaque/test/Jamfile.v2 (original)
+++ sandbox/opaque/libs/opaque/test/Jamfile.v2 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -1,6 +1,6 @@
# Boost Chrono Library test Jamfile
-# Copyright Vicente Botet 2010
+# Copyright Vicente Botet 2010-2011
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
@@ -18,7 +18,6 @@
project
: requirements
- <library>/boost/test//boost_unit_test_framework/<link>static
# uncomment the line above if you build outside the Boost release
#<include>$(BOOST_ROOT)
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 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -13,10 +13,9 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/contains.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
// Listing 7
BOOST_OPAQUE_PUBLIC_TYPEDEF(double,mass1_leng2_per_time2);
@@ -98,11 +97,10 @@
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("public_multiple_levels");
- test->add(BOOST_TEST_CASE(&public_multiple_levels));
+ public_multiple_levels();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/hiding_less_than_fail.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/hiding_less_than_fail.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/hiding_less_than_fail.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,8 +11,6 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
-
using namespace boost;
typedef int UT;
Modified: sandbox/opaque/libs/opaque/test/new_class/hiding_plus_fail.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/hiding_plus_fail.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/hiding_plus_fail.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,8 +11,6 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
-
using namespace boost;
typedef int UT;
Modified: sandbox/opaque/libs/opaque/test/new_class/plus_fail.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/plus_fail.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/plus_fail.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,8 +10,6 @@
#include <boost/opaque/new_class.hpp>
-#include <boost/test/unit_test.hpp>
-
using namespace boost;
typedef int UT;
Modified: sandbox/opaque/libs/opaque/test/new_class/regular_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/regular_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/regular_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,10 +10,9 @@
#include <boost/opaque/new_class.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -39,7 +38,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
void default_constructor_test() {
@@ -48,43 +47,42 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque::opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.regular_pass");
- test->add(BOOST_TEST_CASE(&size_test));
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ size_test();
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_divide_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_divide_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_divide_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void divide_test() {
NT a2(2), b3(3), c6(6);
a2 = c6 / b3;
- BOOST_CHECK(a2.underlying()=2);
+ BOOST_TEST(a2.underlying()=2);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_devide_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(÷_test));
+ divide_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_equal_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_equal_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_equal_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void equal_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(b2==c2);
- BOOST_CHECK((b2==a1)==false);
+ BOOST_TEST(b2==c2);
+ BOOST_TEST((b2==a1)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.equal_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&equal_test));
+ equal_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_greater_than_equal_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_greater_than_equal_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_greater_than_equal_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,53 +56,52 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void greater_than_equal_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(b2>=a1);
- BOOST_CHECK((a1>=b2)==false);
- BOOST_CHECK(b2>=c2);
+ BOOST_TEST(b2>=a1);
+ BOOST_TEST((a1>=b2)==false);
+ BOOST_TEST(b2>=c2);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.greater_than_equal_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&greater_than_equal_test));
+ greater_than_equal_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_greater_than_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_greater_than_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_greater_than_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,53 +56,52 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void greater_than_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(b2>a1);
- BOOST_CHECK((a1>b2)==false);
- BOOST_CHECK((b2>c2)==false);
+ BOOST_TEST(b2>a1);
+ BOOST_TEST((a1>b2)==false);
+ BOOST_TEST((b2>c2)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.greater_than_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test);
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&greater_than_test));
+ greater_than_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_less_than_equal_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_less_than_equal_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_less_than_equal_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,53 +56,52 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void less_than_equal_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(a1<=b2);
- BOOST_CHECK((b2<=a1)==false);
- BOOST_CHECK(b2<=c2);
+ BOOST_TEST(a1<=b2);
+ BOOST_TEST((b2<=a1)==false);
+ BOOST_TEST(b2<=c2);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.less_than_equal_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&less_than_equal_test));
+ less_than_equal_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_less_than_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_less_than_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_less_than_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,53 +56,52 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void less_than_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(a1<b2);
- BOOST_CHECK((b2<a1)==false);
- BOOST_CHECK((b2<c2)==false);
+ BOOST_TEST(a1<b2);
+ BOOST_TEST((b2<a1)==false);
+ BOOST_TEST((b2<c2)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.less_than_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&less_than_test));
+ less_than_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_minus_assign_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_minus_assign_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_minus_assign_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,53 +56,52 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void minus_assign_test() {
NT a1(1), b2(2), c2(2);
a1-=b2;
- BOOST_CHECK(a1.underlying()=3);
+ BOOST_TEST(a1.underlying()=3);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_minus_assign_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&minus_assign_test));
+ minus_assign_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_multiply_assign_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_multiply_assign_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_multiply_assign_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void multiply_assign_test() {
NT a1(2), b2(3);
a1 *= b2;
- BOOST_CHECK(a1.underlying()=6);
+ BOOST_TEST(a1.underlying()=6);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_multiply_assign_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&multiply_assign_test));
+ multiply_assign_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_multiply_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_multiply_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_multiply_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void multiply_test() {
NT a2(2), b3(3), c6(2);
c6 = a2 * b3;
- BOOST_CHECK(c6.underlying()=6);
+ BOOST_TEST(c6.underlying()=6);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_multiply_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&multiply_test));
+ multiply_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_not_equal_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_not_equal_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_not_equal_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void not_equal_test() {
NT a1(1), b2(2), c2(2);
- BOOST_CHECK(a1!=c2);
- BOOST_CHECK((b2!=c2)==false);
+ BOOST_TEST(a1!=c2);
+ BOOST_TEST((b2!=c2)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.not_equal_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(¬_equal_test));
+ not_equal_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,50 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void plus_assign_test() {
NT a1(1), b2(2), c2(2);
a1+=b2;
- BOOST_CHECK(a1.underlying()=3);
+ BOOST_TEST(a1.underlying()=3);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_plus_assign_pass");
-
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&plus_assign_test));
+ plus_assign_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class/using_plus_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_plus_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_plus_pass.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -11,10 +11,9 @@
#include <boost/opaque/new_class.hpp>
#include <boost/opaque/meta_mixin/operators.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
typedef int UT;
typedef short UT2;
@@ -48,7 +47,7 @@
void size_test() {
- BOOST_CHECK(sizeof(NT)==sizeof(UT));
+ BOOST_TEST(sizeof(NT)==sizeof(UT));
}
#if 0
void default_constructor_test() {
@@ -57,52 +56,51 @@
void copy_from_ut_test() {
UT ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_from_ut2_test() {
UT2 ut(1);
NT a(ut);
- BOOST_CHECK(a.underlying()==ut);
+ BOOST_TEST(a.underlying()==ut);
}
void copy_constructor_test() {
NT a(1);
NT b(a);
- BOOST_CHECK(a.underlying()==b.underlying());
+ BOOST_TEST(a.underlying()==b.underlying());
}
void assign_test() {
NT a1, a2(2);
a1=a2; // OK
- BOOST_CHECK(a1.underlying()==a2.underlying());
+ BOOST_TEST(a1.underlying()==a2.underlying());
}
void opaque_static_cast_test() {
NT a(1);
UT2 i;
i=opaque_static_cast<UT2>(a);
- BOOST_CHECK(i==a.underlying());
+ BOOST_TEST(i==a.underlying());
}
#endif
void plus_test() {
NT a2, b3(3), c6(6);
a2 = c6 + b3;
- BOOST_CHECK(a2.underlying()=9);
+ BOOST_TEST(a2.underlying()=9);
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new_class.using_plus_pass");
- test->add(BOOST_TEST_CASE(&size_test));
+ size_test();
#if 0
- test->add(BOOST_TEST_CASE(&default_constructor_test));
- test->add(BOOST_TEST_CASE(©_from_ut_test));
- test->add(BOOST_TEST_CASE(©_from_ut2_test));
- test->add(BOOST_TEST_CASE(©_constructor_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&opaque_static_cast_test));
+ default_constructor_test();
+ copy_from_ut_test();
+ copy_from_ut2_test();
+ copy_constructor_test();
+ assign_test();
+ opaque_static_cast_test();
#endif
- test->add(BOOST_TEST_CASE(&plus_test));
+ plus_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_class_test.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class_test.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class_test.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,10 +10,9 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
struct private_unsigned :
@@ -57,8 +56,8 @@
void size_test() {
- BOOST_CHECK(sizeof(private_unsigned)==sizeof(unsigned));
- BOOST_CHECK(sizeof(private_unsigned2)==sizeof(unsigned));
+ BOOST_TEST(sizeof(private_unsigned)==sizeof(unsigned));
+ BOOST_TEST(sizeof(private_unsigned2)==sizeof(unsigned));
}
void private_assign_test() {
@@ -78,105 +77,93 @@
void private_eq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b==c);
- BOOST_CHECK((a==b)==false);
+ BOOST_TEST(b==c);
+ BOOST_TEST((a==b)==false);
}
void private_neq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a!=b);
- BOOST_CHECK((b!=c)==false);
+ BOOST_TEST(a!=b);
+ BOOST_TEST((b!=c)==false);
}
//~ void private_lt_test() {
//~ private_unsigned a(1), b(2), c(2);
- //~ BOOST_CHECK(a<b);
- //~ BOOST_CHECK((b<a)==false);
- //~ BOOST_CHECK((b<c)==false);
+ //~ BOOST_TEST(a<b);
+ //~ BOOST_TEST((b<a)==false);
+ //~ BOOST_TEST((b<c)==false);
//~ }
#if 0
void private_gt_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>a);
- BOOST_CHECK((a>b)==false);
- BOOST_CHECK((b>c)==false);
+ BOOST_TEST(b>a);
+ BOOST_TEST((a>b)==false);
+ BOOST_TEST((b>c)==false);
}
void private_le_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<=b);
- BOOST_CHECK((b<=a)==false);
- BOOST_CHECK(b<=c);
+ BOOST_TEST(a<=b);
+ BOOST_TEST((b<=a)==false);
+ BOOST_TEST(b<=c);
}
void private_ge_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>=a);
- BOOST_CHECK((a>=b)==false);
- BOOST_CHECK(b>=c);
+ BOOST_TEST(b>=a);
+ BOOST_TEST((a>=b)==false);
+ BOOST_TEST(b>=c);
}
void private_add_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(a+b==c);
- BOOST_CHECK(c==a+b);
- BOOST_CHECK((a+b==d)==false);
- BOOST_CHECK((d==a+b)==false);
+ BOOST_TEST(a+b==c);
+ BOOST_TEST(c==a+b);
+ BOOST_TEST((a+b==d)==false);
+ BOOST_TEST((d==a+b)==false);
private_unsigned2 x;
//~ a=a+x; // error
//~ unsigned u=3,v=0;
- //~ BOOST_CHECK(a+b==3u);
- //~ BOOST_CHECK(u==a+b);
- //~ BOOST_CHECK(a+b==u);
- //~ BOOST_CHECK((a+b==v)==false);
- //~ BOOST_CHECK((v==a+b)==false);
+ //~ BOOST_TEST(a+b==3u);
+ //~ BOOST_TEST(u==a+b);
+ //~ BOOST_TEST(a+b==u);
+ //~ BOOST_TEST((a+b==v)==false);
+ //~ BOOST_TEST((v==a+b)==false);
}
void private_substract_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(c-b==a);
- BOOST_CHECK(a==c-b);
- BOOST_CHECK((c-b==d)==false);
- BOOST_CHECK((d==c-b)==false);
+ BOOST_TEST(c-b==a);
+ BOOST_TEST(a==c-b);
+ BOOST_TEST((c-b==d)==false);
+ BOOST_TEST((d==c-b)==false);
//~ unsigned u=1,v=0;
- //~ BOOST_CHECK(c-b==1u);
- //~ BOOST_CHECK(u==c-b);
- //~ BOOST_CHECK(c-b==u);
- //~ BOOST_CHECK((c-b==v)==false);
- //~ BOOST_CHECK((v==c-b)==false);
+ //~ BOOST_TEST(c-b==1u);
+ //~ BOOST_TEST(u==c-b);
+ //~ BOOST_TEST(c-b==u);
+ //~ BOOST_TEST((c-b==v)==false);
+ //~ BOOST_TEST((v==c-b)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("private");
-
-
- test->add(BOOST_TEST_CASE(&size_test));
- test->add(BOOST_TEST_CASE(&private_assign_test));
- test->add(BOOST_TEST_CASE(&private_eq_test));
- test->add(BOOST_TEST_CASE(&private_lt_test));
- test->add(BOOST_TEST_CASE(&private_gt_test));
- test->add(BOOST_TEST_CASE(&private_le_test));
- test->add(BOOST_TEST_CASE(&private_ge_test));
- test->add(BOOST_TEST_CASE(&private_add_test));
- test->add(BOOST_TEST_CASE(&private_substract_test));
-
- return test;
-}
#endif
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new");
-
- test->add(BOOST_TEST_CASE(&private_assign_test));
- test->add(BOOST_TEST_CASE(&private_eq_test));
- test->add(BOOST_TEST_CASE(&private_neq_test));
+ //~ size_test();
+ private_assign_test();
+ private_eq_test();
+ private_neq_test();
+ //~ private_lt_test();
+ //~ private_gt_test();
+ //~ private_le_test();
+ //~ private_ge_test();
+ //~ private_add_test();
+ //~ private_substract_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/new_type_test.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_type_test.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_type_test.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,10 +10,9 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
struct private_unsigned_tag;
@@ -24,8 +23,8 @@
void size_test() {
- BOOST_CHECK(sizeof(private_unsigned)==sizeof(unsigned));
- BOOST_CHECK(sizeof(private_unsigned2)==sizeof(unsigned));
+ BOOST_TEST(sizeof(private_unsigned)==sizeof(unsigned));
+ BOOST_TEST(sizeof(private_unsigned2)==sizeof(unsigned));
}
void private_assign_test() {
@@ -45,105 +44,94 @@
void private_eq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b==c);
- BOOST_CHECK((a==b)==false);
+ BOOST_TEST(b==c);
+ BOOST_TEST((a==b)==false);
}
void private_neq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a!=b);
- BOOST_CHECK((b!=c)==false);
+ BOOST_TEST(a!=b);
+ BOOST_TEST((b!=c)==false);
}
//~ void private_lt_test() {
//~ private_unsigned a(1), b(2), c(2);
- //~ BOOST_CHECK(a<b);
- //~ BOOST_CHECK((b<a)==false);
- //~ BOOST_CHECK((b<c)==false);
+ //~ BOOST_TEST(a<b);
+ //~ BOOST_TEST((b<a)==false);
+ //~ BOOST_TEST((b<c)==false);
//~ }
#if 0
void private_gt_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>a);
- BOOST_CHECK((a>b)==false);
- BOOST_CHECK((b>c)==false);
+ BOOST_TEST(b>a);
+ BOOST_TEST((a>b)==false);
+ BOOST_TEST((b>c)==false);
}
void private_le_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<=b);
- BOOST_CHECK((b<=a)==false);
- BOOST_CHECK(b<=c);
+ BOOST_TEST(a<=b);
+ BOOST_TEST((b<=a)==false);
+ BOOST_TEST(b<=c);
}
void private_ge_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>=a);
- BOOST_CHECK((a>=b)==false);
- BOOST_CHECK(b>=c);
+ BOOST_TEST(b>=a);
+ BOOST_TEST((a>=b)==false);
+ BOOST_TEST(b>=c);
}
void private_add_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(a+b==c);
- BOOST_CHECK(c==a+b);
- BOOST_CHECK((a+b==d)==false);
- BOOST_CHECK((d==a+b)==false);
+ BOOST_TEST(a+b==c);
+ BOOST_TEST(c==a+b);
+ BOOST_TEST((a+b==d)==false);
+ BOOST_TEST((d==a+b)==false);
private_unsigned2 x;
//~ a=a+x; // error
//~ unsigned u=3,v=0;
- //~ BOOST_CHECK(a+b==3u);
- //~ BOOST_CHECK(u==a+b);
- //~ BOOST_CHECK(a+b==u);
- //~ BOOST_CHECK((a+b==v)==false);
- //~ BOOST_CHECK((v==a+b)==false);
+ //~ BOOST_TEST(a+b==3u);
+ //~ BOOST_TEST(u==a+b);
+ //~ BOOST_TEST(a+b==u);
+ //~ BOOST_TEST((a+b==v)==false);
+ //~ BOOST_TEST((v==a+b)==false);
}
void private_substract_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(c-b==a);
- BOOST_CHECK(a==c-b);
- BOOST_CHECK((c-b==d)==false);
- BOOST_CHECK((d==c-b)==false);
+ BOOST_TEST(c-b==a);
+ BOOST_TEST(a==c-b);
+ BOOST_TEST((c-b==d)==false);
+ BOOST_TEST((d==c-b)==false);
//~ unsigned u=1,v=0;
- //~ BOOST_CHECK(c-b==1u);
- //~ BOOST_CHECK(u==c-b);
- //~ BOOST_CHECK(c-b==u);
- //~ BOOST_CHECK((c-b==v)==false);
- //~ BOOST_CHECK((v==c-b)==false);
+ //~ BOOST_TEST(c-b==1u);
+ //~ BOOST_TEST(u==c-b);
+ //~ BOOST_TEST(c-b==u);
+ //~ BOOST_TEST((c-b==v)==false);
+ //~ BOOST_TEST((v==c-b)==false);
}
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("private");
-
-
- test->add(BOOST_TEST_CASE(&size_test));
- test->add(BOOST_TEST_CASE(&private_assign_test));
- test->add(BOOST_TEST_CASE(&private_eq_test));
- test->add(BOOST_TEST_CASE(&private_lt_test));
- test->add(BOOST_TEST_CASE(&private_gt_test));
- test->add(BOOST_TEST_CASE(&private_le_test));
- test->add(BOOST_TEST_CASE(&private_ge_test));
- test->add(BOOST_TEST_CASE(&private_add_test));
- test->add(BOOST_TEST_CASE(&private_substract_test));
-
- return test;
-}
-
#endif
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("new");
-
- test->add(BOOST_TEST_CASE(&private_assign_test));
- test->add(BOOST_TEST_CASE(&private_eq_test));
- test->add(BOOST_TEST_CASE(&private_neq_test));
- return test;
+ private_assign_test();
+ private_eq_test();
+ private_neq_test();
+
+ //~ size_test();
+ //~ private_lt_test();
+ //~ private_gt_test();
+ //~ private_le_test();
+ //~ private_ge_test();
+ //~ private_add_test();
+ //~ private_substract_test();
+
+ return boost::report_errors();
}
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 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -10,10 +10,9 @@
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
@@ -22,7 +21,7 @@
void size_test() {
- BOOST_CHECK(sizeof(private_unsigned)==sizeof(unsigned));
+ BOOST_TEST(sizeof(private_unsigned)==sizeof(unsigned));
}
void assign_test() {
@@ -44,120 +43,119 @@
void eq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b==c);
- BOOST_CHECK((a==b)==false);
+ BOOST_TEST(b==c);
+ BOOST_TEST((a==b)==false);
}
void neq_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a!=b);
- BOOST_CHECK((b!=c)==false);
+ BOOST_TEST(a!=b);
+ BOOST_TEST((b!=c)==false);
}
void lt_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<b);
- BOOST_CHECK((b<a)==false);
- BOOST_CHECK((b<c)==false);
+ BOOST_TEST(a<b);
+ BOOST_TEST((b<a)==false);
+ BOOST_TEST((b<c)==false);
}
void gt_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>a);
- BOOST_CHECK((a>b)==false);
- BOOST_CHECK((b>c)==false);
+ BOOST_TEST(b>a);
+ BOOST_TEST((a>b)==false);
+ BOOST_TEST((b>c)==false);
}
void le_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<=b);
- BOOST_CHECK((b<=a)==false);
- BOOST_CHECK(b<=c);
+ BOOST_TEST(a<=b);
+ BOOST_TEST((b<=a)==false);
+ BOOST_TEST(b<=c);
}
void ge_test() {
private_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>=a);
- BOOST_CHECK((a>=b)==false);
- BOOST_CHECK(b>=c);
+ BOOST_TEST(b>=a);
+ BOOST_TEST((a>=b)==false);
+ BOOST_TEST(b>=c);
}
void add_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(a+b==c);
- BOOST_CHECK(c==a+b);
- BOOST_CHECK((a+b==d)==false);
- BOOST_CHECK((d==a+b)==false);
+ BOOST_TEST(a+b==c);
+ BOOST_TEST(c==a+b);
+ BOOST_TEST((a+b==d)==false);
+ BOOST_TEST((d==a+b)==false);
}
void substract_test() {
private_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(c-b==a);
- BOOST_CHECK(a==c-b);
- BOOST_CHECK((c-b==d)==false);
- BOOST_CHECK((d==c-b)==false);
+ BOOST_TEST(c-b==a);
+ BOOST_TEST(a==c-b);
+ BOOST_TEST((c-b==d)==false);
+ BOOST_TEST((d==c-b)==false);
}
void multiply_test() {
private_unsigned a(1), b(2), c(3),d(6);
- BOOST_CHECK(b*c==d);
- BOOST_CHECK(b==a*b);
- BOOST_CHECK((b*c==a)==false);
- BOOST_CHECK((d==a*b)==false);
+ BOOST_TEST(b*c==d);
+ BOOST_TEST(b==a*b);
+ BOOST_TEST((b*c==a)==false);
+ BOOST_TEST((d==a*b)==false);
}
void divide_test() {
private_unsigned a(1), b(2), c(3),d(6);
- BOOST_CHECK(d/c==b);
- BOOST_CHECK(b==d/c);
- BOOST_CHECK((d/c==a)==false);
- BOOST_CHECK((a==d/c)==false);
+ BOOST_TEST(d/c==b);
+ BOOST_TEST(b==d/c);
+ BOOST_TEST((d/c==a)==false);
+ BOOST_TEST((a==d/c)==false);
}
void unariy_plus_test() {
private_unsigned a(1);
- BOOST_CHECK(+a==a);
+ BOOST_TEST(+a==a);
}
void unariy_minus_test() {
private_unsigned a(1);
- BOOST_CHECK(-a==private_unsigned(-1));
+ BOOST_TEST(-a==private_unsigned(-1));
}
void pre_increment_test() {
private_unsigned a(1);
private_unsigned b(2);
- BOOST_CHECK(++a==b);
+ BOOST_TEST(++a==b);
}
void post_increment_test() {
private_unsigned a(1);
private_unsigned b(1);
- BOOST_CHECK(a++==b);
- BOOST_CHECK(a==private_unsigned(2));
+ BOOST_TEST(a++==b);
+ BOOST_TEST(a==private_unsigned(2));
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("private");
- test->add(BOOST_TEST_CASE(&size_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&eq_test));
- test->add(BOOST_TEST_CASE(&neq_test));
- test->add(BOOST_TEST_CASE(<_test));
- test->add(BOOST_TEST_CASE(>_test));
- test->add(BOOST_TEST_CASE(&le_test));
- test->add(BOOST_TEST_CASE(&ge_test));
- test->add(BOOST_TEST_CASE(&add_test));
- test->add(BOOST_TEST_CASE(&substract_test));
- test->add(BOOST_TEST_CASE(&multiply_test));
- test->add(BOOST_TEST_CASE(÷_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));
+ size_test();
+ assign_test();
+ eq_test();
+ neq_test();
+ lt_test();
+ gt_test();
+ le_test();
+ ge_test();
+ add_test();
+ substract_test();
+ multiply_test();
+ divide_test();
+ unariy_plus_test();
+ unariy_minus_test();
+ pre_increment_test();
+ post_increment_test();
- return test;
+ return boost::report_errors();
}
Modified: sandbox/opaque/libs/opaque/test/public_opaque_test.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/public_opaque_test.cpp (original)
+++ sandbox/opaque/libs/opaque/test/public_opaque_test.cpp 2011-02-13 17:38:40 EST (Sun, 13 Feb 2011)
@@ -9,17 +9,16 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/opaque/opaque.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/detail/lightweight_test.hpp>
using namespace boost;
-using namespace boost::unit_test;
BOOST_OPAQUE_PUBLIC_TYPEDEF(unsigned,public_unsigned);
BOOST_OPAQUE_PUBLIC_TYPEDEF(unsigned,public_unsigned2);
void size_test() {
- BOOST_CHECK(sizeof(public_unsigned)==sizeof(unsigned));
+ BOOST_TEST(sizeof(public_unsigned)==sizeof(unsigned));
}
void assign_test() {
@@ -39,146 +38,144 @@
void eq_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b==c);
- BOOST_CHECK((a==b)==false);
+ BOOST_TEST(b==c);
+ BOOST_TEST((a==b)==false);
unsigned u=1,v=2;
- BOOST_CHECK(a==1u);
- BOOST_CHECK(u==a);
- BOOST_CHECK(a==u);
- BOOST_CHECK((a==v)==false);
- BOOST_CHECK((v==a)==false);
+ BOOST_TEST(a==1u);
+ BOOST_TEST(u==a);
+ BOOST_TEST(a==u);
+ BOOST_TEST((a==v)==false);
+ BOOST_TEST((v==a)==false);
}
void neq_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a!=b);
- BOOST_CHECK((b!=c)==false);
+ BOOST_TEST(a!=b);
+ BOOST_TEST((b!=c)==false);
}
void lt_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<b);
- BOOST_CHECK((b<a)==false);
- BOOST_CHECK((b<c)==false);
+ BOOST_TEST(a<b);
+ BOOST_TEST((b<a)==false);
+ BOOST_TEST((b<c)==false);
}
void gt_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>a);
- BOOST_CHECK((a>b)==false);
- BOOST_CHECK((b>c)==false);
+ BOOST_TEST(b>a);
+ BOOST_TEST((a>b)==false);
+ BOOST_TEST((b>c)==false);
}
void le_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(a<=b);
- BOOST_CHECK((b<=a)==false);
- BOOST_CHECK(b<=c);
+ BOOST_TEST(a<=b);
+ BOOST_TEST((b<=a)==false);
+ BOOST_TEST(b<=c);
}
void ge_test() {
public_unsigned a(1), b(2), c(2);
- BOOST_CHECK(b>=a);
- BOOST_CHECK((a>=b)==false);
- BOOST_CHECK(b>=c);
+ BOOST_TEST(b>=a);
+ BOOST_TEST((a>=b)==false);
+ BOOST_TEST(b>=c);
}
void add_test() {
public_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(a+b==c);
- BOOST_CHECK(c==a+b);
- BOOST_CHECK((a+b==d)==false);
- BOOST_CHECK((d==a+b)==false);
+ BOOST_TEST(a+b==c);
+ BOOST_TEST(c==a+b);
+ BOOST_TEST((a+b==d)==false);
+ BOOST_TEST((d==a+b)==false);
//~ public_unsigned2 x;
//~ a=a+x; // error
unsigned u=3,v=0;
- BOOST_CHECK(a+b==3u);
- BOOST_CHECK(u==a+b);
- BOOST_CHECK(a+b==u);
- BOOST_CHECK((a+b==v)==false);
- BOOST_CHECK((v==a+b)==false);
+ BOOST_TEST(a+b==3u);
+ BOOST_TEST(u==a+b);
+ BOOST_TEST(a+b==u);
+ BOOST_TEST((a+b==v)==false);
+ BOOST_TEST((v==a+b)==false);
}
void substract_test() {
public_unsigned a(1), b(2), c(3),d(4);
- BOOST_CHECK(c-b==a);
- BOOST_CHECK(a==c-b);
- BOOST_CHECK((c-b==d)==false);
- BOOST_CHECK((d==c-b)==false);
+ BOOST_TEST(c-b==a);
+ BOOST_TEST(a==c-b);
+ BOOST_TEST((c-b==d)==false);
+ BOOST_TEST((d==c-b)==false);
unsigned u=1,v=0;
- BOOST_CHECK(c-b==1u);
- BOOST_CHECK(u==c-b);
- BOOST_CHECK(c-b==u);
- BOOST_CHECK((c-b==v)==false);
- BOOST_CHECK((v==c-b)==false);
+ BOOST_TEST(c-b==1u);
+ BOOST_TEST(u==c-b);
+ BOOST_TEST(c-b==u);
+ BOOST_TEST((c-b==v)==false);
+ BOOST_TEST((v==c-b)==false);
}
void multiply_test() {
public_unsigned a(1), b(2), c(3),d(6);
- BOOST_CHECK(b*c==d);
- BOOST_CHECK(b==a*b);
- BOOST_CHECK((b*c==a)==false);
- BOOST_CHECK((d==a*b)==false);
+ BOOST_TEST(b*c==d);
+ BOOST_TEST(b==a*b);
+ BOOST_TEST((b*c==a)==false);
+ BOOST_TEST((d==a*b)==false);
}
void divide_test() {
public_unsigned a(1), b(2), c(3),d(6);
- BOOST_CHECK(d/c==b);
- BOOST_CHECK(b==d/c);
- BOOST_CHECK((d/c==a)==false);
- BOOST_CHECK((a==d/c)==false);
+ BOOST_TEST(d/c==b);
+ BOOST_TEST(b==d/c);
+ BOOST_TEST((d/c==a)==false);
+ BOOST_TEST((a==d/c)==false);
}
void unariy_plus_test() {
public_unsigned a(1);
- BOOST_CHECK(+a==a);
+ BOOST_TEST(+a==a);
}
void unariy_minus_test() {
public_unsigned a(1);
- BOOST_CHECK(-a==public_unsigned(-1));
+ BOOST_TEST(-a==public_unsigned(-1));
}
void pre_increment_test() {
public_unsigned a(1);
public_unsigned b(2);
- BOOST_CHECK(++a==b);
+ BOOST_TEST(++a==b);
}
void post_increment_test() {
public_unsigned a(1);
public_unsigned b(1);
- BOOST_CHECK(a++==b);
- BOOST_CHECK(a==public_unsigned(2));
+ BOOST_TEST(a++==b);
+ BOOST_TEST(a==public_unsigned(2));
}
-test_suite* init_unit_test_suite(int, char*[])
+int main()
{
- test_suite* test = BOOST_TEST_SUITE("public");
+ size_test();
+ assign_test();
+ eq_test();
+ neq_test();
+ lt_test();
+ gt_test();
+ le_test();
+ ge_test();
+ add_test();
+ substract_test();
+ multiply_test();
+ divide_test();
+ unariy_plus_test();
+ unariy_minus_test();
+ pre_increment_test();
+ post_increment_test();
- test->add(BOOST_TEST_CASE(&size_test));
- test->add(BOOST_TEST_CASE(&assign_test));
- test->add(BOOST_TEST_CASE(&eq_test));
- test->add(BOOST_TEST_CASE(&neq_test));
- test->add(BOOST_TEST_CASE(<_test));
- test->add(BOOST_TEST_CASE(>_test));
- test->add(BOOST_TEST_CASE(&le_test));
- test->add(BOOST_TEST_CASE(&ge_test));
- test->add(BOOST_TEST_CASE(&add_test));
- test->add(BOOST_TEST_CASE(&substract_test));
- test->add(BOOST_TEST_CASE(&multiply_test));
- test->add(BOOST_TEST_CASE(÷_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;
+ return boost::report_errors();
}
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