mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
test-compress: Initialize byte buffer with random data
This commit is contained in:
parent
81cbb2676e
commit
eecaa3bed6
Notes:
sideshowbarker
2024-07-18 21:21:55 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/eecaa3bed65 Pull-request: https://github.com/SerenityOS/serenity/pull/5786
@ -159,7 +159,9 @@ TEST_CASE(deflate_round_trip_compress)
|
||||
|
||||
TEST_CASE(deflate_round_trip_compress_large)
|
||||
{
|
||||
auto original = ByteBuffer::create_uninitialized(Compress::DeflateCompressor::block_size * 2); // Compress a buffer larger than the maximum block size to test the sliding window mechanism
|
||||
auto size = Compress::DeflateCompressor::block_size * 2;
|
||||
auto original = ByteBuffer::create_uninitialized(size); // Compress a buffer larger than the maximum block size to test the sliding window mechanism
|
||||
fill_with_random(original.data(), size);
|
||||
// Since the different levels just change how much time is spent looking for better matches, just use fast here to reduce test time
|
||||
auto compressed = Compress::DeflateCompressor::compress_all(original, Compress::DeflateCompressor::CompressionLevel::FAST);
|
||||
EXPECT(compressed.has_value());
|
||||
|
Loading…
Reference in New Issue
Block a user