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

Method TestOpenInputStreamAsync

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

Source from the content-addressed store, hash-verified

1121}
1122
1123void GenericFileSystemTest::TestOpenInputStreamAsync(FileSystem* fs) {
1124 ASSERT_OK(fs->CreateDir("AB"));
1125 CreateFile(fs, "AB/abc", "some data");
1126
1127 std::shared_ptr<io::InputStream> stream;
1128 std::shared_ptr<Buffer> buffer;
1129 std::shared_ptr<const KeyValueMetadata> metadata;
1130 ASSERT_FINISHES_OK_AND_ASSIGN(stream, fs->OpenInputStreamAsync("AB/abc"));
1131 ASSERT_FINISHES_OK_AND_ASSIGN(metadata, stream->ReadMetadataAsync());
1132 ASSERT_OK_AND_ASSIGN(buffer, stream->Read(4));
1133 AssertBufferEqual(*buffer, "some");
1134 ASSERT_OK(stream->Close());
1135
1136 // File does not exist
1137 AssertRaisesWithErrno(ENOENT, fs->OpenInputStreamAsync("AB/def").result());
1138}
1139
1140void GenericFileSystemTest::TestOpenInputFile(FileSystem* fs) {
1141 ASSERT_OK(fs->CreateDir("AB"));

Callers

nothing calls this directly

Calls 10

CreateFileFunction · 0.85
AssertBufferEqualFunction · 0.85
AssertRaisesWithErrnoFunction · 0.85
OpenInputStreamAsyncMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
CreateDirMethod · 0.45
ReadMetadataAsyncMethod · 0.45
ReadMethod · 0.45
CloseMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected