|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72386 - sandbox/property/libs/property/test
From: eldiener_at_[hidden]
Date: 2011-06-04 09:20:32
Author: eldiener
Date: 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
New Revision: 72386
URL: http://svn.boost.org/trac/boost/changeset/72386
Log:
Updated tests and using full test framework.
Text files modified:
sandbox/property/libs/property/test/Jamfile.v2 | 42 ++-
sandbox/property/libs/property/test/test_auto_predicate.cpp | 15 +
sandbox/property/libs/property/test/test_auto_reference.cpp | 15 +
sandbox/property/libs/property/test/test_auto_value.cpp | 368 +++++++++++++++++++++++++++++++++++++++
sandbox/property/libs/property/test/test_auto_value.hpp | 4
sandbox/property/libs/property/test/test_callable_reference.cpp | 15 +
sandbox/property/libs/property/test/test_callable_value.cpp | 15 +
sandbox/property/libs/property/test/test_data_predicate.cpp | 15 +
sandbox/property/libs/property/test/test_data_reference.cpp | 15 +
sandbox/property/libs/property/test/test_data_value.cpp | 15 +
sandbox/property/libs/property/test/test_function_reference.cpp | 15 +
sandbox/property/libs/property/test/test_function_value.cpp | 15 +
sandbox/property/libs/property/test/test_functor_reference.cpp | 16 +
sandbox/property/libs/property/test/test_functor_value.cpp | 15 +
sandbox/property/libs/property/test/test_member_data_predicate.cpp | 15 +
sandbox/property/libs/property/test/test_member_data_reference.cpp | 15 +
sandbox/property/libs/property/test/test_member_data_value.cpp | 15 +
sandbox/property/libs/property/test/test_member_function_reference.cpp | 16 +
sandbox/property/libs/property/test/test_member_function_value.cpp | 15 +
19 files changed, 568 insertions(+), 88 deletions(-)
Modified: sandbox/property/libs/property/test/Jamfile.v2
==============================================================================
--- sandbox/property/libs/property/test/Jamfile.v2 (original)
+++ sandbox/property/libs/property/test/Jamfile.v2 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -6,6 +6,7 @@
import testing ;
+use-project /boost : $(BOOST_ROOT) ;
project property_tests : requirements <warnings>on
<toolset>gcc:<warnings>all
<toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import"
@@ -16,23 +17,30 @@
<toolset>msvc-10.0:<define>"_SCL_SECURE_NO_WARNINGS"
;
+rule property-test ( name )
+{
+ return [
+ run $(name).cpp /boost/test//boost_unit_test_framework/<link>static ]
+ ;
+}
+
test-suite property
:
- [ run test_auto_predicate.cpp ]
- [ run test_auto_reference.cpp ]
- [ run test_auto_value.cpp ]
- [ run test_callable_reference.cpp ]
- [ run test_callable_value.cpp ]
- [ run test_data_predicate.cpp ]
- [ run test_data_reference.cpp ]
- [ run test_data_value.cpp ]
- [ run test_function_reference.cpp ]
- [ run test_function_value.cpp ]
- [ run test_functor_reference.cpp ]
- [ run test_functor_value.cpp ]
- [ run test_member_data_predicate.cpp ]
- [ run test_member_data_reference.cpp ]
- [ run test_member_data_value.cpp ]
- [ run test_member_function_reference.cpp ]
- [ run test_member_function_value.cpp ]
+ [ property-test test_auto_predicate ]
+ [ property-test test_auto_reference ]
+ [ property-test test_auto_value ]
+ [ property-test test_callable_reference ]
+ [ property-test test_callable_value ]
+ [ property-test test_data_predicate ]
+ [ property-test test_data_reference ]
+ [ property-test test_data_value ]
+ [ property-test test_function_reference ]
+ [ property-test test_function_value ]
+ [ property-test test_functor_reference ]
+ [ property-test test_functor_value ]
+ [ property-test test_member_data_predicate ]
+ [ property-test test_member_data_reference ]
+ [ property-test test_member_data_value ]
+ [ property-test test_member_function_reference ]
+ [ property-test test_member_function_value ]
;
Modified: sandbox/property/libs/property/test/test_auto_predicate.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_predicate.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_predicate.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/lambda/lambda.hpp>
#include "test_auto_predicate.hpp"
@@ -38,7 +38,7 @@
{
}
-int main()
+void test_auto_predicate_function()
{
p_auto_predicate_class tcl;
@@ -48,8 +48,15 @@
TestDouble(tcl);
TestEnum(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Auto Predicate Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_auto_predicate_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
\ No newline at end of file
Modified: sandbox/property/libs/property/test/test_auto_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,16 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_auto_reference.hpp>
-int main()
+void test_auto_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Auto Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_auto_reference_function ) );
+
+ return test;
+}
Modified: sandbox/property/libs/property/test/test_auto_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_value.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,5 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
#include "test_auto_value.hpp"
#include "test_global_data.hpp"
@@ -13,47 +14,393 @@
p_auto_value_class::p_auto_value_class() :
p_double_ntf(15),
p_bool(true),
- p_enum_const(e_test_second)
+ p_pointer(&p_iarray[3]),
+ p_enum_const(e_test_second),
+ p_pod(test_pod('#',997,23.6744,false))
{
+ p_iarray[0] = 56;
+ p_iarray[1] = 13562;
+ p_iarray[2] = 679;
+ p_iarray[3] = 34;
+ p_iarray[4] = 2491;
+ p_iarray[5] = 856;
+ p_iarray[6] = 37;
+ p_iarray[7] = 932;
+ p_iarray[8] = 8468;
+ p_iarray[9] = 834;
+ p_iarray[10] = 789;
+ p_iarray[11] = 3452;
+ p_iarray[12] = 741;
+ p_iarray[13] = 3492;
+ p_iarray[14] = 48;
}
prop_auto<char> p_auto_value_class::p_st_char('T');
prop_auto<int,default_policy_tag,read_tag> p_auto_value_class::p_st_int_const(34);
prop_auto<double> p_auto_value_class::p_st_double;
prop_auto<bool,notification_boost_function> p_auto_value_class::p_st_bool_ntf;
-prop_auto<int *> p_auto_value_class::p_st_pointer;
-prop_auto<test_enum,notification_boost_function> p_auto_value_class::p_st_enum_ntf;
+prop_auto<int *> p_auto_value_class::p_st_pointer(&p_st_iarray[5]);
+prop_auto<test_enum,notification_boost_function> p_auto_value_class::p_st_enum_ntf(e_test_third);
prop_auto<test_pod const> p_auto_value_class::p_st_pod_const(test_pod('y',45,32.6,true));
+int p_auto_value_class::p_st_iarray[9] = {757,9,5347,369,1174,53,3456,443,6};
+int p_gl_iarray[] = {7,98,347,289,14,5763,230,7783,22675,59,12};
+
+bool TestCharacterNotificationWorked(false);
+
+void TestCharacterNotification(const i_property_write<char> &,boost::optional<char>,char cnew)
+ {
+ BOOST_CHECK_EQUAL(cnew,'i');
+ TestCharacterNotificationWorked = true;
+ }
+
+bool TestBoolNotificationWorked(false);
+
+void TestBoolNotification(const i_property_write<bool> &,boost::optional<bool>,bool cnew)
+ {
+ BOOST_CHECK(cnew);
+ TestBoolNotificationWorked = true;
+ }
+
+bool TestPointerNotificationWorked(false);
+
+void TestPointerNotification(const i_property_write<int *> &,boost::optional<int *>,int *)
+ {
+ TestPointerNotificationWorked = true;
+ }
+
+bool TestEnumNotificationWorked(false);
+
+void TestEnumNotification(const i_property_write<test_enum> &,boost::optional<test_enum>,test_enum cnew)
+ {
+ BOOST_CHECK_EQUAL(cnew,e_test_third);
+ TestEnumNotificationWorked = true;
+ }
+
+bool TestPodNotificationWorked(false);
+
+void TestPodNotification(const i_property_write<test_pod> &,boost::optional<test_pod>,test_pod cnew)
+ {
+ BOOST_CHECK_EQUAL(cnew.an_int,547);
+ TestPodNotificationWorked = true;
+ }
+
+bool TestIntegerNotificationWorked(false);
+
+void TestIntegerNotification(const i_property_write<int> &,boost::optional<int>,int cnew)
+ {
+ BOOST_CHECK_EQUAL(cnew,23611);
+ TestIntegerNotificationWorked = true;
+ }
+
+bool TestDoubleNotificationWorked(false);
+
+void TestDoubleNotification(const i_property_write<double> &,boost::optional<double>,double cnew)
+ {
+ BOOST_CHECK_CLOSE(cnew,566655.298,.0001);
+ TestDoubleNotificationWorked = true;
+ }
+
+#include <string>
+
void TestCharacter(p_auto_value_class & tcl)
{
+
+ /*
+
+ Although a character is considered an integral type,
+ doing integral arithmetic on it is really not normal.
+ So we show functionality based on characters being part
+ of C++ strings.
+
+ */
+
+ prop_auto<char> p_loc_char('J');
+ std::string s1("Terry");
+
+ s1[0] = p_loc_char;
+
+ BOOST_CHECK_EQUAL(s1,"Jerry");
+
+ p_gl_char = 'k';
+
+ s1[3] = p_gl_char;
+
+ BOOST_CHECK_EQUAL(s1,"Jerky");
+
+ p_loc_char = s1[1];
+ tcl.p_char_ntf = 's';
+ p_auto_value_class::p_st_char = 'o';
+
+ s1[1] = p_auto_value_class::p_st_char;
+ s1[2] = p_gl_char;
+ s1[3] = p_loc_char;
+ s1[4] = tcl.p_char_ntf;
+
+ BOOST_CHECK_EQUAL(s1,"Jokes");
+
+ std::string s2(1,tcl.p_char_ntf);
+
+ BOOST_CHECK_EQUAL(s2,"s");
+
+ p_gl_char = s1[2];
+
+ BOOST_CHECK_EQUAL(p_gl_char,'k');
+
+ s2 += p_auto_value_class::p_st_char;
+
+ BOOST_CHECK_EQUAL(s2,"so");
+
+ tcl.p_char_ntf.fun = &TestCharacterNotification;
+ tcl.p_char_ntf = 'i';
+
+ BOOST_CHECK(TestCharacterNotificationWorked);
}
void TestInt(p_auto_value_class & tcl)
{
+
+ /*
+
+ Integers can be tested with the full range of integer operations.
+
+ */
+
+ prop_auto<int,notification_boost_function> p_loc_int(563);
+
+ BOOST_CHECK_EQUAL(p_gl_int_const,34662);
+ BOOST_CHECK_EQUAL(p_auto_value_class::p_st_int_const,34);
+ tcl.p_int = 44;
+ tcl.p_int += 12;
+ BOOST_CHECK_EQUAL(tcl.p_int,56);
+ tcl.p_int -= 16;
+ BOOST_CHECK_EQUAL(tcl.p_int,40);
+ ++tcl.p_int;
+ BOOST_CHECK_EQUAL(tcl.p_int,41);
+ ++tcl.p_int;
+ ++tcl.p_int;
+ --tcl.p_int;
+ BOOST_CHECK_EQUAL(tcl.p_int,42);
+ tcl.p_int /= 3;
+ BOOST_CHECK_EQUAL(tcl.p_int,14);
+ tcl.p_int *= 5;
+ BOOST_CHECK_EQUAL(tcl.p_int,70);
+
+ int il1(p_loc_int++);
+ BOOST_CHECK_EQUAL(il1,563);
+ BOOST_CHECK_EQUAL(p_loc_int,564);
+ p_loc_int >>= 2;
+ BOOST_CHECK_EQUAL(p_loc_int,141);
+ p_loc_int -= 81;
+ p_loc_int <<= 3;
+ BOOST_CHECK_EQUAL(p_loc_int,480);
+ il1 = --p_loc_int;
+ BOOST_CHECK_EQUAL(il1,479);
+ p_loc_int -= 6;
+ BOOST_CHECK_EQUAL(p_loc_int,473);
+ p_loc_int |= 0x0da;
+ BOOST_CHECK_EQUAL(p_loc_int,475);
+ p_loc_int &= 0x076;
+ BOOST_CHECK_EQUAL(p_loc_int,82);
+ p_loc_int.fun = &TestIntegerNotification;
+ p_loc_int = 23611;
+ BOOST_CHECK(TestIntegerNotificationWorked);
+
+ tcl.p_int ^= 57;
+
}
void TestDouble(p_auto_value_class & tcl)
{
+
+ /*
+
+ We can do the full range of arithmetic functionality with a double value
+
+ */
+
+ prop_auto<double> p_loc_double(45.37);
+ ++p_loc_double;
+ BOOST_CHECK_CLOSE(p_loc_double.get(),46.37,.1);
+ BOOST_CHECK_CLOSE(tcl.p_double_ntf.get(),15.0,.1);
+ p_gl_double = 2352.346;
+ p_auto_value_class::p_st_double = 452.98;
+ BOOST_CHECK_CLOSE(p_gl_double.get(),2352.346,.01);
+ BOOST_CHECK_CLOSE(p_auto_value_class::p_st_double.get(),452.98,.1);
+ --p_auto_value_class::p_st_double;
+ BOOST_CHECK_CLOSE(p_auto_value_class::p_st_double.get(),451.98,.1);
+ double d1(p_gl_double--);
+ BOOST_CHECK_CLOSE(d1,2352.346,.01);
+ BOOST_CHECK_CLOSE(p_gl_double.get(),2351.346,.01);
+ d1 = tcl.p_double_ntf++;
+ BOOST_CHECK_CLOSE(d1,15.0,.1);
+ BOOST_CHECK_CLOSE(tcl.p_double_ntf.get(),16.0,.1);
+ p_gl_double /= 36.7;
+ BOOST_CHECK_CLOSE(p_gl_double.get(),64.069373,.1);
+ p_loc_double *= 756.839; // 35094.624
+ BOOST_CHECK_CLOSE(p_loc_double.get(),35094.624,.001);
+ p_auto_value_class::p_st_double -= 2497.481;
+ BOOST_CHECK_CLOSE(p_auto_value_class::p_st_double.get(),-2045.501,.01);
+ tcl.p_double_ntf.fun = &TestDoubleNotification;
+ tcl.p_double_ntf += 566639.298;
+ BOOST_CHECK(TestDoubleNotificationWorked);
+
}
void TestBool(p_auto_value_class & tcl)
{
+
+ /*
+
+ Bools are integral values,
+ either 0 (false) or 1 (true) in integer arithmetic,
+ but are only tested here for true or false
+
+ */
+
+ prop_auto<bool> p_loc_bool(true);
+
+ bool b1(tcl.p_bool);
+
+ BOOST_CHECK(b1);
+
+ bool b2(p_loc_bool);
+
+ BOOST_CHECK(b2);
+
+ b1 = p_gl_bool;
+
+ BOOST_CHECK_EQUAL(b1,false);
+
+ p_auto_value_class::p_st_bool_ntf.fun = &TestBoolNotification;
+ p_auto_value_class::p_st_bool_ntf = b2;
+
+ BOOST_CHECK(TestBoolNotificationWorked);
+
+ bool b3(p_auto_value_class::p_st_bool_ntf);
+
+ BOOST_CHECK(b3);
+
}
void TestPointer(p_auto_value_class & tcl)
{
+
+ /*
+
+ Pointers can be assigned, incremented, decremented,
+ and take part in simple arithmetic.
+
+ */
+
+ prop_auto<int *,notification_boost_function> p_loc_pointer(&p_gl_iarray[7]);
+ prop_auto<int *> p_loc_pointer2(&p_gl_iarray[4]);
+
+ BOOST_CHECK_EQUAL(*p_loc_pointer,7783);
+
+ p_loc_pointer = &p_gl_iarray[6];
+
+ BOOST_CHECK_EQUAL(*p_loc_pointer,230);
+ BOOST_CHECK_EQUAL(p_loc_pointer - p_loc_pointer2,2);
+
+ p_loc_pointer += 4;
+ BOOST_CHECK_EQUAL(*p_loc_pointer,12);
+ p_loc_pointer.fun = &TestPointerNotification;
+ p_loc_pointer -= 2;
+ BOOST_CHECK_EQUAL(*p_loc_pointer,22675);
+ BOOST_CHECK(TestPointerNotificationWorked);
+
+ gld_int = 489;
+ BOOST_CHECK_EQUAL(*p_gl_pointer_const,489);
+ BOOST_CHECK_EQUAL(*p_auto_value_class::p_st_pointer,53);
+ ++p_auto_value_class::p_st_pointer;
+ BOOST_CHECK_EQUAL(*p_auto_value_class::p_st_pointer,3456);
+ BOOST_CHECK_EQUAL(*tcl.p_pointer,34);
+ tcl.p_pointer -= 2;
+ BOOST_CHECK_EQUAL(*tcl.p_pointer,13562);
+ --tcl.p_pointer;
+ BOOST_CHECK_EQUAL(*tcl.p_pointer,56);
+ tcl.p_pointer += 11;
+ BOOST_CHECK_EQUAL(*(tcl.p_pointer--),3452);
+ BOOST_CHECK_EQUAL(*tcl.p_pointer,789);
+ p_auto_value_class::p_st_pointer -= 4;
+ BOOST_CHECK_EQUAL(*(p_auto_value_class::p_st_pointer++),5347);
+ BOOST_CHECK_EQUAL(*p_auto_value_class::p_st_pointer,369);
+
}
void TestEnum(p_auto_value_class & tcl)
{
+
+ /*
+
+ Enums are individual values. They can participate in
+ arithmetic expressions but here I will just test basic
+ usage.
+
+ */
+
+ prop_auto<test_enum> p_loc_enum(e_test_second);
+
+ BOOST_CHECK_EQUAL(tcl.p_enum_const,e_test_second);
+ BOOST_CHECK_EQUAL(p_loc_enum,e_test_second);
+ p_loc_enum = e_test_third;
+ BOOST_CHECK_EQUAL(p_loc_enum,e_test_third);
+ BOOST_CHECK_EQUAL(p_auto_value_class::p_st_enum_ntf,e_test_third);
+ p_auto_value_class::p_st_enum_ntf = e_test_first;
+ BOOST_CHECK_EQUAL(p_auto_value_class::p_st_enum_ntf,e_test_first);
+ test_enum te1(p_loc_enum);
+ BOOST_CHECK_EQUAL(te1,e_test_third);
+
+ te1 = p_auto_value_class::p_st_enum_ntf;
+ BOOST_CHECK_EQUAL(te1,e_test_first);
+ p_auto_value_class::p_st_enum_ntf.fun = &TestEnumNotification;
+ p_auto_value_class::p_st_enum_ntf = e_test_third;
+ BOOST_CHECK(TestEnumNotificationWorked);
+
}
void TestPod(p_auto_value_class & tcl)
{
+
+ /*
+
+ Our POD class will be tested by changing fields
+ and passing to and from the properties.
+
+ */
+
+ prop_auto<test_pod> p_loc_pod(test_pod('^',981,4.3,false));
+
+ BOOST_CHECK_EQUAL(p_loc_pod.get().an_int,981);
+ BOOST_CHECK_EQUAL(p_loc_pod.get().a_char,'^');
+
+ test_pod p1(p_auto_value_class::p_st_pod_const);
+
+ BOOST_CHECK_EQUAL(p1.a_char,'y');
+ BOOST_CHECK(p1.a_bool);
+ BOOST_CHECK_EQUAL(p_auto_value_class::p_st_pod_const.get().an_int,45);
+ BOOST_CHECK_EQUAL(p_auto_value_class::p_st_pod_const.get().a_double,32.6);
+
+ p1 = p_loc_pod;
+ p1.an_int = 991;
+ p_loc_pod = p1;
+ BOOST_CHECK_EQUAL(p_loc_pod.get().an_int,991);
+
+ BOOST_CHECK_EQUAL(tcl.p_pod.get().an_int,997);
+ BOOST_CHECK_EQUAL(tcl.p_pod.get().a_char,'#');
+
+ tcl.p_pod = test_pod();
+
+ BOOST_CHECK_EQUAL(tcl.p_pod.get().a_double,0);
+
+ p_gl_pod_ntf.fun = &TestPodNotification;
+ p_gl_pod_ntf = test_pod('$',547,33.45,true);
+ BOOST_CHECK(TestPodNotificationWorked);
+
}
-int main()
+void test_auto_value_function()
{
p_auto_value_class tcl;
@@ -66,8 +413,15 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int, char* [] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Auto Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_auto_value_function ) );
+
+ return test;
+}
#include "test_global_data.cpp"
Modified: sandbox/property/libs/property/test/test_auto_value.hpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_value.hpp (original)
+++ sandbox/property/libs/property/test/test_auto_value.hpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -31,6 +31,8 @@
prop_auto<test_enum,default_policy_tag,read_tag> p_enum_const;
prop_auto<test_pod> p_pod;
+ int p_iarray[15];
+
static prop_auto<char> p_st_char;
static prop_auto<int,default_policy_tag,read_tag> p_st_int_const;
static prop_auto<double> p_st_double;
@@ -39,6 +41,8 @@
static prop_auto<test_enum,notification_boost_function> p_st_enum_ntf;
static prop_auto<test_pod const> p_st_pod_const;
+ static int p_st_iarray[9];
+
};
#endif
Modified: sandbox/property/libs/property/test/test_callable_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_callable_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_callable_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,16 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_callable_reference.hpp>
-int main()
+void test_callable_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Callable Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_callable_reference_function ) );
+
+ return test;
+}
Modified: sandbox/property/libs/property/test/test_callable_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_callable_value.cpp (original)
+++ sandbox/property/libs/property/test/test_callable_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/bind.hpp>
#include "test_callable_value.hpp"
#include "test_function_impl.hpp"
@@ -99,7 +99,7 @@
{
}
-int main()
+void test_callable_value_function()
{
p_callable_value_class tcl;
@@ -112,10 +112,17 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Callable Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_callable_value_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
#include "test_function_impl.cpp"
#include "test_functor_impl.cpp"
Modified: sandbox/property/libs/property/test/test_data_predicate.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_data_predicate.cpp (original)
+++ sandbox/property/libs/property/test/test_data_predicate.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/lambda/lambda.hpp>
#include "test_data_predicate.hpp"
@@ -38,7 +38,7 @@
{
}
-int main()
+void test_data_predicate_function()
{
p_data_predicate_class tcl;
@@ -48,9 +48,16 @@
TestDouble(tcl);
TestEnum(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Data Predicate Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_data_predicate_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
#include "test_data_impl.cpp"
Modified: sandbox/property/libs/property/test/test_data_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_data_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_data_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,16 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_data_reference.hpp>
-int main()
+void test_data_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Data Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_data_reference_function ) );
+
+ return test;
+}
Modified: sandbox/property/libs/property/test/test_data_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_data_value.cpp (original)
+++ sandbox/property/libs/property/test/test_data_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include "test_data_value.hpp"
#include "test_global_data.hpp"
@@ -50,7 +50,7 @@
{
}
-int main()
+void test_data_value_function()
{
p_data_value_class tcl;
@@ -63,9 +63,16 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Data Value Function Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_data_value_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
#include "test_data_impl.cpp"
Modified: sandbox/property/libs/property/test/test_function_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_function_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_function_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,16 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_function_reference.hpp>
-int main()
+void test_function_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Function Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_function_reference_function ) );
+
+ return test;
+}
Modified: sandbox/property/libs/property/test/test_function_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_function_value.cpp (original)
+++ sandbox/property/libs/property/test/test_function_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include "test_function_value.hpp"
#include "test_global_data.hpp"
@@ -50,7 +50,7 @@
{
}
-int main()
+void test_function_value_function()
{
p_function_value_class tcl;
@@ -63,9 +63,16 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Function Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_function_value_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
#include "test_function_impl.cpp"
Modified: sandbox/property/libs/property/test/test_functor_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_functor_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_functor_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,17 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_functor_reference.hpp>
-int main()
+void test_functor_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Functior Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_functor_reference_function ) );
+
+ return test;
+}
+
Modified: sandbox/property/libs/property/test/test_functor_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_functor_value.cpp (original)
+++ sandbox/property/libs/property/test/test_functor_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include "test_functor_value.hpp"
#include "test_global_data.hpp"
@@ -62,7 +62,7 @@
{
}
-int main()
+void test_functor_value_function()
{
p_functor_value_class tcl;
@@ -75,8 +75,6 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
p_functor_class_char pf_gl_char;
@@ -95,5 +93,14 @@
p_functor_class_enum p_functor_value_class::pf_st_enum(e_test_third);
p_functor_class_pod p_functor_value_class::pf_st_pod;
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Functor Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_functor_value_function ) );
+
+ return test;
+}
+
#include "test_global_data.cpp"
#include "test_functor_impl.cpp"
Modified: sandbox/property/libs/property/test/test_member_data_predicate.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_member_data_predicate.cpp (original)
+++ sandbox/property/libs/property/test/test_member_data_predicate.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/lambda/lambda.hpp>
#include "test_member_data_predicate.hpp"
@@ -38,7 +38,7 @@
{
}
-int main()
+void test_member_data_predicate_function()
{
p_member_data_predicate_class tcl;
@@ -48,10 +48,17 @@
TestDouble(tcl);
TestEnum(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Member Data Predicate Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_member_data_predicate_function ) );
+
+ return test;
+}
+
p_member_data_class pmd_gl_char;
p_member_data_class pmd_gl_int;
p_member_data_class pmd_gl_double;
Modified: sandbox/property/libs/property/test/test_member_data_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_member_data_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_member_data_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,16 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_member_data_reference.hpp>
-int main()
+void test_member_data_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Member Data Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_member_data_reference_function ) );
+
+ return test;
+}
Modified: sandbox/property/libs/property/test/test_member_data_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_member_data_value.cpp (original)
+++ sandbox/property/libs/property/test/test_member_data_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include "test_member_data_value.hpp"
prop_member_data<char const,p_member_data_class,&p_member_data_class::p_data_char> p_gl_char_const(pmd_gl_char);
@@ -56,7 +56,7 @@
{
}
-int main()
+void test_member_data_value_function()
{
p_member_data_value_class tcl;
@@ -69,10 +69,17 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Member Data Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_member_data_value_function ) );
+
+ return test;
+}
+
p_member_data_class pmd_gl_char;
p_member_data_class pmd_gl_int;
p_member_data_class pmd_gl_double;
Modified: sandbox/property/libs/property/test/test_member_function_reference.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_member_function_reference.cpp (original)
+++ sandbox/property/libs/property/test/test_member_function_reference.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,9 +1,17 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include <boost/property/property_member_function_reference.hpp>
-int main()
+void test_member_function_reference_function()
{
- return boost::report_errors();
-
}
+
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Member Function Reference Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_member_function_reference_function ) );
+
+ return test;
+}
+
Modified: sandbox/property/libs/property/test/test_member_function_value.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_member_function_value.cpp (original)
+++ sandbox/property/libs/property/test/test_member_function_value.cpp 2011-06-04 09:20:30 EDT (Sat, 04 Jun 2011)
@@ -1,4 +1,4 @@
-#include <boost/detail/lightweight_test.hpp>
+#include <boost/test/unit_test.hpp>
#include "test_member_function_value.hpp"
#include "test_global_data.hpp"
@@ -57,7 +57,7 @@
{
}
-int main()
+void test_member_function_value_function()
{
p_member_function_value_class tcl;
@@ -70,10 +70,17 @@
TestEnum(tcl);
TestPod(tcl);
- return boost::report_errors();
-
}
+boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Property Test Member Function Value Suite" );
+
+ test->add( BOOST_TEST_CASE( &test_member_function_value_function ) );
+
+ return test;
+}
+
p_member_function_impl_class pmf_gl_char;
p_member_function_impl_class pmf_gl_int;
p_member_function_impl_class pmf_gl_double;
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