Zipios++
zipfiletest.h
1#ifndef ZIPIOS_ZIPFILETEST_H
2#define ZIPIOS_ZIPFILETEST_H
3
4#include <string>
5#include <vector>
6
7#include <cppunit/TestCase.h>
8#include <cppunit/TestSuite.h>
9#include <cppunit/TestAssert.h>
10#include <cppunit/extensions/HelperMacros.h>
11
13
14namespace zipios {
15
16 using std::string;
17 using std::vector;
18 using std::istream;
19
20 class ZipFileTest : public CppUnit::TestCase {
21 public:
22 CPPUNIT_TEST_SUITE(ZipFileTest);
23 CPPUNIT_TEST(testUnzip);
24 CPPUNIT_TEST(testZipUnzip);
25 CPPUNIT_TEST(testComment);
26 CPPUNIT_TEST(testClone);
27 CPPUNIT_TEST_SUITE_END();
28
29 void testUnzip();
30 void testZipUnzip();
31 void testComment();
32 void testClone();
33
34 private:
35 static void writeZipFile(const string &zipFileName,
36 vector<string> entryFileNames);
37 static void compareZipFile(const string &zipFileName,
38 vector<string> entryFileNames);
39 static void writeFileToZipOutputStream(ZipOutputStream &zos,
40 const string &filename );
41 static void compareStreams(const std::string& entryName,
42 istream &is1, istream &is2);
43 };
44
45} // zipios
46
47#endif
ZipOutputStream is an ostream that writes the output to a zip file.
Header file that defines ZipOutputStream.