Skip to content

Commit

Permalink
remove compress_zlib.decompress_fail unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Jan 31, 2025
1 parent 066397a commit 9a5b12c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions test/unit/googletest/compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ TEST(compress, not_enough) {
}

#ifdef HAVE_ZLIB
#include <sstream>
#include <zlib.h>

TEST(compress_zlib, bad) {
Expand All @@ -148,25 +147,4 @@ TEST(compress_zlib, bad) {
EXPECT_EQ(dst->yes, (std::int8_t) 0);
EXPECT_EQ(dst->len, (std::size_t) 0);
}

TEST(compress_zlib, decompress_fail) {
struct {
compressed_t comp;
int data; // not enough data to decompress
} small;

memset(&small, 0, sizeof(small)); // no data to decompress
small.comp.yes = 1;
small.comp.len = sizeof(small);
small.comp.orig_len = sizeof(small);

std::stringstream s;
s << "BUG: uncompress\\(\\) failed: rc = " << Z_DATA_ERROR;

void *dst = nullptr;
EXPECT_EXIT(decompress_struct(&dst, &small),
::testing::ExitedWithCode(EXIT_FAILURE),
s.str());

}
#endif

0 comments on commit 9a5b12c

Please sign in to comment.