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

Function AssertChunking

cpp/src/arrow/csv/chunker_test.cc:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44template <typename IntContainer>
45void AssertChunking(Chunker& chunker, const std::string& str,
46 const IntContainer& expected_lengths) {
47 uint32_t expected_chunk_size;
48
49 // First chunkize whole CSV block
50 expected_chunk_size = static_cast<uint32_t>(
51 std::accumulate(expected_lengths.begin(), expected_lengths.end(), 0ULL));
52 AssertChunkSize(chunker, str, expected_chunk_size);
53
54 // Then chunkize incomplete substrings of the block
55 expected_chunk_size = 0;
56 for (const auto length : expected_lengths) {
57 AssertChunkSize(chunker, str.substr(0, expected_chunk_size + length - 1),
58 expected_chunk_size);
59
60 expected_chunk_size += static_cast<uint32_t>(length);
61 AssertChunkSize(chunker, str.substr(0, expected_chunk_size), expected_chunk_size);
62 }
63}
64
65class BaseChunkerTest : public ::testing::TestWithParam<bool> {
66 protected:

Callers 1

TEST_PFunction · 0.70

Calls 4

AssertChunkSizeFunction · 0.85
substrMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected