Skip to content

Commit

Permalink
test: Don't check for the exact size of compressed content.
Browse files Browse the repository at this point in the history
The testsuite checks for the exact size of the compressed content. The
exact size can change if the zlib library is using a different strategy.
In thise case using zlib-ng results in a slightly larger content leading
to a failure in the test.

Check that the compressed content is less than 10MiB which is a tenth of
the orignal content and proves that compression works.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
  • Loading branch information
sebastianas committed Nov 24, 2024
1 parent 4139949 commit aae7dcf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4258,7 +4258,7 @@ TEST_F(ServerTest, PutLargeFileWithGzip2) {
ASSERT_TRUE(res);
EXPECT_EQ(StatusCode::OK_200, res->status);
EXPECT_EQ(LARGE_DATA, res->body);
EXPECT_EQ(101942u, res.get_request_header_value_u64("Content-Length"));
EXPECT_TRUE(res.get_request_header_value_u64("Content-Length") < (10 * 1024 * 1024));
EXPECT_EQ("gzip", res.get_request_header_value("Content-Encoding"));
}

Expand Down

0 comments on commit aae7dcf

Please sign in to comment.