MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/common/base/tests/FsTest.cpp:39–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37class FsTest : public testing::Test {};
38
39TEST_F(FsTest, createDirectory) {
40 auto rootPath = exec::test::TempDirectoryPath::createTempDirectory();
41 auto tmpDirectoryPath = rootPath + "/first/second/third";
42 // First time should generate directory successfully.
43 EXPECT_FALSE(fs::exists(tmpDirectoryPath.c_str()));
44 EXPECT_TRUE(generateFileDirectory(tmpDirectoryPath.c_str()));
45 EXPECT_TRUE(fs::exists(tmpDirectoryPath.c_str()));
46
47 // Directory already exist, not creating but should return success.
48 EXPECT_TRUE(generateFileDirectory(tmpDirectoryPath.c_str()));
49 EXPECT_TRUE(fs::exists(tmpDirectoryPath.c_str()));
50 boost::filesystem::remove_all(rootPath);
51 EXPECT_FALSE(fs::exists(rootPath.c_str()));
52}
53
54} // namespace bytedance::bolt::common

Callers

nothing calls this directly

Calls 1

generateFileDirectoryFunction · 0.85

Tested by

no test coverage detected