forked from boostorg/beast
Refactor zlib tests and fix typo:
close #1744 * Fixed typo in enum name * Added missing zlib error enumerator * Marked caveat in zlib impl to avoid future confusion * Created Compressor/Decompressor abstractions in Beast.zlib tests * Applied abstractions on Beast.zlib tests * Workaround Travis-CI' 10min silence timeout * Add test for Beast.zlib's need_dict error * Avoid breaking user-code dependant on deprecated enumerator interface Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
This commit is contained in:
@@ -399,7 +399,7 @@ doWrite(z_params& zs, boost::optional<Flush> flush, error_code& ec)
|
||||
}
|
||||
}
|
||||
else if(zs.avail_in == 0 && (
|
||||
old_flush && flush <= *old_flush
|
||||
old_flush && flush <= *old_flush // Caution: depends on enum order
|
||||
) && flush != Flush::finish)
|
||||
{
|
||||
/* Make sure there is something to do and avoid duplicate consecutive
|
||||
|
||||
@@ -66,6 +66,17 @@ enum class error
|
||||
*/
|
||||
end_of_stream,
|
||||
|
||||
/** Preset dictionary required
|
||||
|
||||
This error indicates that a preset dictionary was not provided and is now
|
||||
needed at this point.
|
||||
|
||||
This does not always indicate a failure condition.
|
||||
|
||||
@note This is the same as `Z_NEED_DICT` returned by ZLib.
|
||||
*/
|
||||
need_dict,
|
||||
|
||||
/** Invalid stream or parameters.
|
||||
|
||||
This error is returned when invalid parameters are passed,
|
||||
@@ -95,7 +106,10 @@ enum class error
|
||||
too_many_symbols,
|
||||
|
||||
/// Invalid code lengths
|
||||
invalid_code_lenths,
|
||||
invalid_code_lengths,
|
||||
#ifndef BOOST_BEAST_NO_DEPRECATED
|
||||
invalid_code_lenths = invalid_code_lengths,
|
||||
#endif
|
||||
|
||||
/// Invalid bit length repeat
|
||||
invalid_bit_length_repeat,
|
||||
|
||||
@@ -62,12 +62,13 @@ public:
|
||||
{
|
||||
case error::need_buffers: return "need buffers";
|
||||
case error::end_of_stream: return "unexpected end of deflate stream";
|
||||
case error::need_dict: return "need dict";
|
||||
case error::stream_error: return "stream error";
|
||||
|
||||
case error::invalid_block_type: return "invalid block type";
|
||||
case error::invalid_stored_length: return "invalid stored block length";
|
||||
case error::too_many_symbols: return "too many symbols";
|
||||
case error::invalid_code_lenths: return "invalid code lengths";
|
||||
case error::invalid_code_lengths: return "invalid code lengths";
|
||||
case error::invalid_bit_length_repeat: return "invalid bit length repeat";
|
||||
case error::missing_eob: return "missing end of block code";
|
||||
case error::invalid_literal_length: return "invalid literal/length code";
|
||||
|
||||
Reference in New Issue
Block a user