| 106 | #endif |
| 107 | |
| 108 | int VerifyString(const std::string& input) { |
| 109 | std::string compressed; |
| 110 | DataEndingAtUnreadablePage i(input); |
| 111 | const size_t written = snappy::Compress(i.data(), i.size(), &compressed); |
| 112 | CHECK_EQ(written, compressed.size()); |
| 113 | CHECK_LE(compressed.size(), |
| 114 | snappy::MaxCompressedLength(input.size())); |
| 115 | CHECK(snappy::IsValidCompressedBuffer(compressed.data(), compressed.size())); |
| 116 | |
| 117 | std::string uncompressed; |
| 118 | DataEndingAtUnreadablePage c(compressed); |
| 119 | CHECK(snappy::Uncompress(c.data(), c.size(), &uncompressed)); |
| 120 | CHECK_EQ(uncompressed, input); |
| 121 | return uncompressed.size(); |
| 122 | } |
| 123 | |
| 124 | void VerifyStringSink(const std::string& input) { |
| 125 | std::string compressed; |
no test coverage detected