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

Method TestOpenInputFileAsync

cpp/src/arrow/filesystem/test_util.cc:1179–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1177}
1178
1179void GenericFileSystemTest::TestOpenInputFileAsync(FileSystem* fs) {
1180 ASSERT_OK(fs->CreateDir("AB"));
1181 CreateFile(fs, "AB/abc", "some other data");
1182
1183 std::shared_ptr<io::RandomAccessFile> file;
1184 std::shared_ptr<Buffer> buffer;
1185 ASSERT_FINISHES_OK_AND_ASSIGN(file, fs->OpenInputFileAsync("AB/abc"));
1186 ASSERT_OK_AND_ASSIGN(buffer, file->ReadAt(5, 6));
1187 AssertBufferEqual(*buffer, "other ");
1188 ASSERT_OK(file->Close());
1189
1190 // File does not exist
1191 AssertRaisesWithErrno(ENOENT, fs->OpenInputFileAsync("AB/def").result());
1192
1193 // Trailing slash rejected
1194 ASSERT_RAISES(IOError, fs->OpenInputFileAsync("AB/abc/").result());
1195}
1196
1197void GenericFileSystemTest::TestOpenInputFileWithFileInfo(FileSystem* fs) {
1198 ASSERT_OK(fs->CreateDir("AB"));

Callers

nothing calls this directly

Calls 9

CreateFileFunction · 0.85
AssertBufferEqualFunction · 0.85
AssertRaisesWithErrnoFunction · 0.85
OpenInputFileAsyncMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
CreateDirMethod · 0.45
ReadAtMethod · 0.45
CloseMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected