diff --git a/test/compose_property_map_test.cpp b/test/compose_property_map_test.cpp index 7ee7166..279aea1 100644 --- a/test/compose_property_map_test.cpp +++ b/test/compose_property_map_test.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include void concept_checks() { @@ -63,11 +63,11 @@ void pointer_pmap_check() boost::compose_property_map cpm(v, idx); for (int i = 0; i < 5; ++i) { - BOOST_CHECK(get(cpm, i) == static_cast(i)); + BOOST_TEST(get(cpm, i) == static_cast(i)); ++cpm[i]; - BOOST_CHECK(cpm[i] == static_cast(i + 1)); + BOOST_TEST(cpm[i] == static_cast(i + 1)); put(cpm, i, 42.); - BOOST_CHECK(cpm[i] == 42.); + BOOST_TEST(cpm[i] == 42.); } } @@ -87,15 +87,15 @@ void readable_pmap_checks() cpm(modulo_add_one(5), modulo_add_one(5)); for (int i = 0; i < 10; ++i) - BOOST_CHECK(get(cpm, i) == (i + 2) % 5); + BOOST_TEST(get(cpm, i) == (i + 2) % 5); } int -test_main(int, char**) +main() { concept_checks(); pointer_pmap_check(); readable_pmap_checks(); - return 0; + return boost::report_errors(); } diff --git a/test/dynamic_properties_test.cpp b/test/dynamic_properties_test.cpp index 841e04c..d5a8658 100644 --- a/test/dynamic_properties_test.cpp +++ b/test/dynamic_properties_test.cpp @@ -17,7 +17,7 @@ # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #endif -#include +#include #include #include #include @@ -30,7 +30,7 @@ // WARNING: This code leaks memory. For testing purposes only! // WARNING: This code uses library internals. For testing purposes only! boost::shared_ptr -string2string_gen(const std::string& name, +string2string_gen(const std::string&, const boost::any&, const boost::any&) { typedef std::map map_t; @@ -51,7 +51,7 @@ string2string_gen(const std::string& name, } -int test_main(int,char**) { +int main() { // build property maps using associative_property_map @@ -81,30 +81,30 @@ int test_main(int,char**) { using boost::type; // Get tests { - BOOST_CHECK(get("int",properties,std::string("one")) == "1"); + BOOST_TEST(get("int",properties,std::string("one")) == "1"); #ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS - BOOST_CHECK(boost::get("int",properties,std::string("one")) == 1); + BOOST_TEST(boost::get("int",properties,std::string("one")) == 1); #endif - BOOST_CHECK(get("int",properties,std::string("one"), type()) == 1); - BOOST_CHECK(get("double",properties,5.3) == "five point three"); + BOOST_TEST(get("int",properties,std::string("one"), type()) == 1); + BOOST_TEST(get("double",properties,5.3) == "five point three"); } // Put tests { put("int",properties,std::string("five"),6); - BOOST_CHECK(get("int",properties,std::string("five")) == "6"); + BOOST_TEST(get("int",properties,std::string("five")) == "6"); put("int",properties,std::string("five"),std::string("5")); #ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS - BOOST_CHECK(get("int",properties,std::string("five")) == 5); + BOOST_TEST(get("int",properties,std::string("five")) == 5); #endif - BOOST_CHECK(get("int",properties,std::string("five"),type()) == 5); + BOOST_TEST(get("int",properties,std::string("five"),type()) == 5); put("double",properties,3.14,std::string("3.14159")); - BOOST_CHECK(get("double",properties,3.14) == "3.14159"); + BOOST_TEST(get("double",properties,3.14) == "3.14159"); put("double",properties,3.14,std::string("pi")); #ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS - BOOST_CHECK(get("double",properties,3.14) == "pi"); + BOOST_TEST(get("double",properties,3.14) == "pi"); #endif - BOOST_CHECK(get("double",properties,3.14,type()) == "pi"); + BOOST_TEST(get("double",properties,3.14,type()) == "pi"); } // Nonexistent property @@ -124,15 +124,15 @@ int test_main(int,char**) { { boost::dynamic_properties props(&string2string_gen); put("nada",props,std::string("3.14"),std::string("pi")); - BOOST_CHECK(get("nada",props,std::string("3.14")) == "pi"); + BOOST_TEST(get("nada",props,std::string("3.14")) == "pi"); } // Use the ignore_other_properties generator { boost::dynamic_properties props(&boost::ignore_other_properties); bool value = put("nada",props,std::string("3.14"),std::string("pi")); - BOOST_CHECK(value == false); + BOOST_TEST(value == false); } - return boost::exit_success; + return boost::report_errors(); } diff --git a/test/function_property_map_test.cpp b/test/function_property_map_test.cpp index 8f072ec..d66fa10 100644 --- a/test/function_property_map_test.cpp +++ b/test/function_property_map_test.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include template @@ -30,7 +30,7 @@ struct return_fixed_ref { int& operator()(const T&) const {return *ptr;} }; -int test_main(int, char**) { +int main() { using namespace boost; BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept, int>, int>)); BOOST_CONCEPT_ASSERT((ReadablePropertyMapConcept, int, double>, int>)); @@ -45,22 +45,22 @@ int test_main(int, char**) { BOOST_STATIC_ASSERT((boost::is_same, int> >::category, boost::readable_property_map_tag>::value)); BOOST_STATIC_ASSERT((boost::is_same, int> >::category, boost::lvalue_property_map_tag>::value)); - BOOST_CHECK(get(function_property_map, int>(), 3) == 4); - BOOST_CHECK(get(function_property_map, int>(add1()), 4) == 5); - BOOST_CHECK(get(make_function_property_map(add1()), 5) == 6); - BOOST_CHECK(get(function_property_map, int>(), 3) == 4); - BOOST_CHECK(get(function_property_map, int>(add1_val()), 4) == 5); - BOOST_CHECK(get(make_function_property_map(add1_val()), 5) == 6); + BOOST_TEST(get(function_property_map, int>(), 3) == 4); + BOOST_TEST(get(function_property_map, int>(add1()), 4) == 5); + BOOST_TEST(get(make_function_property_map(add1()), 5) == 6); + BOOST_TEST(get(function_property_map, int>(), 3) == 4); + BOOST_TEST(get(function_property_map, int>(add1_val()), 4) == 5); + BOOST_TEST(get(make_function_property_map(add1_val()), 5) == 6); int val; const function_property_map, int> pm = return_fixed_ref((&val)); put(pm, 1, 6); - BOOST_CHECK(get(pm, 2) == 6); - BOOST_CHECK((get(pm, 3) = 7) == 7); - BOOST_CHECK(get(pm, 4) == 7); + BOOST_TEST(get(pm, 2) == 6); + BOOST_TEST((get(pm, 3) = 7) == 7); + BOOST_TEST(get(pm, 4) == 7); const function_property_map, int> pm2 = pm; // Check shallow copying - BOOST_CHECK(get(pm2, 5) == 7); + BOOST_TEST(get(pm2, 5) == 7); put(pm2, 3, 1); - BOOST_CHECK(get(pm, 1) == 1); + BOOST_TEST(get(pm, 1) == 1); - return 0; + return boost::report_errors(); } diff --git a/test/transform_value_property_map_test.cpp b/test/transform_value_property_map_test.cpp index d9032f4..d0fcfcc 100644 --- a/test/transform_value_property_map_test.cpp +++ b/test/transform_value_property_map_test.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include // Ensure this is not default constructible @@ -34,7 +34,7 @@ struct return_fixed_ref { int& operator()(const T&) const {return *ptr;} }; -int test_main(int, char**) { +int main() { using namespace boost; typedef function_property_map PM; PM orig_pm(times2(0)); @@ -51,22 +51,22 @@ int test_main(int, char**) { BOOST_STATIC_ASSERT((boost::is_same, PM> >::category, boost::readable_property_map_tag>::value)); BOOST_STATIC_ASSERT((boost::is_same, PM> >::category, boost::lvalue_property_map_tag>::value)); - BOOST_CHECK(get(transform_value_property_map, PM>(add1(), orig_pm), 3) == 7); - BOOST_CHECK(get(transform_value_property_map, PM>(add1(), orig_pm), 4) == 9); - BOOST_CHECK(get(make_transform_value_property_map(add1(), orig_pm), 5) == 11); - BOOST_CHECK(get(transform_value_property_map, PM>(add1_val(), orig_pm), 3) == 7); - BOOST_CHECK(get(transform_value_property_map, PM>(add1_val(), orig_pm), 4) == 9); - BOOST_CHECK(get(make_transform_value_property_map(add1_val(), orig_pm), 5) == 11); + BOOST_TEST(get(transform_value_property_map, PM>(add1(), orig_pm), 3) == 7); + BOOST_TEST(get(transform_value_property_map, PM>(add1(), orig_pm), 4) == 9); + BOOST_TEST(get(make_transform_value_property_map(add1(), orig_pm), 5) == 11); + BOOST_TEST(get(transform_value_property_map, PM>(add1_val(), orig_pm), 3) == 7); + BOOST_TEST(get(transform_value_property_map, PM>(add1_val(), orig_pm), 4) == 9); + BOOST_TEST(get(make_transform_value_property_map(add1_val(), orig_pm), 5) == 11); int val; const transform_value_property_map, PM> pm(return_fixed_ref((&val)), orig_pm); put(pm, 1, 6); - BOOST_CHECK(get(pm, 2) == 6); - BOOST_CHECK((get(pm, 3) = 7) == 7); - BOOST_CHECK(get(pm, 4) == 7); + BOOST_TEST(get(pm, 2) == 6); + BOOST_TEST((get(pm, 3) = 7) == 7); + BOOST_TEST(get(pm, 4) == 7); const transform_value_property_map, PM> pm2 = pm; // Check shallow copying - BOOST_CHECK(get(pm2, 5) == 7); + BOOST_TEST(get(pm2, 5) == 7); put(pm2, 3, 1); - BOOST_CHECK(get(pm, 1) == 1); + BOOST_TEST(get(pm, 1) == 1); - return 0; + return boost::report_errors(); }