| 36 | |
| 37 | template <typename Size, typename T> |
| 38 | static 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 | |
| 50 | TEST(EncodingRoundTrip, StringNoHead) { |
| 51 | const string str("The quick brown fox jumps over the lazy dog"); |
no test coverage detected