mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Add test for invalid deflate stream settings
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
84bf4c5362
commit
4be185eb2b
@@ -302,6 +302,28 @@ public:
|
||||
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
|
||||
run() override
|
||||
{
|
||||
@@ -310,6 +332,7 @@ public:
|
||||
sizeof(deflate_stream) << std::endl;
|
||||
|
||||
testDeflate();
|
||||
testInvalidSettings();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user