X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdd7933f3d21b94794431211129812e8c92b1bbf..48715f6048bfb776dbb6288dd021f7ebf0d37ed6:/tests/archive/archivetest.cpp diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index c92cb7390d..83d85a2a2d 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -269,10 +269,12 @@ size_t TestInputStream::OnSysRead(void *buffer, size_t size) } if (((m_eoftype & AtLast) != 0 && m_pos >= m_size) || count < size) + { if ((m_eoftype & WithError) != 0) m_lasterror = wxSTREAM_READ_ERROR; else m_lasterror = wxSTREAM_EOF; + } return count; } @@ -802,10 +804,14 @@ void ArchiveTestCase<ClassFactoryT>::ExtractArchive(wxInputStream& in) const TestEntry& testEntry = *it->second; +#ifndef __WXMSW__ + // On Windows some archivers compensate for Windows DST handling, but + // other don't, so disable the test for now. wxDateTime dt = testEntry.GetDateTime(); if (dt.IsValid()) CPPUNIT_ASSERT_MESSAGE("timestamp check" + error_context, dt == entry->GetDateTime()); +#endif // non-seekable entries are allowed to have GetSize == wxInvalidOffset // until the end of the entry's data has been read past @@ -1202,7 +1208,8 @@ void CorruptionTestCase::runTest() wxFileOffset len = in.GetLength(); // try flipping one byte in the archive - for (int pos = 0; pos < len; pos++) { + int pos; + for (pos = 0; pos < len; pos++) { char n = in[pos]; in[pos] = ~n; ExtractArchive(in); @@ -1211,7 +1218,7 @@ void CorruptionTestCase::runTest() } // try zeroing one byte in the archive - for (int pos = 0; pos < len; pos++) { + for (pos = 0; pos < len; pos++) { char n = in[pos]; in[pos] = 0; ExtractArchive(in); @@ -1240,11 +1247,10 @@ void CorruptionTestCase::ExtractArchive(wxInputStream& in) { auto_ptr<wxArchiveInputStream> arc(m_factory->NewStream(in)); auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry()); - + while (entry.get() != NULL) { - wxString name = entry->GetName(); char buf[1024]; - + while (arc->IsOk()) arc->Read(buf, sizeof(buf)); @@ -1326,7 +1332,7 @@ ArchiveTestSuite *ArchiveTestSuite::makeSuite() addTest(test); } - for (int options = 0; options <= PipeIn; options += PipeIn) + for (int options = 0; options <= PipeIn; options += PipeIn) { wxObject *pObj = wxCreateDynamicObject(m_name + _T("ClassFactory")); wxArchiveClassFactory *factory;