mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 18:07:14 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
//
|
|
// ZipTest.h
|
|
//
|
|
// Definition of the ZipTest class.
|
|
//
|
|
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef ZipTest_INCLUDED
|
|
#define ZipTest_INCLUDED
|
|
|
|
|
|
#include "Poco/Zip/Zip.h"
|
|
#include "Poco/Zip/ZipLocalFileHeader.h"
|
|
#include "CppUnit/TestCase.h"
|
|
|
|
|
|
class ZipTest: public CppUnit::TestCase
|
|
{
|
|
public:
|
|
ZipTest(const std::string& name);
|
|
~ZipTest();
|
|
|
|
void testSkipSingleFile();
|
|
void testDecompressSingleFile();
|
|
void testDecompressSingleFileInDir();
|
|
void testDecompress();
|
|
void testDecompressFlat();
|
|
void testDecompressVuln();
|
|
void testDecompressFlatVuln();
|
|
void testCrcAndSizeAfterData();
|
|
void testCrcAndSizeAfterDataWithArchive();
|
|
void testCrcAndSizeAfterDataEncapsulated();
|
|
|
|
static const Poco::UInt64 KB = 1024;
|
|
static const Poco::UInt64 MB = 1024*KB;
|
|
void verifyDataFile(const std::string& path, Poco::UInt64 size);
|
|
void testDecompressZip64();
|
|
void testValidPath();
|
|
|
|
void setUp();
|
|
void tearDown();
|
|
|
|
static CppUnit::Test* suite();
|
|
|
|
static std::string getTestFile(const std::string& directory, const std::string& type);
|
|
|
|
private:
|
|
void onDecompressError(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>& info);
|
|
|
|
int _errCnt;
|
|
};
|
|
|
|
|
|
#endif // ZipTest_INCLUDED
|