]> git.saurik.com Git - wxWidgets.git/commitdiff
Add tar stream tests.
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 27 Oct 2006 10:11:46 +0000 (10:11 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 27 Oct 2006 10:11:46 +0000 (10:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/Makefile.in
tests/archive/archivetest.cpp
tests/archive/tartest.cpp [new file with mode: 0644]
tests/makefile.bcc
tests/makefile.gcc
tests/makefile.vc
tests/makefile.wat
tests/test.bkl
tests/test_test.dsp

index 44667596376c6d79c68e6ade72460cbd03ddb397..3a4806b1347b3b754dd0e5b11b34ffa5d7c5460d 100644 (file)
@@ -48,6 +48,7 @@ TEST_OBJECTS =  \
        test_test.o \
        test_archivetest.o \
        test_ziptest.o \
+       test_tartest.o \
        test_arrays.o \
        test_datetimetest.o \
        test_fileconftest.o \
@@ -296,6 +297,9 @@ test_archivetest.o: $(srcdir)/archive/archivetest.cpp $(TEST_ODEP)
 test_ziptest.o: $(srcdir)/archive/ziptest.cpp $(TEST_ODEP)
        $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/archive/ziptest.cpp
 
+test_tartest.o: $(srcdir)/archive/tartest.cpp $(TEST_ODEP)
+       $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/archive/tartest.cpp
+
 test_arrays.o: $(srcdir)/arrays/arrays.cpp $(TEST_ODEP)
        $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/arrays/arrays.cpp
 
index 941b07d0023cdea7aebd8c3def4f0592a62f328e..c92cb7390d9cb454850329c9df4da6101032d40a 100644 (file)
@@ -1407,4 +1407,9 @@ template class ArchiveTestCase<wxArchiveClassFactory>;
 template class ArchiveTestCase<wxZipClassFactory>;
 #endif
 
+#if wxUSE_TARSTREAM
+#include "wx/tarstrm.h"
+template class ArchiveTestCase<wxTarClassFactory>;
+#endif
+
 #endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS
diff --git a/tests/archive/tartest.cpp b/tests/archive/tartest.cpp
new file mode 100644 (file)
index 0000000..2ff2006
--- /dev/null
@@ -0,0 +1,75 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        tests/tartest.cpp
+// Purpose:     Test the tar classes
+// Author:      Mike Wetherell
+// RCS-ID:      $Id$
+// Copyright:   (c) 2004 Mike Wetherell
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#include "testprec.h"
+
+#ifdef __BORLANDC__
+#   pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+#   include "wx/wx.h"
+#endif
+
+#if wxUSE_STREAMS
+
+#include "archivetest.h"
+#include "wx/tarstrm.h"
+
+using std::string;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Tar suite 
+
+class tartest : public ArchiveTestSuite
+{
+public:
+    tartest();
+    static CppUnit::Test *suite() { return (new tartest)->makeSuite(); }
+
+protected:
+    CppUnit::Test *makeTest(string descr, int options,
+                            bool genericInterface,
+                            const wxString& archiver,
+                            const wxString& unarchiver);
+};
+
+tartest::tartest()
+  : ArchiveTestSuite("tar")
+{
+    AddArchiver(_T("tar cf %s *"));
+    AddUnArchiver(_T("tar xf %s"));
+}
+
+CppUnit::Test *tartest::makeTest(
+    string descr,
+    int   options,
+    bool  genericInterface,
+    const wxString& archiver,
+    const wxString& unarchiver)
+{
+    if ((options & Stub) && (options & PipeIn) == 0)
+        return NULL;
+
+    if (genericInterface)
+        return new ArchiveTestCase<wxArchiveClassFactory>(
+                            descr, new wxTarClassFactory,
+                            options, archiver, unarchiver);
+    else
+        return new ArchiveTestCase<wxTarClassFactory>(
+                            descr, new wxTarClassFactory,
+                            options, archiver, unarchiver);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(tartest);
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(tartest, "archive");
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(tartest, "archive/tar");
+
+#endif // wxUSE_STREAMS
index a3f236e409eaa89e6f0df24c62a4697db3838467..58ab1e3390dbc832c636123bb3d4bbe5711026ba 100644 (file)
@@ -39,6 +39,7 @@ TEST_OBJECTS =  \
        $(OBJS)\test_test.obj \
        $(OBJS)\test_archivetest.obj \
        $(OBJS)\test_ziptest.obj \
+       $(OBJS)\test_tartest.obj \
        $(OBJS)\test_arrays.obj \
        $(OBJS)\test_datetimetest.obj \
        $(OBJS)\test_fileconftest.obj \
@@ -335,6 +336,9 @@ $(OBJS)\test_archivetest.obj: .\archive\archivetest.cpp
 $(OBJS)\test_ziptest.obj: .\archive\ziptest.cpp
        $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
 
+$(OBJS)\test_tartest.obj: .\archive\tartest.cpp
+       $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+
 $(OBJS)\test_arrays.obj: .\arrays\arrays.cpp
        $(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
 
index d8b6ec7cc2425b5b67d7dea31894172b239375a1..e0926e3517ee4fad7024fdc90392a154e82b2342 100644 (file)
@@ -31,6 +31,7 @@ TEST_OBJECTS =  \
        $(OBJS)\test_test.o \
        $(OBJS)\test_archivetest.o \
        $(OBJS)\test_ziptest.o \
+       $(OBJS)\test_tartest.o \
        $(OBJS)\test_arrays.o \
        $(OBJS)\test_datetimetest.o \
        $(OBJS)\test_fileconftest.o \
@@ -313,6 +314,9 @@ $(OBJS)\test_archivetest.o: ./archive/archivetest.cpp
 $(OBJS)\test_ziptest.o: ./archive/ziptest.cpp
        $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
 
+$(OBJS)\test_tartest.o: ./archive/tartest.cpp
+       $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
+
 $(OBJS)\test_arrays.o: ./arrays/arrays.cpp
        $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $<
 
index be7db5bdb1d75686f6ad5175dbff40671222fbe4..f22bfe526bfc588309564de8186fd430808a5104 100644 (file)
@@ -31,6 +31,7 @@ TEST_OBJECTS =  \
        $(OBJS)\test_test.obj \
        $(OBJS)\test_archivetest.obj \
        $(OBJS)\test_ziptest.obj \
+       $(OBJS)\test_tartest.obj \
        $(OBJS)\test_arrays.obj \
        $(OBJS)\test_datetimetest.obj \
        $(OBJS)\test_fileconftest.obj \
@@ -419,6 +420,9 @@ $(OBJS)\test_archivetest.obj: .\archive\archivetest.cpp
 $(OBJS)\test_ziptest.obj: .\archive\ziptest.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
 
+$(OBJS)\test_tartest.obj: .\archive\tartest.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
+
 $(OBJS)\test_arrays.obj: .\arrays\arrays.cpp
        $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) $**
 
index fec8ef6c4c77c9e44753eac9e11225f1f716b8ac..e8cbbca55d389bf3eb14420bd814d3918ebd6f07 100644 (file)
@@ -236,6 +236,7 @@ TEST_OBJECTS =  &
        $(OBJS)\test_test.obj &
        $(OBJS)\test_archivetest.obj &
        $(OBJS)\test_ziptest.obj &
+       $(OBJS)\test_tartest.obj &
        $(OBJS)\test_arrays.obj &
        $(OBJS)\test_datetimetest.obj &
        $(OBJS)\test_fileconftest.obj &
@@ -368,6 +369,9 @@ $(OBJS)\test_archivetest.obj :  .AUTODEPEND .\archive\archivetest.cpp
 $(OBJS)\test_ziptest.obj :  .AUTODEPEND .\archive\ziptest.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
 
+$(OBJS)\test_tartest.obj :  .AUTODEPEND .\archive\tartest.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
+
 $(OBJS)\test_arrays.obj :  .AUTODEPEND .\arrays\arrays.cpp
        $(CXX) -bt=nt -zq -fo=$^@ $(TEST_CXXFLAGS) $<
 
index b5ee07080f26adbeaa297413ee42c9856f6dfa90..79a85a157a10f70a55235a4f0f3949bae3e350cb 100644 (file)
@@ -26,6 +26,7 @@
             test.cpp
             archive/archivetest.cpp
             archive/ziptest.cpp
+            archive/tartest.cpp
             arrays/arrays.cpp
             datetime/datetimetest.cpp
             fileconf/fileconftest.cpp
index ba9224b9da17ecb7328a970dc6032307fe6ef742..e1bf7f9a37c6aa049fffd85d9aefbe2660fea80c 100644 (file)
@@ -549,6 +549,10 @@ SOURCE=.\strings\strings.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\archive\tartest.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\streams\tempfile.cpp
 # End Source File
 # Begin Source File