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

Function TryReadDataFile

cpp/src/parquet/arrow/arrow_reader_writer_test.cc:4452–4475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4450}
4451
4452void TryReadDataFile(const std::string& path,
4453 ::arrow::StatusCode expected_code = ::arrow::StatusCode::OK,
4454 const std::string& expected_message = "") {
4455 auto pool = ::arrow::default_memory_pool();
4456
4457 Status s;
4458 auto reader_result = FileReader::Make(pool, ParquetFileReader::OpenFile(path, false));
4459 if (reader_result.ok()) {
4460 auto table_result = (*reader_result)->ReadTable();
4461 s = table_result.status();
4462 } else {
4463 s = reader_result.status();
4464 }
4465
4466 ASSERT_EQ(s.code(), expected_code)
4467 << "Expected reading file to return " << arrow::Status::CodeAsString(expected_code)
4468 << ", but got " << s.ToString();
4469
4470 if (!expected_message.empty()) {
4471 ASSERT_EQ(s.message().find(expected_message), 0)
4472 << "Expected an error message beginning with '" << expected_message
4473 << "', but got '" << s.message() << "'";
4474 }
4475}
4476
4477TEST(TestArrowReaderAdHoc, Int96BadMemoryAccess) {
4478 // PARQUET-995

Callers 1

TESTFunction · 0.85

Calls 10

default_memory_poolFunction · 0.85
OpenFileFunction · 0.85
MakeFunction · 0.50
okMethod · 0.45
ReadTableMethod · 0.45
statusMethod · 0.45
codeMethod · 0.45
ToStringMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected