This test case keeps failing erratically resulting in too many bogus build
breakage notifications. Disable it until someone has time to fix it properly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64134
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
struct testData {
const char* file;
wxBitmapType type;
struct testData {
const char* file;
wxBitmapType type;
{
{ "horse.ico", wxBITMAP_TYPE_ICO },
{ "horse.xpm", wxBITMAP_TYPE_XPM },
{
{ "horse.ico", wxBITMAP_TYPE_ICO },
{ "horse.xpm", wxBITMAP_TYPE_XPM },
void ImageTestCase::LoadFromSocketStream()
{
void ImageTestCase::LoadFromSocketStream()
{
+ // Skip this test when running on a build slave because it just keeps
+ // failing erratically and sends build failure notifications when it does.
+ //
+ // Of course, it would be even better to understand why does it fail but so
+ // far we didn't manage to do it so disable until someone can find the
+ // problem.
+ if ( wxGetUserId().Lower().Matches("buildslave*") )
+ return;
+
if (!IsNetworkAvailable()) // implemented in test.cpp
{
if (!IsNetworkAvailable()) // implemented in test.cpp
{
- wxLogWarning("No network connectivity; skipping the ImageTestCase::LoadFromSocketStream test unit.");
+ wxLogWarning("No network connectivity; skipping the "
+ "ImageTestCase::LoadFromSocketStream test unit.");
return;
}
struct {
const char* url;
wxBitmapType type;
return;
}
struct {
const char* url;
wxBitmapType type;
{
{ "http://wxwidgets.org/logo9.jpg", wxBITMAP_TYPE_JPEG },
{ "http://wxwidgets.org/favicon.ico", wxBITMAP_TYPE_ICO }
};
{
{ "http://wxwidgets.org/logo9.jpg", wxBITMAP_TYPE_JPEG },
{ "http://wxwidgets.org/favicon.ico", wxBITMAP_TYPE_ICO }
};
for (unsigned int i=0; i<WXSIZEOF(testData); i++)
{
wxURL url(testData[i].url);
for (unsigned int i=0; i<WXSIZEOF(testData); i++)
{
wxURL url(testData[i].url);
CPPUNIT_ASSERT(in_stream && in_stream->IsOk());
wxImage img;
CPPUNIT_ASSERT(in_stream && in_stream->IsOk());
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!
CPPUNIT_ASSERT(img.LoadFile(*in_stream, testData[i].type));
// 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!
CPPUNIT_ASSERT(img.LoadFile(*in_stream, testData[i].type));
case wxBITMAP_TYPE_TIF:
continue; // skip testing those wxImageHandlers which cannot
// load data from non-seekable streams
case wxBITMAP_TYPE_TIF:
continue; // skip testing those wxImageHandlers which cannot
// load data from non-seekable streams
// compress the test file on the fly:
wxMemoryOutputStream memOut;
{
wxFileInputStream file(g_testfiles[i].file);
CPPUNIT_ASSERT(file.IsOk());
// compress the test file on the fly:
wxMemoryOutputStream memOut;
{
wxFileInputStream file(g_testfiles[i].file);
CPPUNIT_ASSERT(file.IsOk());
wxZlibOutputStream compressFilter(memOut, 5, wxZLIB_GZIP);
CPPUNIT_ASSERT(compressFilter.IsOk());
wxZlibOutputStream compressFilter(memOut, 5, wxZLIB_GZIP);
CPPUNIT_ASSERT(compressFilter.IsOk());
file.Read(compressFilter);
CPPUNIT_ASSERT(file.GetLastError() == wxSTREAM_EOF);
}
file.Read(compressFilter);
CPPUNIT_ASSERT(file.GetLastError() == wxSTREAM_EOF);
}
// now fetch the compressed memory to wxImage, decompressing it on the fly; this
// allows us to test loading images from non-seekable streams other than socket streams
wxMemoryInputStream memIn(memOut);
CPPUNIT_ASSERT(memIn.IsOk());
wxZlibInputStream decompressFilter(memIn, wxZLIB_GZIP);
CPPUNIT_ASSERT(decompressFilter.IsOk());
// now fetch the compressed memory to wxImage, decompressing it on the fly; this
// allows us to test loading images from non-seekable streams other than socket streams
wxMemoryInputStream memIn(memOut);
CPPUNIT_ASSERT(memIn.IsOk());
wxZlibInputStream decompressFilter(memIn, wxZLIB_GZIP);
CPPUNIT_ASSERT(decompressFilter.IsOk());
// 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!
// 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!