MCPcopy Create free account
hub / github.com/apache/arrow / AssertChunking

Function AssertChunking

cpp/src/arrow/json/chunker_test.cc:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void AssertChunking(Chunker& chunker, std::shared_ptr<Buffer> buf, int total_count) {
106 // First chunkize whole JSON block
107 AssertWholeObjects(chunker, buf, total_count);
108
109 // Then chunkize incomplete substrings of the block
110 for (int i = 0; i < total_count; ++i) {
111 // ensure shearing the closing brace off the last object causes it to be chunked out
112 auto last_brace = string_view(*buf).find_last_of('}');
113 AssertWholeObjects(chunker, SliceBuffer(buf, 0, last_brace), total_count - i - 1);
114
115 // ensure skipping one object reduces the count by one
116 ASSERT_NE(ConsumeWholeObject(&buf), string_view::npos);
117 AssertWholeObjects(chunker, buf, total_count - i - 1);
118 }
119}
120
121void AssertChunkingBlockSize(Chunker& chunker, std::shared_ptr<Buffer> buf,
122 int64_t block_size, int expected_count) {

Callers 3

AssertStraddledChunkingFunction · 0.70
TEST_PFunction · 0.70
TESTFunction · 0.70

Calls 3

AssertWholeObjectsFunction · 0.85
SliceBufferFunction · 0.85
ConsumeWholeObjectFunction · 0.70

Tested by

no test coverage detected