| 1177 | } |
| 1178 | |
| 1179 | void 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 | |
| 1197 | void GenericFileSystemTest::TestOpenInputFileWithFileInfo(FileSystem* fs) { |
| 1198 | ASSERT_OK(fs->CreateDir("AB")); |
nothing calls this directly
no test coverage detected