MCPcopy Create free account
hub / github.com/catboost/catboost / DoEncodeDecode

Function DoEncodeDecode

library/cpp/blockcodecs/fuzz/main.cpp:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static void DoEncodeDecode(const TPackUnpackCase& case_) {
52 auto* const codec = NBlockCodecs::Codec(case_.GetCodecName());
53 Y_ENSURE(codec);
54
55 TMemoryInput mi(case_.GetData().data(), case_.GetData().size());
56 TStringStream encoded;
57 TCodedOutput co(&encoded, codec, case_.GetBufferLength());
58 TransferData(&mi, &co);
59 co.Flush();
60 TStringStream decoded;
61 TDecodedInput di(&encoded, codec);
62 TransferData(&di, &decoded);
63
64 Y_ABORT_UNLESS((case_.GetData().size() > 0) == (encoded.Str().size() > 0));
65 Y_ABORT_UNLESS(case_.GetData() == decoded.Str());
66}
67
68DEFINE_BINARY_PROTO_FUZZER(const TPackUnpackCase& case_) {
69 try {

Callers 1

Calls 6

TransferDataFunction · 0.85
dataMethod · 0.45
GetDataMethod · 0.45
sizeMethod · 0.45
FlushMethod · 0.45
StrMethod · 0.45

Tested by

no test coverage detected