2021-03-03 23:17:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-03 23:17:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibCompress/Gzip.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2022-04-01 17:58:27 +00:00
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
2021-03-03 23:17:34 +00:00
|
|
|
{
|
2023-11-03 17:49:54 +00:00
|
|
|
AK::set_debug_enabled(false);
|
2023-09-26 18:04:37 +00:00
|
|
|
auto input = ReadonlyBytes { data, size };
|
|
|
|
|
|
|
|
auto compressed = MUST(Compress::GzipCompressor::compress_all(input));
|
|
|
|
auto decompressed = MUST(Compress::GzipDecompressor::decompress_all(compressed));
|
|
|
|
|
|
|
|
VERIFY(decompressed == input);
|
|
|
|
|
2022-12-05 01:08:04 +00:00
|
|
|
return 0;
|
2021-03-03 23:17:34 +00:00
|
|
|
}
|