]> git.saurik.com Git - wxWidgets.git/commitdiff
Unload bogus XRC resources in "garbage" unit test.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Nov 2010 16:28:51 +0000 (16:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Nov 2010 16:28:51 +0000 (16:28 +0000)
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

tests/misc/garbage.cpp

index c866ea61ef6177ece97ba0e876c93b8c98d335dd..1f81940ca2c0e3dcb4017da70f5e706ef447545f 100644 (file)
@@ -149,7 +149,16 @@ void GarbageTestCase::DoLoadFile(const wxString& fullname)
     delete htmlwin;
 */
     // test wxXmlResource
     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)
 }
 
 void GarbageTestCase::DoLoadStream(wxInputStream& stream)