]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/archive/ziptest.cpp
added wxICON_NONE and implement support for it in wxGTK (closes #2897)
[wxWidgets.git] / tests / archive / ziptest.cpp
index 4f17fbe4b04d745c1c7fb5261421b74e37cc1ffd..4204c7dfb7c0fe67ed7a1f5a72fbf57cfca82905 100644 (file)
@@ -34,12 +34,11 @@ class ZipTestCase : public ArchiveTestCase<wxZipClassFactory>
 {
 public:
     ZipTestCase(string name,
-                int id,
                 int options,
                 const wxString& archiver = wxEmptyString,
                 const wxString& unarchiver = wxEmptyString)
     :
-        ArchiveTestCase<wxZipClassFactory>(name, id, new wxZipClassFactory,
+        ArchiveTestCase<wxZipClassFactory>(name, new wxZipClassFactory,
                                            options, archiver, unarchiver),
         m_count(0)
     { }
@@ -161,11 +160,15 @@ class ZipPipeTestCase : public CppUnit::TestCase
 {
 public:
     ZipPipeTestCase(string name, int options) :
-        CppUnit::TestCase(name), m_options(options) { }
+        CppUnit::TestCase(TestId::MakeId() + name),
+        m_options(options),
+        m_id(TestId::GetId())
+    { }
 
 protected:
     void runTest();
     int m_options;
+    int m_id;
 };
 
 void ZipPipeTestCase::runTest()
@@ -181,7 +184,7 @@ void ZipPipeTestCase::runTest()
             out.Write(in);
     }
 
-    TestInputStream in(out);
+    TestInputStream in(out, m_id % ((m_options & PipeIn) ? 4 : 3));
     wxZipInputStream zip(in);
 
     auto_ptr<wxZipEntry> entry(zip.GetNextEntry());
@@ -214,7 +217,7 @@ public:
 protected:
     ArchiveTestSuite *makeSuite();
 
-    CppUnit::Test *makeTest(string descr, int id, int options,
+    CppUnit::Test *makeTest(string descr, int options,
                             bool genericInterface, const wxString& archiver,
                             const wxString& unarchiver);
 };
@@ -230,14 +233,16 @@ ArchiveTestSuite *ziptest::makeSuite()
 {
     ArchiveTestSuite::makeSuite();
 
-#ifndef WXARC_NO_POPEN 
-    // if have popen then can check the piped output of 'zip - -'
+#if !defined WXARC_NO_POPEN && !defined __WXMSW__
+    // If have popen then can check the piped output of 'zip - -'.
+    // The gnuwin32 build of infozip does work for this, e.g.:
+    //  C:\>echo test data to pipe through zip | zip -q > foo.zip 
+    // doesn't produce a valid zip, so disabled for now.
     if (IsInPath(_T("zip")))
         for (int options = 0; options <= PipeIn; options += PipeIn) {
             string name = Description(_T("ZipPipeTestCase"), options,
                                       false, _T(""), _T("zip -q - -"));
             addTest(new ZipPipeTestCase(name, options));
-            m_id++;
         }
 #endif
 
@@ -246,7 +251,6 @@ ArchiveTestSuite *ziptest::makeSuite()
 
 CppUnit::Test *ziptest::makeTest(
     string descr,
-    int   id,
     int   options,
     bool  genericInterface,
     const wxString& archiver,
@@ -257,11 +261,13 @@ CppUnit::Test *ziptest::makeTest(
         return NULL;
 
     if (genericInterface)
+    {
         return new ArchiveTestCase<wxArchiveClassFactory>(
-                            descr, id, new wxZipClassFactory,
+                            descr, new wxZipClassFactory,
                             options, archiver, unarchiver);
-    else
-        return new ZipTestCase(descr, id, options, archiver, unarchiver);
+    }
+
+    return new ZipTestCase(descr, options, archiver, unarchiver);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ziptest);