|
@@ -110,11 +110,11 @@ namespace
|
|
TEST_F(FileTest, canWrite_not_writable)
|
|
TEST_F(FileTest, canWrite_not_writable)
|
|
{
|
|
{
|
|
#if defined(unix) || defined(__APPLE__)
|
|
#if defined(unix) || defined(__APPLE__)
|
|
- File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
|
|
|
|
|
|
+ File noWritableFile{TestHelper::getResourcesFolderLocation() + "no-writable.txt"};
|
|
ASSERT_FALSE(noWritableFile.canWrite());
|
|
ASSERT_FALSE(noWritableFile.canWrite());
|
|
#endif
|
|
#endif
|
|
#ifdef _WIN32
|
|
#ifdef _WIN32
|
|
- File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
|
|
|
|
|
|
+ File noWritableFile{TestHelper::getResourcesFolderLocation() + "no-writable-windows.txt"};
|
|
ASSERT_FALSE(noWritableFile.canWrite());
|
|
ASSERT_FALSE(noWritableFile.canWrite());
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
@@ -226,7 +226,7 @@ namespace
|
|
File file{this->fileLocation};
|
|
File file{this->fileLocation};
|
|
ASSERT_TRUE(file.isFile());
|
|
ASSERT_TRUE(file.isFile());
|
|
|
|
|
|
- File file2{TestHelper::getResourcesFolderLocation() + "list_test" + separator + "bla.txt"};
|
|
|
|
|
|
+ File file2{TestHelper::getResourcesFolderLocation() + "list-test" + separator + "bla.txt"};
|
|
ASSERT_TRUE(file2.isFile());
|
|
ASSERT_TRUE(file2.isFile());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -244,7 +244,7 @@ namespace
|
|
|
|
|
|
TEST_F(FileTest, list)
|
|
TEST_F(FileTest, list)
|
|
{
|
|
{
|
|
- File file{TestHelper::getResourcesFolderLocation() + "list_test"};
|
|
|
|
|
|
+ File file{TestHelper::getResourcesFolderLocation() + "list-test"};
|
|
list<string> filesInDirectory = file.list();
|
|
list<string> filesInDirectory = file.list();
|
|
string expectedFile{};
|
|
string expectedFile{};
|
|
const char separator = FilePathSeparator::get();
|
|
const char separator = FilePathSeparator::get();
|
|
@@ -258,21 +258,21 @@ namespace
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "..";
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "..";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
- expectedFile = file.getAbsoluteFilePath() + separator + "another_file.txt";
|
|
|
|
|
|
+ expectedFile = file.getAbsoluteFilePath() + separator + "another-file.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
- expectedFile = file.getAbsoluteFilePath() + separator + "list_test_sub";
|
|
|
|
|
|
+ expectedFile = file.getAbsoluteFilePath() + separator + "list-test-sub";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
- expectedFile = file.getAbsoluteFilePath() + separator + ".hidden_file.txt";
|
|
|
|
|
|
+ expectedFile = file.getAbsoluteFilePath() + separator + ".hidden-file.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(FileTest, listFiles)
|
|
TEST_F(FileTest, listFiles)
|
|
{
|
|
{
|
|
- File file{TestHelper::getResourcesFolderLocation() + "list_test"};
|
|
|
|
|
|
+ File file{TestHelper::getResourcesFolderLocation() + "list-test"};
|
|
list<string> filesInDirectory = file.listFiles();
|
|
list<string> filesInDirectory = file.listFiles();
|
|
string expectedFile{};
|
|
string expectedFile{};
|
|
const char separator = FilePathSeparator::get();
|
|
const char separator = FilePathSeparator::get();
|
|
@@ -280,13 +280,13 @@ namespace
|
|
ASSERT_FALSE(filesInDirectory.empty());
|
|
ASSERT_FALSE(filesInDirectory.empty());
|
|
ASSERT_EQ(4, filesInDirectory.size());
|
|
ASSERT_EQ(4, filesInDirectory.size());
|
|
|
|
|
|
- expectedFile = file.getAbsoluteFilePath() + separator + "another_file.txt";
|
|
|
|
|
|
+ expectedFile = file.getAbsoluteFilePath() + separator + "another-file.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
|
|
expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
- expectedFile = file.getAbsoluteFilePath() + separator + ".hidden_file.txt";
|
|
|
|
|
|
+ expectedFile = file.getAbsoluteFilePath() + separator + ".hidden-file.txt";
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -304,7 +304,7 @@ namespace
|
|
|
|
|
|
TEST_F(FileTest, makeDirectory_directory_already_exists)
|
|
TEST_F(FileTest, makeDirectory_directory_already_exists)
|
|
{
|
|
{
|
|
- File directory{TestHelper::getResourcesFolderLocation() + "list_test"};
|
|
|
|
|
|
+ File directory{TestHelper::getResourcesFolderLocation() + "list-test"};
|
|
|
|
|
|
EXPECT_THROW({
|
|
EXPECT_THROW({
|
|
try
|
|
try
|
|
@@ -372,7 +372,7 @@ namespace
|
|
File file{this->fileLocation};
|
|
File file{this->fileLocation};
|
|
ASSERT_TRUE(file.exists());
|
|
ASSERT_TRUE(file.exists());
|
|
|
|
|
|
- file.reset(TestHelper::getResourcesFolderLocation() + "list_test/hello.txt");
|
|
|
|
|
|
+ file.reset(TestHelper::getResourcesFolderLocation() + "list-test/hello.txt");
|
|
ASSERT_TRUE(file.exists());
|
|
ASSERT_TRUE(file.exists());
|
|
}
|
|
}
|
|
}
|
|
}
|