39 BOOST_CHECK_EQUAL(
double(1.234), d1.
get() );
44 BOOST_CHECK( !s1.ready() );
46 BOOST_CHECK( s2.ready() );
51 BOOST_CHECK( s1.ready() );
53 BOOST_CHECK_EQUAL(std::string(
"hello"), s1.getName() );
54 BOOST_CHECK_EQUAL(std::string(
"description"), s1.getDescription() );
55 BOOST_CHECK_EQUAL(std::string(
"world"), s1.get() );
59 BOOST_CHECK_EQUAL(std::string(
"universe"), s2.get() );
69 BOOST_CHECK( i1.
ready() );
70 BOOST_CHECK( d1.
ready() );
75 BOOST_CHECK_EQUAL(
double(1.234), d1.
get() );
76 BOOST_CHECK_EQUAL(
int(3), i1.
get() );
79 BOOST_CHECK_EQUAL(
double(1.234), d1.get() );
81 BOOST_CHECK_EQUAL(
int(3), i2.get() );
85 BOOST_CHECK( !s1.ready() );
87 BOOST_CHECK( s2.ready() );
92 BOOST_CHECK( s1.ready() );
94 BOOST_CHECK_EQUAL(std::string(
"hello"), s1.getName() );
95 BOOST_CHECK_EQUAL(std::string(
"world"), s1.get() );
99 BOOST_CHECK_EQUAL(std::string(
"universe"), s2.get() );
106 BOOST_CHECK(
tc.
provides()->addProperty(
"p",
p).doc(
"foo").ready() );
107 BOOST_CHECK(
tc.
provides()->addAttribute(
"a",
a).ready() );
108 BOOST_CHECK(
tc.
provides()->addConstant(
"c",
c).ready() );
114 BOOST_CHECK(
tc.
provides()->addProperty(
"p2",
p).doc(
"bar").ready() );
115 BOOST_CHECK(
tc.
provides()->addAttribute(
"a2",
a).ready() );
116 BOOST_CHECK(
tc.
provides()->addConstant(
"c2",
c).ready() );
128 BOOST_CHECK(
tc.
provides()->addProperty(
"p",
i).doc(
"foo").ready() );
136 BOOST_CHECK( p.ready() ); BOOST_CHECK_EQUAL( p.getName(),
"p" ); BOOST_CHECK_EQUAL( p.getDescription(),
"foo" ); BOOST_CHECK_EQUAL( p.get(), 3);
137 BOOST_CHECK(
a.
ready() ); BOOST_CHECK_EQUAL(
a.
getName(),
"a" ); BOOST_CHECK_EQUAL(
a.
get(), 3);
138 BOOST_CHECK(
c.
ready() ); BOOST_CHECK_EQUAL(
c.
getName(),
"c" ); BOOST_CHECK_EQUAL(
c.
get(), 3);
139 BOOST_CHECK_EQUAL(
i , 3);
143 BOOST_CHECK_EQUAL( p.get(), 4);
144 BOOST_CHECK_EQUAL( p.get(), 4);
145 BOOST_CHECK_EQUAL( p.get(), 4);
147 BOOST_CHECK(
tc.
provides()->addProperty(
"p2",
i).doc(
"bar").ready() );
148 BOOST_CHECK(
tc.
provides()->addAttribute(
"a2",
i) );
155 BOOST_CHECK( p.ready() ); BOOST_CHECK_EQUAL( p.getName(),
"p2" ); BOOST_CHECK_EQUAL( p.getDescription(),
"bar" ); BOOST_CHECK_EQUAL( p.get(), 4);
156 BOOST_CHECK(
a.
ready() ); BOOST_CHECK_EQUAL(
a.
getName(),
"a2" ); BOOST_CHECK_EQUAL(
a.
get(), 4);
157 BOOST_CHECK(
c.
ready() ); BOOST_CHECK_EQUAL(
c.
getName(),
"c2" ); BOOST_CHECK_EQUAL(
c.
get(), 4);
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
DataSourceType get() const
Property< T > * getPropertyType(const std::string &name) const
Service::shared_ptr provides()
#define BOOST_AUTO_TEST_SUITE_END()
~ConfigurationTestFixture()
BOOST_AUTO_TEST_CASE(testProperties)
ConfigurationTestFixture()
Property< T > & addProperty(const std::string &name, T &attr)
base::AttributeBase * getAttribute(const std::string &name) const
const std::string & getDescription() const
bool addAttribute(const std::string &name, T &attr)
base::PropertyBase * getProperty(const std::string &name) const
PropertyBag * properties()
const std::string & getName() const
const std::string & getName() const