|
Boost-Commit : |
From: jmcintyre_at_[hidden]
Date: 2007-12-04 02:10:14
Author: jared
Date: 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
New Revision: 41675
URL: http://svn.boost.org/trac/boost/changeset/41675
Log:
Fix gcc build issue (don't know why VS builds) and improve tests
Text files modified:
sandbox/pinhole/boost/pinhole/property_info.hpp | 2
sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp | 60 ++++++++++++++++++++--------------------
sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp | 10 ++++--
sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp | 10 ++++--
sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp | 8 ++--
sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp | 8 ++--
6 files changed, 51 insertions(+), 47 deletions(-)
Modified: sandbox/pinhole/boost/pinhole/property_info.hpp
==============================================================================
--- sandbox/pinhole/boost/pinhole/property_info.hpp (original)
+++ sandbox/pinhole/boost/pinhole/property_info.hpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -24,7 +24,7 @@
#include <boost/type_traits.hpp>
#include <boost/function.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/algorithm/string/compare.hpp>
+#include <boost/algorithm/string/predicate.hpp>
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
Modified: sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_bool_properties.cpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -31,8 +31,8 @@
#endif
TestGroup() : property_group( "PropertyGroupName", NULL )
{
- m_bool_Func = true;
- m_bool_Var = true;
+ m_bool_Func = false;
+ m_bool_Var = false;
add_property("Bool_Func", "Bool1 description", BOOST_SETTER(&TestGroup::SetBool), BOOST_GETTER(&TestGroup::GetBool), NULL );
add_property("Bool_Var", "Bool2 description", BOOST_SETTER_VAR(m_bool_Var), BOOST_GETTER_VAR(m_bool_Var), NULL );
@@ -52,83 +52,83 @@
BOOST_AUTO_TEST_CASE( TestSetGetBool_Func )
{
TestGroup testGroup;
+
+ testGroup.set( "Bool_Func", true );
+ BOOST_CHECK_EQUAL( true, testGroup.get<bool>( "Bool_Func") );
testGroup.set( "Bool_Func", false );
- BOOST_CHECK( false == testGroup.get<bool>( "Bool_Func") );
+ BOOST_CHECK_EQUAL( false, testGroup.get<bool>( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "true" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "false" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "True" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "False" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Func") );
- testGroup.set( "Bool_Func", false );
testGroup.set_as_string( "Bool_Func", "TrUe" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "FalSe" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Func") );
- testGroup.set( "Bool_Func", false );
testGroup.set_as_string( "Bool_Func", "TRUE" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "FALSE" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Func") );
- testGroup.set( "Bool_Func", false );
testGroup.set_as_string( "Bool_Func", "1" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Func") );
testGroup.set_as_string( "Bool_Func", "0" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Func") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Func") );
}
BOOST_AUTO_TEST_CASE( TestSetGetBool_Var )
{
TestGroup testGroup;
+
+ testGroup.set( "Bool_Func", true );
+ BOOST_CHECK_EQUAL( true, testGroup.get<bool>( "Bool_Func") );
testGroup.set( "Bool_Var", false );
- BOOST_CHECK( false == testGroup.get<bool>( "Bool_Var") );
+ BOOST_CHECK_EQUAL( false, testGroup.get<bool>( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "true" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "false" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "True" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "False" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Var") );
- testGroup.set( "Bool_Var", false );
testGroup.set_as_string( "Bool_Var", "TrUe" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "FalSe" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Var") );
- testGroup.set( "Bool_Var", false );
testGroup.set_as_string( "Bool_Var", "TRUE" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "FALSE" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Var") );
- testGroup.set( "Bool_Var", false );
testGroup.set_as_string( "Bool_Var", "1" );
- BOOST_CHECK( "True" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "True", testGroup.get_as_string( "Bool_Var") );
testGroup.set_as_string( "Bool_Var", "0" );
- BOOST_CHECK( "False" == testGroup.get_as_string( "Bool_Var") );
+ BOOST_CHECK_EQUAL( "False", testGroup.get_as_string( "Bool_Var") );
}
BOOST_AUTO_TEST_CASE( TestBoolPropertyType )
Modified: sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_double_properties.cpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -53,10 +53,11 @@
TestGroup testGroup;
testGroup.set( "Double_Func", 2.2 );
- BOOST_CHECK( 2.2 == testGroup.get<double>( "Double_Func") );
+ BOOST_CHECK_EQUAL( 2.2, testGroup.get<double>( "Double_Func") );
testGroup.set_as_string( "Double_Func", "3.3" );
- BOOST_CHECK( "3.3" == testGroup.get_as_string( "Double_Func") );
+ //BOOST_CHECK_EQUAL( "3.3", testGroup.get_as_string( "Double_Func") );
+ BOOST_CHECK_EQUAL( 3.3, testGroup.get<double>( "Double_Func") );
}
BOOST_AUTO_TEST_CASE( TestSetGetDouble_Var )
@@ -64,10 +65,11 @@
TestGroup testGroup;
testGroup.set( "Double_Var", 2.2 );
- BOOST_CHECK( 2.2 == testGroup.get<double>( "Double_Var") );
+ BOOST_CHECK_EQUAL( 2.2, testGroup.get<double>( "Double_Var") );
testGroup.set_as_string( "Double_Var", "3.3" );
- BOOST_CHECK( "3.3" == testGroup.get_as_string( "Double_Var") );
+ //BOOST_CHECK_EQUAL( "3.3", testGroup.get_as_string( "Double_Var") );
+ BOOST_CHECK_EQUAL( 3.3, testGroup.get<double>( "Double_Var") );
}
BOOST_AUTO_TEST_CASE( TestDoublePropertyType )
Modified: sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_float_properties.cpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -53,10 +53,11 @@
TestGroup testGroup;
testGroup.set( "Float_Func", 2.2f );
- BOOST_CHECK( 2.2f == testGroup.get<float>( "Float_Func") );
+ BOOST_CHECK_EQUAL( 2.2f, testGroup.get<float>( "Float_Func") );
testGroup.set_as_string( "Float_Func", "3.3" );
- BOOST_CHECK( "3.3" == testGroup.get_as_string( "Float_Func") );
+ //BOOST_CHECK_EQUAL( "3.3", testGroup.get_as_string( "Float_Func") );
+ BOOST_CHECK_EQUAL( 3.3f, testGroup.get<float>( "Float_Func") );
}
BOOST_AUTO_TEST_CASE( TestSetGetFloat_Var )
@@ -64,10 +65,11 @@
TestGroup testGroup;
testGroup.set( "Float_Var", 2.2f );
- BOOST_CHECK( 2.2f == testGroup.get<float>( "Float_Var") );
+ BOOST_CHECK_EQUAL( 2.2f, testGroup.get<float>( "Float_Var") );
testGroup.set_as_string( "Float_Var", "3.3" );
- BOOST_CHECK( "3.3" == testGroup.get_as_string( "Float_Var") );
+ //BOOST_CHECK_EQUAL( "3.3", testGroup.get_as_string( "Float_Var") );
+ BOOST_CHECK_EQUAL( 3.3f, testGroup.get<float>( "Float_Var") );
}
BOOST_AUTO_TEST_CASE( TestFloatPropertyType )
Modified: sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_integer_properties.cpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -53,10 +53,10 @@
TestGroup testGroup;
testGroup.set( "Int_Func", 1 );
- BOOST_CHECK( 1 == testGroup.get<int>( "Int_Func") );
+ BOOST_CHECK_EQUAL( 1, testGroup.get<int>( "Int_Func") );
testGroup.set_as_string( "Int_Func", "2" );
- BOOST_CHECK( "2" == testGroup.get_as_string( "Int_Func") );
+ BOOST_CHECK_EQUAL( "2", testGroup.get_as_string( "Int_Func") );
}
BOOST_AUTO_TEST_CASE( TestIntegerSetGet_Var )
@@ -64,10 +64,10 @@
TestGroup testGroup;
testGroup.set( "Int_Var", 1 );
- BOOST_CHECK( 1 == testGroup.get<int>( "Int_Var") );
+ BOOST_CHECK_EQUAL( 1, testGroup.get<int>( "Int_Var") );
testGroup.set_as_string( "Int_Var", "2" );
- BOOST_CHECK( "2" == testGroup.get_as_string( "Int_Var") );
+ BOOST_CHECK_EQUAL( "2", testGroup.get_as_string( "Int_Var") );
}
BOOST_AUTO_TEST_CASE( TestIntegerEditorType )
Modified: sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp
==============================================================================
--- sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp (original)
+++ sandbox/pinhole/libs/pinhole/test/test_string_properties.cpp 2007-12-04 02:10:14 EST (Tue, 04 Dec 2007)
@@ -50,10 +50,10 @@
TestGroup testGroup;
testGroup.set( "String_Func", string("first") );
- BOOST_CHECK( testGroup.get<string>("String_Func") == "first" );
+ BOOST_CHECK_EQUAL( testGroup.get<string>("String_Func"), "first" );
testGroup.set_as_string( "String_Func", "second" );
- BOOST_CHECK( testGroup.get_as_string("String_Func") == "second" );
+ BOOST_CHECK_EQUAL( testGroup.get_as_string("String_Func"), "second" );
}
BOOST_AUTO_TEST_CASE( TestGetSetString_Var )
@@ -61,10 +61,10 @@
TestGroup testGroup;
testGroup.set( "String_Var", string("first") );
- BOOST_CHECK( testGroup.get<string>("String_Var") == "first" );
+ BOOST_CHECK_EQUAL( testGroup.get<string>("String_Var"), "first" );
testGroup.set_as_string( "String_Var", "second" );
- BOOST_CHECK( testGroup.get_as_string("String_Var") == "second" );
+ BOOST_CHECK_EQUAL( testGroup.get_as_string("String_Var"), "second" );
}
BOOST_AUTO_TEST_CASE( TestStringPropertyType )
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