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

Function TEST_F

cpp/src/arrow/array/array_binary_test.cc:824–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822};
823
824TEST_F(TestChunkedBinaryBuilder, BasicOperation) {
825 const int32_t chunksize = 1000;
826 Init(chunksize);
827
828 const int elem_size = 10;
829 uint8_t buf[elem_size];
830
831 BinaryBuilder unchunked_builder;
832
833 const int iterations = 1000;
834 for (int i = 0; i < iterations; ++i) {
835 random_bytes(elem_size, i, buf);
836
837 ASSERT_OK(unchunked_builder.Append(buf, elem_size));
838 ASSERT_OK(builder_->Append(buf, elem_size));
839 }
840
841 std::shared_ptr<Array> unchunked;
842 ASSERT_OK(unchunked_builder.Finish(&unchunked));
843
844 ArrayVector chunks;
845 ASSERT_OK(builder_->Finish(&chunks));
846
847 // This assumes that everything is evenly divisible
848 ArrayVector expected_chunks;
849 const int elems_per_chunk = chunksize / elem_size;
850 for (int i = 0; i < iterations / elems_per_chunk; ++i) {
851 expected_chunks.emplace_back(unchunked->Slice(i * elems_per_chunk, elems_per_chunk));
852 }
853
854 ASSERT_EQ(expected_chunks.size(), chunks.size());
855 for (size_t i = 0; i < chunks.size(); ++i) {
856 AssertArraysEqual(*expected_chunks[i], *chunks[i]);
857 }
858}
859
860TEST_F(TestChunkedBinaryBuilder, Reserve) {
861 // ARROW-6060

Callers

nothing calls this directly

Calls 13

AssertArraysEqualFunction · 0.85
default_memory_poolFunction · 0.85
emplace_backMethod · 0.80
random_bytesFunction · 0.50
AppendMethod · 0.45
FinishMethod · 0.45
SliceMethod · 0.45
sizeMethod · 0.45
ReserveMethod · 0.45
bytes_allocatedMethod · 0.45
lengthMethod · 0.45
GetViewMethod · 0.45

Tested by

no test coverage detected