68 BOOST_REQUIRE(
Types()->type(
"TheEnum") );
69 BOOST_REQUIRE(
Types()->type(
"int") );
72 BOOST_CHECK(
Types()->type(
"int")->convert(
a ) );
73 BOOST_CHECK(
Types()->type(
"int")->convert(
b ) );
76 BOOST_CHECK(
Types()->type(
"TheEnum")->convert(
Types()->type(
"int")->convert(
a) ) );
77 BOOST_CHECK(
Types()->type(
"TheEnum")->convert(
Types()->type(
"int")->convert(
b) ) );
85 BOOST_REQUIRE_EQUAL( result.
size(), 1);
88 BOOST_CHECK_EQUAL(dint->get(), (int)
A );
91 BOOST_REQUIRE_EQUAL( result.
size(), 2);
94 BOOST_REQUIRE( dint );
95 BOOST_CHECK_EQUAL(dint->get(), (int)
B );
110 BOOST_CHECK( pl.
save(
"enum_type_test_int_save.cpf",
true) );
116 BOOST_CHECK( pl.
load(
"enum_type_test_int_save.cpf") );
118 BOOST_CHECK_EQUAL( enum1,
A);
119 BOOST_CHECK_EQUAL(
enum2,
B);
Property< T > & addProperty(const std::string &name, T &attr)
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
TypeInfo * ti
Contains 'B'.
#define BOOST_AUTO_TEST_SUITE_END()
This class fills up a given bag with the results of an introspection.
bool load(const std::string &filename) const
BOOST_AUTO_TEST_CASE(testEnumIntConversion)
A container for holding references to properties.
void introspect(const PropertyBag &v)
bool save(const std::string &filename, bool all=true) const
A property represents a named value of any type with a description.
TypeInfoRepository::shared_ptr Types()
EnumTypeTest()
Type info for 'string'.
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
base::PropertyBase * getItem(int i) const
AssignableDataSource< TheEnum >::shared_ptr a
AssignableDataSource< TheEnum >::shared_ptr b
Contains 'A'.
TypeInfo * ts
Type info for enum.
virtual DataSourceBase::shared_ptr getDataSource() const =0
virtual const types::TypeInfo * getTypeInfo() const =0