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

Function TEST_F

cpp/src/arrow/filesystem/hdfs_test.cc:204–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202 }
203
204TEST_F(TestHadoopFileSystem, CreateDirDeleteDir) {
205 SKIP_IF_NO_DRIVER();
206
207 // recursive = true
208 ASSERT_OK(this->fs_->CreateDir("AB/CD"));
209 CreateFile(this->fs_.get(), "AB/CD/data", "some data");
210 AssertFileInfo(this->fs_.get(), "AB", FileType::Directory);
211 AssertFileInfo(this->fs_.get(), "AB/CD", FileType::Directory);
212 AssertFileInfo(this->fs_.get(), "AB/CD/data", FileType::File, 9);
213
214 ASSERT_OK(this->fs_->DeleteDir("AB"));
215 AssertFileInfo(this->fs_.get(), "AB", FileType::NotFound);
216
217 // recursive = false
218 ASSERT_RAISES(IOError, this->fs_->CreateDir("AB/CD", /*recursive=*/false));
219 ASSERT_OK(this->fs_->CreateDir("AB", /*recursive=*/false));
220 ASSERT_OK(this->fs_->CreateDir("AB/CD", /*recursive=*/false));
221
222 ASSERT_OK(this->fs_->DeleteDir("AB"));
223 AssertFileInfo(this->fs_.get(), "AB", FileType::NotFound);
224
225 auto st = this->fs_->DeleteDir("AB");
226 ASSERT_RAISES(IOError, st);
227 ASSERT_EQ(ErrnoFromStatus(st), ENOENT);
228}
229
230TEST_F(TestHadoopFileSystem, DeleteDirContents) {
231 SKIP_IF_NO_DRIVER();

Callers

nothing calls this directly

Calls 15

CreateFileFunction · 0.85
AssertFileInfoFunction · 0.85
TestFileSystemFromUriMethod · 0.80
ErrnoFromStatusFunction · 0.70
ASSERT_OK_AND_ASSIGNFunction · 0.70
CreateDirMethod · 0.45
getMethod · 0.45
DeleteDirMethod · 0.45
DeleteDirContentsMethod · 0.45
OpenOutputStreamMethod · 0.45
sizeMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected