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

Function TEST

library/cpp/yt/memory/unittests/chunked_memory_pool_output_ut.cpp:11–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9////////////////////////////////////////////////////////////////////////////////
10
11TEST(TChunkedMemoryPoolOutputTest, Basic)
12{
13 constexpr size_t PoolChunkSize = 10;
14 constexpr size_t PoolOutputChunkSize = 7;
15 TChunkedMemoryPool pool(NullRefCountedTypeCookie, PoolChunkSize);
16 TChunkedMemoryPoolOutput output(&pool, PoolOutputChunkSize);
17
18 TString s1("Short.");
19 output.Write(s1);
20
21 TString s2("Quite a long string.");
22 output.Write(s2);
23
24 char* buf;
25 auto len = output.Next(&buf);
26 output.Undo(len);
27
28 auto chunks = output.Finish();
29 TString s;
30 for (auto chunk : chunks) {
31 s += TString(chunk.Begin(), chunk.End());
32 }
33 ASSERT_EQ(s1 + s2, s);
34}
35
36////////////////////////////////////////////////////////////////////////////////
37

Callers

nothing calls this directly

Calls 6

WriteMethod · 0.45
NextMethod · 0.45
UndoMethod · 0.45
FinishMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected