From: Vadim Zeitlin Date: Mon, 8 Nov 2010 16:28:51 +0000 (+0000) Subject: Unload bogus XRC resources in "garbage" unit test. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d97ee1b95568e5f3011caeb26b03f44f694e7b81 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 --- diff --git a/tests/misc/garbage.cpp b/tests/misc/garbage.cpp index c866ea61ef..1f81940ca2 100644 --- a/tests/misc/garbage.cpp +++ b/tests/misc/garbage.cpp @@ -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)