X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ed626c8b55317c1cc28278ff67c8b78e79303ff6..fe79f76ba9aa2f89165481d7ed796f69df979875:/tests/archive/archivetest.cpp diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index 941b07d002..1d8853945a 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; } @@ -1202,7 +1204,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 +1214,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 +1243,10 @@ void CorruptionTestCase::ExtractArchive(wxInputStream& in) { auto_ptr arc(m_factory->NewStream(in)); auto_ptr entry(arc->GetNextEntry()); - + while (entry.get() != NULL) { - wxString name = entry->GetName(); char buf[1024]; - + while (arc->IsOk()) arc->Read(buf, sizeof(buf)); @@ -1326,7 +1328,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; @@ -1407,4 +1409,9 @@ template class ArchiveTestCase; template class ArchiveTestCase; #endif +#if wxUSE_TARSTREAM +#include "wx/tarstrm.h" +template class ArchiveTestCase; +#endif + #endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS