mirror of
https://github.com/google/snappy.git
synced 2024-11-28 05:44:33 +00:00
Fix unused variable warnings in fuzzers.
PiperOrigin-RevId: 264377331
This commit is contained in:
parent
5a57d32566
commit
6219c7787b
|
@ -43,6 +43,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||||
size_t compressed_size =
|
size_t compressed_size =
|
||||||
snappy::Compress(input.data(), input.size(), &compressed);
|
snappy::Compress(input.data(), input.size(), &compressed);
|
||||||
|
|
||||||
|
(void)compressed_size; // Variable only used in debug builds.
|
||||||
assert(compressed_size == compressed.size());
|
assert(compressed_size == compressed.size());
|
||||||
assert(compressed.size() <= snappy::MaxCompressedLength(input.size()));
|
assert(compressed.size() <= snappy::MaxCompressedLength(input.size()));
|
||||||
assert(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
|
assert(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size()));
|
||||||
|
@ -51,6 +52,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||||
bool uncompress_succeeded = snappy::Uncompress(
|
bool uncompress_succeeded = snappy::Uncompress(
|
||||||
compressed.data(), compressed.size(), &uncompressed_after_compress);
|
compressed.data(), compressed.size(), &uncompressed_after_compress);
|
||||||
|
|
||||||
|
(void)uncompress_succeeded; // Variable only used in debug builds.
|
||||||
assert(uncompress_succeeded);
|
assert(uncompress_succeeded);
|
||||||
assert(input == uncompressed_after_compress);
|
assert(input == uncompressed_after_compress);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue