mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-24 02:03:52 +03:00
parent
35aa6ade2c
commit
ab24a66e0e
@ -64,6 +64,9 @@ main_env.Append(CPPFLAGS=[
|
||||
"-Wall"
|
||||
])
|
||||
|
||||
# libxml2
|
||||
main_env.ParseConfig('xml2-config --libs --cflags')
|
||||
|
||||
# MYSQL
|
||||
main_env.Append(LIBPATH=["/usr/lib/mysql"])
|
||||
main_env.Append(CPPPATH=["/usr/include/mysql"])
|
||||
|
@ -311,6 +311,35 @@ public:
|
||||
CPPUNIT_ASSERT( n == 2 );
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
void test_from_xml()
|
||||
{
|
||||
string str1;
|
||||
string str2;
|
||||
Template t_xml;
|
||||
int rc;
|
||||
|
||||
// Generate a xml from a Template generated from a text template
|
||||
t1->to_xml(str1);
|
||||
CPPUNIT_ASSERT(test_ok_xml == str1);
|
||||
|
||||
// Parse the xml in a new Template object
|
||||
rc = t_xml.from_xml(str1);
|
||||
CPPUNIT_ASSERT(rc == 0);
|
||||
|
||||
// Check correct output of this xml-generated Template object
|
||||
t_xml.to_xml(str2);
|
||||
CPPUNIT_ASSERT(str1 == str2);
|
||||
|
||||
str1 = "";
|
||||
str2 = "";
|
||||
|
||||
t1->to_str(str1);
|
||||
t_xml.to_str(str2);
|
||||
|
||||
CPPUNIT_ASSERT(str1 == str2);
|
||||
}
|
||||
|
||||
/* ********************************************************************* */
|
||||
/* ********************************************************************* */
|
||||
@ -351,6 +380,10 @@ public:
|
||||
"erase() Test",
|
||||
&TemplateTest::test_erase));
|
||||
|
||||
ts->addTest(new CppUnit::TestCaller<TemplateTest>(
|
||||
"from_xml() Test",
|
||||
&TemplateTest::test_from_xml));
|
||||
|
||||
return ts;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user