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

Method TestRead

library/cpp/archive/yarchive_ut.cpp:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void TArchiveTest::TestRead() {
50 CreateArchive();
51 TTempFile tmpFile(ARCHIVE);
52 TBlob blob = TBlob::FromFileSingleThreaded(ARCHIVE);
53 TArchiveReader r(blob);
54
55 UNIT_ASSERT_EQUAL(r.Count(), 1000);
56
57 for (size_t i = 0; i < 1000; ++i) {
58 const TString key = "/" + ToString(i);
59 TAutoPtr<IInputStream> is = r.ObjectByKey(key);
60 const TString data = is->ReadAll();
61
62 UNIT_ASSERT_EQUAL(data, "data" + ToString(i * 1000) + "dataend");
63 }
64}
65
66void TArchiveTest::TestOffsetOrder() {
67 CreateArchive();

Callers

nothing calls this directly

Calls 4

ReadAllMethod · 0.80
ToStringFunction · 0.50
CountMethod · 0.45
ObjectByKeyMethod · 0.45

Tested by

no test coverage detected