mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Expand deflate matrix to check for different memLevel values
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
8ee65054a6
commit
11ee655f97
@@ -147,8 +147,8 @@ public:
|
|||||||
|
|
||||||
using self = deflate_stream_test;
|
using self = deflate_stream_test;
|
||||||
typedef void(self::*pmf_t)(
|
typedef void(self::*pmf_t)(
|
||||||
int level, int windowBits, int strategy,
|
int level, int windowBits, int memLevel,
|
||||||
std::string const&);
|
int strategy, std::string const&);
|
||||||
|
|
||||||
static
|
static
|
||||||
Strategy
|
Strategy
|
||||||
@@ -167,8 +167,8 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
doDeflate1_beast(
|
doDeflate1_beast(
|
||||||
int level, int windowBits, int strategy,
|
int level, int windowBits, int memLevel,
|
||||||
std::string const& check)
|
int strategy, std::string const& check)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
z_params zs;
|
z_params zs;
|
||||||
@@ -176,7 +176,7 @@ public:
|
|||||||
ds.reset(
|
ds.reset(
|
||||||
level,
|
level,
|
||||||
windowBits,
|
windowBits,
|
||||||
8,
|
memLevel,
|
||||||
toStrategy(strategy));
|
toStrategy(strategy));
|
||||||
out.resize(ds.upper_bound(
|
out.resize(ds.upper_bound(
|
||||||
static_cast<uLong>(check.size())));
|
static_cast<uLong>(check.size())));
|
||||||
@@ -213,8 +213,8 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
doDeflate2_beast(
|
doDeflate2_beast(
|
||||||
int level, int windowBits, int strategy,
|
int level, int windowBits, int memLevel,
|
||||||
std::string const& check)
|
int strategy, std::string const& check)
|
||||||
{
|
{
|
||||||
for(std::size_t i = 1; i < check.size(); ++i)
|
for(std::size_t i = 1; i < check.size(); ++i)
|
||||||
{
|
{
|
||||||
@@ -225,7 +225,7 @@ public:
|
|||||||
ds.reset(
|
ds.reset(
|
||||||
level,
|
level,
|
||||||
windowBits,
|
windowBits,
|
||||||
8,
|
memLevel,
|
||||||
toStrategy(strategy));
|
toStrategy(strategy));
|
||||||
std::string out;
|
std::string out;
|
||||||
out.resize(ds.upper_bound(
|
out.resize(ds.upper_bound(
|
||||||
@@ -285,14 +285,20 @@ public:
|
|||||||
if(windowBits == 8)
|
if(windowBits == 8)
|
||||||
continue;
|
continue;
|
||||||
for(int strategy = 0; strategy <= 4; ++strategy)
|
for(int strategy = 0; strategy <= 4; ++strategy)
|
||||||
|
{
|
||||||
|
for (int memLevel = 8; memLevel <= 9; ++memLevel)
|
||||||
{
|
{
|
||||||
(this->*pmf)(
|
(this->*pmf)(
|
||||||
level, windowBits, strategy, check);
|
level, windowBits, memLevel, strategy, check);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check default settings
|
||||||
|
(this->*pmf)(compression::default_size, 15, 8, 0, check);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
testDeflate()
|
testDeflate()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user