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

Function DoPackUnpackTest

library/cpp/packers/ut/proto_packer_ut.cpp:52–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 TString Buffer;
51
52 void DoPackUnpackTest(const TTestMessage& msg) {
53 const ui32 msgByteSize = Packer.MeasureLeaf(msg);
54 Buffer.resize(msgByteSize);
55
56 Packer.PackLeaf(Buffer.begin(), msg, msgByteSize);
57
58 TTestMessage checkMsg;
59 Packer.UnpackLeaf(Buffer.begin(), checkMsg);
60
61 UNIT_ASSERT_EQUAL(msg, checkMsg);
62 }
63
64 Y_UNIT_TEST(TestPackUnpackOnlyRequired) {
65 TTestMessage msg;

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 5

MeasureLeafMethod · 0.45
resizeMethod · 0.45
PackLeafMethod · 0.45
beginMethod · 0.45
UnpackLeafMethod · 0.45

Tested by

no test coverage detected