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

Method Test

library/cpp/on_disk/chunks/chunks_ut.cpp:284–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282 UNIT_TEST_SUITE_END();
283
284 void Test() {
285 TBuffer buffer;
286 {
287 TBufferOutput out(buffer);
288 TChunkedDataWriter writer(out);
289 writer.NewBlock();
290 writer << "test";
291 writer.NewBlock();
292 writer << 4;
293 writer.NewBlock();
294 writer.NewBlock();
295 writer << 1;
296 writer << 2;
297 writer.WriteFooter();
298 }
299 {
300 TBlob blob = TBlob::FromBufferSingleThreaded(buffer);
301 TChunkedDataReader data(blob);
302 // printf("%d\n", (int)data.GetBlockLen(3));
303 UNIT_ASSERT_EQUAL(4, data.GetBlockLen(0));
304 UNIT_ASSERT_EQUAL(1, data.GetBlockLen(1));
305 UNIT_ASSERT_EQUAL(0, data.GetBlockLen(2));
306 UNIT_ASSERT_EQUAL(2, data.GetBlockLen(3));
307 }
308 }
309
310 void TestEmpty() {
311 TBuffer buffer;

Callers

nothing calls this directly

Calls 3

GetBlockLenMethod · 0.80
NewBlockMethod · 0.45
WriteFooterMethod · 0.45

Tested by

no test coverage detected