boost::any instead of macros - first pieces of meta template programming

This commit is contained in:
Marc Wäckerlin
2009-04-28 07:36:07 +00:00
parent 1e09b8a696
commit 933208f849
3 changed files with 167 additions and 83 deletions

View File

@@ -115,7 +115,7 @@ class SerializationTest: public CppUnit::TestFixture {
CPPUNIT_ASSERT_NO_THROW(_a.saveXml(ss));
CPPUNIT_ASSERT_EQUAL(std::string("<A>\n"
"\t<anInteger>15</anInteger>\n"
"\t<aBool>1</aBool>\n"
"\t<aBool>true</aBool>\n"
"\t<aDouble>123.456</aDouble>\n"
"\t<aString>Hello World</aString>\n"
"\t<anotherString>This is"
@@ -146,7 +146,7 @@ class SerializationTest: public CppUnit::TestFixture {
void complexLoad() {
std::stringstream ss("<A2>\n"
" <anInteger>-1234</anInteger>\n"
" <aBool>1</aBool>\n"
" <aBool>true</aBool>\n"
" <aDouble>3.141</aDouble>\n"
" <aString>This is A inside of A2</aString>\n"
" <anotherString>Another A-String</anotherString>\n"
@@ -206,7 +206,7 @@ class SerializationTest: public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL
(std::string("<A2>\n"
"\t<anInteger>-1234</anInteger>\n"
"\t<aBool>1</aBool>\n"
"\t<aBool>true</aBool>\n"
"\t<aDouble>3.141</aDouble>\n"
"\t<aString>This is A inside of A2</aString>\n"
"\t<anotherString>Another A-String</anotherString>\n"
@@ -225,7 +225,7 @@ class SerializationTest: public CppUnit::TestFixture {
("<C>\n"
" <a2>\n"
" <anInteger>-1234</anInteger>\n"
" <aBool>1</aBool>\n"
" <aBool>true</aBool>\n"
" <aDouble>3.141</aDouble>\n"
" <aString>This is A inside of A2</aString>\n"
" <anotherString>Another A-String</anotherString>\n"
@@ -311,7 +311,7 @@ class SerializationTest: public CppUnit::TestFixture {
(std::string("<C>\n"
"\t<a2>\n"
"\t\t<anInteger>-1234</anInteger>\n"
"\t\t<aBool>1</aBool>\n"
"\t\t<aBool>true</aBool>\n"
"\t\t<aDouble>3.141</aDouble>\n"
"\t\t<aString>This is A inside of A2</aString>\n"
"\t\t<anotherString>Another A-String</anotherString>\n"