]> git.saurik.com Git - wxWidgets.git/commitdiff
remove ZIP tests: they seem to have been greatly expanded and enhanced by tests/archi...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 16 May 2010 14:53:11 +0000 (14:53 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 16 May 2010 14:53:11 +0000 (14:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/console/console.cpp

index e07b13386705ba64cc079ce8245d3b43e3d4f509..d1f7c65422cec7767062126ab65b987c253f6b59 100644 (file)
     #define TEST_TIMER
 //    #define TEST_VOLUME   --FIXME! (RN)
     #define TEST_WCHAR
-    #define TEST_ZIP
 #else // #if TEST_ALL
     #define TEST_DATETIME
 #endif
@@ -3111,95 +3110,6 @@ static void TestEncodingConverter()
 
 #endif // TEST_WCHAR
 
-// ----------------------------------------------------------------------------
-// ZIP stream
-// ----------------------------------------------------------------------------
-
-#ifdef TEST_ZIP
-
-#include "wx/filesys.h"
-#include "wx/fs_zip.h"
-#include "wx/zipstrm.h"
-
-static const wxChar *TESTFILE_ZIP = wxT("testdata.zip");
-
-static void TestZipStreamRead()
-{
-    wxPuts(wxT("*** Testing ZIP reading ***\n"));
-
-    static const wxString filename = wxT("foo");
-    wxFFileInputStream in(TESTFILE_ZIP);
-    wxZipInputStream istr(in);
-    wxZipEntry entry(filename);
-    istr.OpenEntry(entry);
-
-    wxPrintf(wxT("Archive size: %u\n"), istr.GetSize());
-
-    wxPrintf(wxT("Dumping the file '%s':\n"), filename.c_str());
-    int c;
-    while ( (c=istr.GetC()) != wxEOF )
-    {
-        wxPutchar(c);
-        fflush(stdout);
-    }
-
-    wxPuts(wxT("\n----- done ------"));
-}
-
-static void DumpZipDirectory(wxFileSystem& fs,
-                             const wxString& dir,
-                             const wxString& indent)
-{
-    wxString prefix = wxString::Format(wxT("%s#zip:%s"),
-                                         TESTFILE_ZIP, dir.c_str());
-    wxString wildcard = prefix + wxT("/*");
-
-    wxString dirname = fs.FindFirst(wildcard, wxDIR);
-    while ( !dirname.empty() )
-    {
-        if ( !dirname.StartsWith(prefix + wxT('/'), &dirname) )
-        {
-            wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n"));
-
-            break;
-        }
-
-        wxPrintf(wxT("%s%s\n"), indent.c_str(), dirname.c_str());
-
-        DumpZipDirectory(fs, dirname,
-                         indent + wxString(wxT(' '), 4));
-
-        dirname = fs.FindNext();
-    }
-
-    wxString filename = fs.FindFirst(wildcard, wxFILE);
-    while ( !filename.empty() )
-    {
-        if ( !filename.StartsWith(prefix, &filename) )
-        {
-            wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n"));
-
-            break;
-        }
-
-        wxPrintf(wxT("%s%s\n"), indent.c_str(), filename.c_str());
-
-        filename = fs.FindNext();
-    }
-}
-
-static void TestZipFileSystem()
-{
-    wxPuts(wxT("*** Testing ZIP file system ***\n"));
-
-    wxFileSystem::AddHandler(new wxZipFSHandler);
-    wxFileSystem fs;
-    wxPrintf(wxT("Dumping all files in the archive %s:\n"), TESTFILE_ZIP);
-
-    DumpZipDirectory(fs, wxT(""), wxString(wxT(' '), 4));
-}
-
-#endif // TEST_ZIP
 
 // ----------------------------------------------------------------------------
 // date time
@@ -3556,11 +3466,6 @@ int main(int argc, char **argv)
     TestEncodingConverter();
 #endif // TEST_WCHAR
 
-#ifdef TEST_ZIP
-    TestZipStreamRead();
-    TestZipFileSystem();
-#endif // TEST_ZIP
-
 #if wxUSE_UNICODE
     {
         for ( int n = 0; n < argc; n++ )