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

Function test_encode_and_decode

src/test/encoding.cc:12–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11template < typename T >
12static void test_encode_and_decode(const T& src)
13{
14 bufferlist bl(1000000);
15 encode(src, bl);
16 T dst;
17 auto i = bl.cbegin();
18 decode(dst, i);
19 ASSERT_EQ(src, dst) << "Encoding roundtrip changed the string: orig=" << src << ", but new=" << dst;
20}
21
22TEST(EncodingRoundTrip, StringSimple) {
23 string my_str("I am the very model of a modern major general");

Callers 1

TESTFunction · 0.85

Calls 3

encodeFunction · 0.50
decodeFunction · 0.50
cbeginMethod · 0.45

Tested by

no test coverage detected