Add test for invalid deflate stream settings

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2019-07-29 20:24:33 +02:00
committed by Vinnie Falco
parent 84bf4c5362
commit 4be185eb2b

View File

@@ -302,6 +302,28 @@ public:
doMatrix(corpus1(1024), &self::doDeflate1_beast); doMatrix(corpus1(1024), &self::doDeflate1_beast);
} }
void testInvalidSettings()
{
except<std::invalid_argument>(
[]()
{
deflate_stream ds;
ds.reset(-42, 15, 8, Strategy::normal);
});
except<std::invalid_argument>(
[]()
{
deflate_stream ds;
ds.reset(compression::default_size, -1, 8, Strategy::normal);
});
except<std::invalid_argument>(
[]()
{
deflate_stream ds;
ds.reset(compression::default_size, 15, -1, Strategy::normal);
});
}
void void
run() override run() override
{ {
@@ -310,6 +332,7 @@ public:
sizeof(deflate_stream) << std::endl; sizeof(deflate_stream) << std::endl;
testDeflate(); testDeflate();
testInvalidSettings();
} }
}; };