39 EnumTypeInfo<
TheEnum> (
"TheEnum")
78 ti =
Types()->type(
"TheEnum");
79 ts =
Types()->type(
"string");
85 BOOST_REQUIRE( ti->decomposeType( a ) );
86 BOOST_CHECK_EQUAL( ti->decomposeType( a )->getTypeInfo(), ts );
89 BOOST_CHECK( ti->composeType(ti->decomposeType(a), b) );
91 BOOST_CHECK_EQUAL( a->get(),
A);
92 BOOST_CHECK_EQUAL( b->get(),
A);
102 BOOST_REQUIRE_EQUAL( result.
size(), 1);
105 BOOST_CHECK_EQUAL(dstring->get(),
"A" );
108 BOOST_REQUIRE_EQUAL( result.
size(), 2);
112 BOOST_CHECK_EQUAL(dstring->get(),
"B" );
126 BOOST_CHECK( pl.
save(
"enum_type_test_string_save.cpf",
true) );
132 BOOST_CHECK( pl.
load(
"enum_type_test_string_save.cpf") );
134 BOOST_CHECK_EQUAL( enum1,
A);
135 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'.
BOOST_AUTO_TEST_CASE(testEnumStringConversion)
#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
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< DataSource< T > > shared_ptr
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