This commit is contained in:
Günter Obiltschnig 2020-01-10 13:46:28 +01:00
parent 3b283627ee
commit aa68d8e976
2 changed files with 12 additions and 11 deletions

View File

@ -156,7 +156,8 @@ void CompressTest::createDataFile(const std::string& path, Poco::UInt64 size)
void CompressTest::testZip64()
{
typedef std::map<std::string, Poco::UInt64> FileMap;
using FileMap = std::map<std::string, Poco::UInt64>;
std::cout << std::endl;
FileMap files;
files["data1.bin"] = static_cast<Poco::UInt64>(KB)*4096+1;

View File

@ -131,9 +131,9 @@ void ZipTest::testCrcAndSizeAfterData()
Poco::FileInputStream inp(testFile);
assertTrue (inp.good());
Decompress dec(inp, Poco::Path::temp());
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
dec.decompressAllFiles();
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
assertTrue (_errCnt == 0);
assertTrue (!dec.mapping().empty());
}
@ -192,9 +192,9 @@ void ZipTest::testDecompress()
Poco::FileInputStream inp(testFile);
assertTrue (inp.good());
Decompress dec(inp, Poco::Path::temp());
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
dec.decompressAllFiles();
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
assertTrue (_errCnt == 0);
assertTrue (!dec.mapping().empty());
}
@ -206,9 +206,9 @@ void ZipTest::testDecompressFlat()
Poco::FileInputStream inp(testFile);
assertTrue (inp.good());
Decompress dec(inp, Poco::Path::temp(), true);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
dec.decompressAllFiles();
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
assertTrue (_errCnt == 0);
assertTrue (!dec.mapping().empty());
}
@ -220,9 +220,9 @@ void ZipTest::testDecompressVuln()
Poco::FileInputStream inp(testFile);
assertTrue (inp.good());
Decompress dec(inp, Poco::Path::temp());
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
dec.decompressAllFiles();
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
assertTrue (_errCnt == 1);
assertTrue (dec.mapping().empty());
}
@ -234,9 +234,9 @@ void ZipTest::testDecompressFlatVuln()
Poco::FileInputStream inp(testFile);
assertTrue (inp.good());
Decompress dec(inp, Poco::Path::temp(), true);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError += Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
dec.decompressAllFiles();
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> >(this, &ZipTest::onDecompressError);
dec.EError -= Poco::Delegate<ZipTest, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>>(this, &ZipTest::onDecompressError);
assertTrue (_errCnt == 0);
assertTrue (!dec.mapping().empty());
}