}
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;
}
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);
}
// 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);
{
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));
- entry = auto_ptr<wxArchiveEntry>(arc->GetNextEntry());
+ auto_ptr<wxArchiveEntry> next(arc->GetNextEntry());
+ entry = next;
}
}
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;
template class ArchiveTestCase<wxZipClassFactory>;
#endif
+#if wxUSE_TARSTREAM
+#include "wx/tarstrm.h"
+template class ArchiveTestCase<wxTarClassFactory>;
+#endif
+
#endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS