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

Function TEST_F

cpp/src/arrow/json/reader_test.cc:928–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928TEST_F(AsyncStreamingReaderTest, AsyncReentrancy) {
929 constexpr int kNumRows = 16;
930 constexpr double kIoLatency = 1e-2;
931
932 auto expected = GenerateTestCase(kNumRows);
933 parse_options_.explicit_schema = expected.schema;
934 parse_options_.unexpected_field_behavior = UnexpectedFieldBehavior::Error;
935 read_options_.block_size = expected.block_size;
936
937 std::vector<Future<std::shared_ptr<RecordBatch>>> futures(expected.num_batches + 2);
938 ASSERT_OK_AND_ASSIGN(auto reader, MakeReader(expected.json, kIoLatency));
939 EXPECT_EQ(reader->bytes_processed(), 0);
940 for (auto& future : futures) {
941 future = reader->ReadNextAsync();
942 }
943
944 ASSERT_FINISHES_OK_AND_ASSIGN(auto results, All(std::move(futures)));
945 EXPECT_EQ(reader->bytes_processed(), expected.json_size);
946 ASSERT_OK_AND_ASSIGN(auto batches, internal::UnwrapOrRaise(std::move(results)));
947 AssertBatchSequenceEquals(expected.batches, batches);
948}
949
950TEST_F(AsyncStreamingReaderTest, FuturesOutliveReader) {
951 constexpr int kNumRows = 16;

Callers

nothing calls this directly

Calls 4

bytes_processedMethod · 0.80
IOContextClass · 0.50
ReadNextAsyncMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected