MCPcopy Create free account
hub / github.com/google/snappy / VerifyString

Function VerifyString

snappy_unittest.cc:108–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106#endif
107
108int 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
124void VerifyStringSink(const std::string& input) {
125 std::string compressed;

Callers 1

VerifyFunction · 0.85

Calls 6

MaxCompressedLengthFunction · 0.85
IsValidCompressedBufferFunction · 0.85
dataMethod · 0.80
sizeMethod · 0.80
CompressFunction · 0.70
UncompressFunction · 0.70

Tested by

no test coverage detected