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

Function TryReadDataFile

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

Source from the content-addressed store, hash-verified

4172}
4173
4174void TryReadDataFile(const std::string& path,
4175 ::arrow::StatusCode expected_code = ::arrow::StatusCode::OK,
4176 const std::string& expected_message = "") {
4177 auto pool = ::arrow::default_memory_pool();
4178
4179 Status s;
4180 auto reader_result = FileReader::Make(pool, ParquetFileReader::OpenFile(path, false));
4181 if (reader_result.ok()) {
4182 auto table_result = (*reader_result)->ReadTable();
4183 s = table_result.status();
4184 } else {
4185 s = reader_result.status();
4186 }
4187
4188 ASSERT_EQ(s.code(), expected_code)
4189 << "Expected reading file to return " << arrow::Status::CodeAsString(expected_code)
4190 << ", but got " << s.ToString();
4191
4192 if (!expected_message.empty()) {
4193 ASSERT_EQ(s.message().find(expected_message), 0)
4194 << "Expected an error message beginning with '" << expected_message
4195 << "', but got '" << s.message() << "'";
4196 }
4197}
4198
4199TEST(TestArrowReaderAdHoc, Int96BadMemoryAccess) {
4200 // 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