Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest_compression_zlib: do not assume buffer will be null terminated #8064

Merged
merged 1 commit into from Mar 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/test/compressor/test_compression_zlib.cc
Expand Up @@ -36,7 +36,9 @@ TEST(CompressionZlib, compress_decompress)
bufferlist after;
res = sp.decompress(out, after);
EXPECT_EQ(res, 0);
EXPECT_STREQ(test, after.c_str());
bufferlist exp;
exp.append(test);
EXPECT_TRUE(exp.contents_equal(after));
}

TEST(CompressionZlib, compress_decompress_chunk)
Expand All @@ -54,7 +56,9 @@ TEST(CompressionZlib, compress_decompress_chunk)
bufferlist after;
res = sp.decompress(out, after);
EXPECT_EQ(res, 0);
EXPECT_STREQ("This is test text1234567890", after.c_str());
bufferlist exp;
exp.append("This is test text1234567890");
EXPECT_TRUE(exp.contents_equal(after));
}

int main(int argc, char **argv) {
Expand Down