Unload bogus XRC resources in "garbage" unit test.

Leaving invalid XRC entries in wxXmlResource internal list of loaded resources
resulted in failures in the XRC unit test which executed after this one.

It seems that loading an invalid resource shouldn't prevent the other ones
from loading correctly later and this probably should be corrected at
wxXmlResource level but for now work around this problem in the test itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-11-08 16:28:51 +00:00
parent adf1edd924
commit d97ee1b955

View File

@ -149,7 +149,16 @@ void GarbageTestCase::DoLoadFile(const wxString& fullname)
delete htmlwin;
*/
// test wxXmlResource
CPPUNIT_ASSERT( wxXmlResource::Get()->Load(fullname) == false );
bool loaded = wxXmlResource::Get()->Load(fullname);
wxXmlResource::Get()->Unload(fullname);
if ( loaded )
{
CPPUNIT_FAIL
(
wxString::Format("Unexpectedly succeeded loading XRC from '%s'",
fullname).ToStdString()
);
}
}
void GarbageTestCase::DoLoadStream(wxInputStream& stream)