diff --git a/tests/image/image.cpp b/tests/image/image.cpp index 5eb923eb34..1f43fb810e 100644 --- a/tests/image/image.cpp +++ b/tests/image/image.cpp @@ -31,6 +31,7 @@ #include "wx/wfstream.h" #include "wx/clipbrd.h" #include "wx/dataobj.h" +#include "wx/scopedptr.h" #include "testimage.h" @@ -158,56 +159,46 @@ void ImageTestCase::LoadFromFile() { wxImage img; for (unsigned int i=0; iIsOk() - ); + wxScopedPtr in_stream(url.GetInputStream()); + REQUIRE( in_stream ); + REQUIRE( in_stream->IsOk() ); - wxImage img; + wxImage img; - // NOTE: it's important to inform wxImage about the type of the image being - // loaded otherwise it will try to autodetect the format, but that - // requires a seekable stream! - WX_ASSERT_MESSAGE - ( - ("Loading image from \"%s\" failed.", testData[i].url), - img.LoadFile(*in_stream, testData[i].type) - ); - - delete in_stream; + // NOTE: it's important to inform wxImage about the type of the image being + // loaded otherwise it will try to autodetect the format, but that + // requires a seekable stream! + CHECK( img.LoadFile(*in_stream, testData[i].type) ); + } } } @@ -215,47 +206,49 @@ void ImageTestCase::LoadFromZipStream() { for (unsigned int i=0; i in_stream(url.GetInputStream());