Skip to content

Commit 1a7a7ed

Browse files
authored
test: Don't check for the exact size of compressed content. (#1984)
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]>
1 parent 4139949 commit 1a7a7ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/test.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -4258,7 +4258,9 @@ TEST_F(ServerTest, PutLargeFileWithGzip2) {
42584258
ASSERT_TRUE(res);
42594259
EXPECT_EQ(StatusCode::OK_200, res->status);
42604260
EXPECT_EQ(LARGE_DATA, res->body);
4261-
EXPECT_EQ(101942u, res.get_request_header_value_u64("Content-Length"));
4261+
// The compressed size should be less than a 10th of the original. May vary
4262+
// depending on the zlib library.
4263+
EXPECT_LT(res.get_request_header_value_u64("Content-Length"), 10 * 1024 * 1024);
42624264
EXPECT_EQ("gzip", res.get_request_header_value("Content-Encoding"));
42634265
}
42644266

0 commit comments

Comments
 (0)