mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
porting 1.4.4 rev. 1968 (fixed SF# 3559665, etc.)
This commit is contained in:
@@ -35,7 +35,9 @@
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/InflatingStream.h"
|
||||
#include "Poco/DeflatingStream.h"
|
||||
#include "Poco/MemoryStream.h"
|
||||
#include "Poco/StreamCopier.h"
|
||||
#include "Poco/Buffer.h"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -113,6 +115,22 @@ void ZLibTest::testDeflate3()
|
||||
}
|
||||
|
||||
|
||||
void ZLibTest::testDeflate4()
|
||||
{
|
||||
Poco::Buffer<char> buffer(1024);
|
||||
Poco::MemoryOutputStream ostr(buffer.begin(), static_cast<std::streamsize>(buffer.size()));
|
||||
DeflatingOutputStream deflater(ostr, -10, Z_BEST_SPEED);
|
||||
std::string data(36828, 'x');
|
||||
deflater << data;
|
||||
deflater.close();
|
||||
Poco::MemoryInputStream istr(buffer.begin(), ostr.charsWritten());
|
||||
InflatingInputStream inflater(istr, -10);
|
||||
std::string data2;
|
||||
inflater >> data2;
|
||||
assert (data2 == data);
|
||||
}
|
||||
|
||||
|
||||
void ZLibTest::testGzip1()
|
||||
{
|
||||
std::stringstream buffer;
|
||||
@@ -196,6 +214,7 @@ CppUnit::Test* ZLibTest::suite()
|
||||
CppUnit_addTest(pSuite, ZLibTest, testDeflate1);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testDeflate2);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testDeflate3);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testDeflate4);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testGzip1);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testGzip2);
|
||||
CppUnit_addTest(pSuite, ZLibTest, testGzip3);
|
||||
|
||||
Reference in New Issue
Block a user