| | 136 | |
| | 137 | void XmlTestCase::LoadSave() |
| | 138 | { |
| | 139 | // NB: this is not real XRC but rather some XRC-like XML fragment which |
| | 140 | // exercises different XML constructs to check that they're saved back |
| | 141 | // correctly |
| | 142 | // |
| | 143 | // Also note that there should be no blank lines here as they disappear |
| | 144 | // after saving. |
| | 145 | const char *xmlText = |
| | 146 | "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" |
| | 147 | "<resource xmlns=\"http://www.wxwidgets.org/wxxrc\" version=\"2.3.0.1\">\n" |
| | 148 | " <object class=\"wxDialog\" name=\"my_dialog\">\n" |
| | 149 | " <children>\n" |
| | 150 | " <grandchild id=\"1\"/>\n" |
| | 151 | " </children>\n" |
| | 152 | " <subobject/>\n" |
| | 153 | " </object>\n" |
| | 154 | "</resource>\n" |
| | 155 | ; |
| | 156 | |
| | 157 | wxStringInputStream sis(xmlText); |
| | 158 | |
| | 159 | wxXmlDocument doc; |
| | 160 | CPPUNIT_ASSERT( doc.Load(sis) ); |
| | 161 | |
| | 162 | wxStringOutputStream sos; |
| | 163 | CPPUNIT_ASSERT( doc.Save(sos) ); |
| | 164 | |
| | 165 | CPPUNIT_ASSERT_EQUAL( xmlText, sos.GetString() ); |
| | 166 | } |
| | 167 | |