MCPcopy Create free account
hub / github.com/apache/brpc / TEST_F

Function TEST_F

test/brpc_snappy_compress_unittest.cpp:80–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78class test_compress_method : public testing::Test {};
79
80TEST_F(test_compress_method, snappy) {
81 snappy_message::SnappyMessageProto old_msg;
82 old_msg.set_text("Hello World!");
83 old_msg.add_numbers(2);
84 old_msg.add_numbers(7);
85 old_msg.add_numbers(45);
86 butil::IOBuf buf;
87 ASSERT_TRUE(brpc::policy::SnappyCompress(old_msg, &buf));
88 snappy_message::SnappyMessageProto new_msg;
89 ASSERT_TRUE(brpc::policy::SnappyDecompress(buf, &new_msg));
90 ASSERT_TRUE(strcmp(new_msg.text().c_str(), "Hello World!") == 0);
91 ASSERT_TRUE(new_msg.numbers_size() == 3);
92 ASSERT_EQ(new_msg.numbers(0), 2);
93 ASSERT_EQ(new_msg.numbers(1), 7);
94 ASSERT_EQ(new_msg.numbers(2), 45);
95}
96
97TEST_F(test_compress_method, snappy_iobuf) {
98 butil::IOBuf buf, output_buf, check_buf;

Callers

nothing calls this directly

Calls 12

SnappyCompressFunction · 0.85
SnappyDecompressFunction · 0.85
ProfilerStartFunction · 0.85
ProfilerStopFunction · 0.85
CompressFunction · 0.85
CompressMessageFunction · 0.85
SnappyDecompressIOBufFunction · 0.85
c_strMethod · 0.45
appendMethod · 0.45
to_stringMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected