MCPcopy Create free account
hub / github.com/ceph/ceph / test_encode_and_nohead_nohead

Function test_encode_and_nohead_nohead

src/test/encoding.cc:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template <typename Size, typename T>
38static void test_encode_and_nohead_nohead(Size len, const T& src)
39{
40 bufferlist bl(1000000);
41 encode(len, bl);
42 encode_nohead(src, bl);
43 T dst;
44 auto i = bl.cbegin();
45 decode(len, i);
46 decode_nohead(len, dst, i);
47 ASSERT_EQ(src, dst) << "Encoding roundtrip changed the string: orig=" << src << ", but new=" << dst;
48}
49
50TEST(EncodingRoundTrip, StringNoHead) {
51 const string str("The quick brown fox jumps over the lazy dog");

Callers 1

TESTFunction · 0.85

Calls 5

encodeFunction · 0.50
encode_noheadFunction · 0.50
decodeFunction · 0.50
decode_noheadFunction · 0.50
cbeginMethod · 0.45

Tested by

no test coverage detected