ソースを参照

Rename resource files

Patrick-Christopher Mattulat 2 年 前
コミット
8f763a65c8

+ 2 - 2
test/cases/io/FileOutputStreamTest.cpp

@@ -97,10 +97,10 @@ namespace
   TEST_F(FileOutputStreamTest, write_no_permission_to_write)
   {
     #if defined(unix) || defined(__APPLE__)
-    File file{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "no-writable.txt"};
     #endif
     #ifdef _WIN32
-    File file{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "no-writable-windows.txt"};
     #endif
 
     FileOutputStream outputStream{file};

+ 1 - 1
test/cases/io/FileReaderTest.cpp

@@ -90,7 +90,7 @@ namespace
     byte_field content = reader.read();
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
 
-    File anotherFile{TestHelper::getResourcesFolderLocation() + "list_test/bla.txt"};
+    File anotherFile{TestHelper::getResourcesFolderLocation() + "list-test/bla.txt"};
     reader.reset(anotherFile);
     expectedUnix = "nothing to say!" + NewLine::getUnixNewLine();
     expectedWindows = "nothing to say!" + NewLine::getWindowsNewLine();

+ 12 - 12
test/cases/io/FileTest.cpp

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

+ 1 - 1
test/cases/io/StorableFileTest.cpp

@@ -64,7 +64,7 @@ namespace
 
     // reset
 
-    string anotherFileLocation = TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
+    string anotherFileLocation = TestHelper::getResourcesFolderLocation() + "list-test/bla.txt";
     storableFile.reset(anotherFileLocation);
     content = storableFile.load();
 

+ 2 - 2
test/cases/io/kv/KvFileReaderTest.cpp

@@ -34,7 +34,7 @@ namespace
 
       static shared_ptr<KvFileReader> createTestKVFileReader()
       {
-        string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+        string kvPath = TestHelper::getResourcesFolderLocation() + "server-settings.kv";
         shared_ptr<KvDocument> document = make_shared<KvDocument>();
 
         return make_shared<KvFileReader>(document, kvPath);
@@ -46,7 +46,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+                     string kvPath = TestHelper::getResourcesFolderLocation() + "server-settings.kv";
                      KvFileReader reader = KvFileReader(nullptr, kvPath);
                    }
                    catch (const IllegalArgumentException &_exception)

+ 1 - 1
test/cases/io/xml/XmlParserTest.cpp

@@ -29,7 +29,7 @@ namespace
 
       static byte_field readXmlStateMachine()
       {
-        string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+        string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
         File file{xmlPath};
         byte_field data = FileReader{file}.read();
 

+ 6 - 6
test/cases/io/xml/XmlReaderTest.cpp

@@ -35,7 +35,7 @@ namespace
 
   TEST_F(XmlReaderTest, read)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(!xmlReader.read().empty());
@@ -43,7 +43,7 @@ namespace
 
   TEST_F(XmlReaderTest, getDocument)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(xmlReader.getDocument() != nullptr);
@@ -51,7 +51,7 @@ namespace
 
   TEST_F(XmlReaderTest, setDocument)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
     XmlReader xmlReader{document, xmlPath};
     ASSERT_TRUE(xmlReader.getDocument() == document);
@@ -63,7 +63,7 @@ namespace
 
   TEST_F(XmlReaderTest, setDocument_no_reference)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
     XmlReader xmlReader{document, xmlPath};
 
@@ -81,7 +81,7 @@ namespace
 
   TEST_F(XmlReaderTest, setFile)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
     File xmlFile{xmlPath};
     xmlReader.setFile(xmlFile);
@@ -91,7 +91,7 @@ namespace
 
   TEST_F(XmlReaderTest, setFile_does_not_exist)
   {
-    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state-machine-test.xml";
     XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
     File xmlFile{xmlPath};
 

+ 0 - 0
test/resources/list_test/.hidden_file.txt → test/resources/list-test/.hidden-file.txt


+ 0 - 0
test/resources/list_test/another_file.txt → test/resources/list-test/another-file.txt


+ 0 - 0
test/resources/list_test/bla.txt → test/resources/list-test/bla.txt


+ 0 - 0
test/resources/list_test/hello.txt → test/resources/list-test/hello.txt


+ 0 - 0
test/resources/list_test/list_test_sub/tmp.txt → test/resources/list-test/list-test-sub/tmp.txt


+ 0 - 0
test/resources/no_writable.txt → test/resources/no-writable-windows.txt


+ 1 - 0
test/resources/no-writable.txt

@@ -0,0 +1 @@
+something

+ 0 - 1
test/resources/no_writable_windows.txt

@@ -1 +0,0 @@
-Hello!

+ 0 - 0
test/resources/server_settings.kv → test/resources/server-settings.kv


+ 0 - 0
test/resources/state_machine_test.xml → test/resources/state-machine-test.xml


+ 0 - 1
test/resources/state_machine_test.json

@@ -1 +0,0 @@
-{"currentState":"A","memory":["A","B","C"],"name":"test_machine","states":{"A":{"connectedStates":{"AB":{"condition":false,"connectionId":"AB","stateId":"B"}},"id":"A"},"B":{"connectedStates":{"BC":{"condition":false,"connectionId":"BC","stateId":"C"},"BD":{"condition":false,"connectionId":"BD","stateId":"D"}},"id":"B"},"C":{"connectedStates":{"CB":{"condition":false,"connectionId":"CB","stateId":"B"},"CE":{"condition":false,"connectionId":"CE","stateId":"E"}},"id":"C"},"D":{"connectedStates":{"DE":{"condition":false,"connectionId":"DE","stateId":"E"}},"id":"D"},"E":{"id":"E"}}}