extend attibute_value unit test
This commit is contained in:
parent
606becd24b
commit
5089669eb9
1 changed files with 24 additions and 0 deletions
|
@ -24,6 +24,7 @@ BOOST_AUTO_TEST_SUITE ( test_config )
|
|||
BOOST_AUTO_TEST_CASE ( test_config_attribute_value )
|
||||
{
|
||||
config c;
|
||||
const config& cc = c;
|
||||
int x_int;
|
||||
std::string x_str;
|
||||
long long x_sll;
|
||||
|
@ -146,6 +147,29 @@ BOOST_AUTO_TEST_CASE ( test_config_attribute_value )
|
|||
BOOST_CHECK_EQUAL(x_sll, 123456789123ll);
|
||||
x_str = c["x"].str();
|
||||
BOOST_CHECK_EQUAL(x_str, "123456789123");
|
||||
|
||||
// blank != "" test.
|
||||
c = config();
|
||||
BOOST_CHECK(cc["x"] != "");
|
||||
BOOST_CHECK(cc["x"].empty());
|
||||
BOOST_CHECK(cc["x"].blank());
|
||||
|
||||
BOOST_CHECK(c["x"] != "");
|
||||
BOOST_CHECK(c["x"].empty());
|
||||
BOOST_CHECK(c["x"].blank());
|
||||
|
||||
BOOST_CHECK_EQUAL(cc["x"], c["x"]);
|
||||
|
||||
c["x"] = "";
|
||||
BOOST_CHECK(cc["x"] == "");
|
||||
BOOST_CHECK(cc["x"].empty());
|
||||
BOOST_CHECK(!cc["x"].blank());
|
||||
|
||||
BOOST_CHECK(c["x"] == "");
|
||||
BOOST_CHECK(c["x"].empty());
|
||||
BOOST_CHECK(!c["x"].blank());
|
||||
|
||||
BOOST_CHECK_EQUAL(cc["x"], c["x"]);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
|
Loading…
Add table
Reference in a new issue