// Name: tests/archive/ziptest.cpp
// Purpose: Test the zip classes
// Author: Mike Wetherell
-// RCS-ID: $Id$
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
void ZipTestCase::OnCreateArchive(wxZipOutputStream& zip)
{
- m_comment << _T("Comment for test ") << m_id;
+ m_comment << wxT("Comment for test ") << m_id;
zip.SetComment(m_comment);
}
switch ((m_id + m_count) % 5) {
case 0:
{
- wxString comment = _T("Comment for ") + entry->GetName();
+ wxString comment = wxT("Comment for ") + entry->GetName();
entry->SetComment(comment);
// lowercase the expected result, and the notifier should do
// the same for the zip entries when ModifyArchive() runs
{
// provide some context for the error message so that we know which
// iteration of the loop we were on
- wxString name = _T(" '") + entry.GetName() + _T("'");
+ wxString name = wxT(" '") + entry.GetName() + wxT("'");
string error_entry(name.mb_str());
string error_context(" failed for entry" + error_entry);
{
TestOutputStream out(m_options);
- wxString testdata = _T("test data to pipe through zip");
- wxString cmd = _T("echo ") + testdata + _T(" | zip -q - -");
+ wxString testdata = wxT("test data to pipe through zip");
+ wxString cmd = wxT("echo ") + testdata + wxT(" | zip -q - -");
{
PFileInputStream in(cmd);
- if (in.Ok())
+ if (in.IsOk())
out.Write(in);
}
ziptest::ziptest()
: ArchiveTestSuite("zip")
{
- AddArchiver(_T("zip -qr %s *"));
- AddUnArchiver(_T("unzip -q %s"));
+ AddArchiver(wxT("zip -qr %s *"));
+ AddUnArchiver(wxT("unzip -q %s"));
}
ArchiveTestSuite *ziptest::makeSuite()
{
ArchiveTestSuite::makeSuite();
-#ifndef WXARC_NO_POPEN
- // if have popen then can check the piped output of 'zip - -'
- if (IsInPath(_T("zip")))
+#if 0
+ // zip doesn't support this any more so disabled
+ if (IsInPath(wxT("zip")))
for (int options = 0; options <= PipeIn; options += PipeIn) {
- string name = Description(_T("ZipPipeTestCase"), options,
- false, _T(""), _T("zip -q - -"));
+ string name = Description(wxT("ZipPipeTestCase"), options,
+ false, wxT(""), wxT("zip -q - -"));
addTest(new ZipPipeTestCase(name, options));
}
#endif
return NULL;
if (genericInterface)
+ {
return new ArchiveTestCase<wxArchiveClassFactory>(
descr, new wxZipClassFactory,
options, archiver, unarchiver);
- else
- return new ZipTestCase(descr, options, archiver, unarchiver);
+ }
+
+ return new ZipTestCase(descr, options, archiver, unarchiver);
}
CPPUNIT_TEST_SUITE_REGISTRATION(ziptest);