Bläddra i källkod

Add "ls_std_io" header

This header file replaces the generic header file to remove unnecessary dependencies from "io" module tests.
Patrick-Christopher Mattulat 2 år sedan
förälder
incheckning
05f7bdcf5f

+ 1 - 1
.gitignore

@@ -3,4 +3,4 @@ cmake-build-debug
 cmake-build-release
 cmake-build-debug-coverage
 cmake-build-wsl_debug
-test/TestHelper.hpp
+test/classes/io/xml/TestHelper.hpp

+ 25 - 1
CMakeLists.txt

@@ -167,6 +167,8 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/FileWriterTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StandardOutputWriterTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/io/StorableFileTest.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/TestDataFactory.cpp
+            ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/TestHelper.hpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/classes/io/xml/XmlParserTestWrapper.cpp)
 
     set(TEST_FILES_LOGIC
@@ -184,7 +186,6 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/time/DateTest.cpp)
 
     set(TEST_FILES
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/TestHelper.hpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/TestDataFactory.hpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/TestDataFactory.cpp)
 endif ()
@@ -216,6 +217,15 @@ if (${LS_STD_BUILD_WITH_TESTS})
     add_executable(${MODULE_NAME_EVENT}_test ${TEST_FILES_EVENT})
 endif ()
 
+##########################################################
+# Build Tests (io)
+##########################################################
+
+if (${LS_STD_BUILD_WITH_TESTS})
+    message("${MODULE_NAME_IO}: Building tests...")
+    add_executable(${MODULE_NAME_IO}_test ${TEST_FILES_IO})
+endif ()
+
 ##########################################################
 # Build Tests
 ##########################################################
@@ -350,6 +360,20 @@ if (${LS_STD_BUILD_WITH_TESTS})
             "${MODULE_NAME_CORE}")
 endif ()
 
+##########################################################
+# Linking (io)
+##########################################################
+
+if (${LS_STD_BUILD_WITH_TESTS})
+    message("${MODULE_NAME_IO}: Linking libraries for test application...")
+    target_link_libraries(${MODULE_NAME_IO}_test
+            gtest
+            gmock
+            gtest_main
+            "${MODULE_NAME_IO}"
+            "${MODULE_NAME_CORE}")
+endif ()
+
 ##########################################################
 # Linking
 ##########################################################

+ 2 - 2
include/ls_std/core/interface/IBoxing.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-07
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
@@ -11,7 +11,7 @@
 #define LS_STD_I_BOXING_HPP
 
 #include <string>
-
+// TODO: add "interface" namespace
 namespace ls
 {
   namespace std

+ 39 - 0
include/ls_std/ls_std_io.hpp

@@ -0,0 +1,39 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2022-05-14
+ * Changed:         2022-05-14
+ *
+ * */
+
+#ifndef LS_STD_LS_STD_IO_HPP
+#define LS_STD_LS_STD_IO_HPP
+
+#include <ls_std/io/kv/KvDocument.hpp>
+#include <ls_std/io/kv/KvFileReader.hpp>
+#include <ls_std/io/kv/KvPair.hpp>
+#include <ls_std/io/kv/KvParseParameter.hpp>
+#include <ls_std/io/kv/KvParser.hpp>
+#include <ls_std/io/logging/Logger.hpp>
+#include <ls_std/io/logging/LogLevel.hpp>
+#include <ls_std/io/logging/LogLevelValue.hpp>
+#include <ls_std/io/xml/XmlAttribute.hpp>
+#include <ls_std/io/xml/XmlDeclaration.hpp>
+#include <ls_std/io/xml/XmlDocument.hpp>
+#include <ls_std/io/xml/XmlNode.hpp>
+#include <ls_std/io/xml/XmlParseMode.hpp>
+#include <ls_std/io/xml/XmlParseParameter.hpp>
+#include <ls_std/io/xml/XmlParser.hpp>
+#include <ls_std/io/xml/XmlReader.hpp>
+#include <ls_std/io/File.hpp>
+#include <ls_std/io/FileOutputStream.hpp>
+#include <ls_std/io/FilePathSeparator.hpp>
+#include <ls_std/io/FilePathSeparatorMatch.hpp>
+#include <ls_std/io/FileReader.hpp>
+#include <ls_std/io/FileWriter.hpp>
+#include <ls_std/io/NewLine.hpp>
+#include <ls_std/io/StandardOutputWriter.hpp>
+#include <ls_std/io/StorableFile.hpp>
+
+#endif

+ 0 - 35
test/TestHelper.hpp

@@ -1,35 +0,0 @@
-/*
- * Author:          Patrick-Christopher Mattulat
- * Company:         Lynar Studios
- * E-Mail:          webmaster@lynarstudios.com
- * Created:         2020-08-15
- * Changed:         2022-05-11
- *
- * */
-
-#ifndef TEST_HELPER_HPP
-#define TEST_HELPER_HPP
-
-#include <string>
-#include <ls_std/ls_std.hpp>
-
-class TestHelper
-{
-  public:
-
-    TestHelper() = default;
-    ~TestHelper() = default;
-
-    static std::string getResourcesFolderLocation()
-    {
-      return TestHelper::getTestFolderLocation() + "resources" + ls::std::io::FilePathSeparator::get();
-    }
-
-    static std::string getTestFolderLocation()
-    {
-      ls::std::io::File buildDirectory{ls::std::io::File::getWorkingDirectory()};
-      return buildDirectory.getParent() + "test" + ls::std::io::FilePathSeparator::get();
-    }
-};
-
-#endif

+ 11 - 10
test/cases/io/FileOutputStreamTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-05-11
+ * Changed:         2022-05-15
  *
  * */
 
 #include <gtest/gtest.h>
-#include <TestHelper.hpp>
-#include <ls_std/ls_std.hpp>
+#include <ls_std_io_test.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {
@@ -29,7 +30,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, constructor_file_does_not_exist)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "not_existing.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "not_existing.txt";
     ls::std::io::File file{path};
 
     EXPECT_THROW({
@@ -46,7 +47,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, write)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
     ls::std::io::File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());
@@ -62,7 +63,7 @@ namespace
 
   TEST_F(FileOutputStreamTest, write_with_another_appending_stream)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
     ls::std::io::File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());
@@ -80,9 +81,9 @@ namespace
     // validation
 
     ls::std::io::FileReader reader{file};
-    ls::std::boxing::String content{reader.read()};
+    ::std::string content{reader.read()};
 
-    ASSERT_TRUE(content.contains("Hello! How are you? I'm fine! Thank you!"));
+    ASSERT_TRUE(content.find("Hello! How are you? I'm fine! Thank you!") != ::std::string::npos);
 
     file.remove();
     ASSERT_FALSE(file.exists());
@@ -91,10 +92,10 @@ namespace
   TEST_F(FileOutputStreamTest, write_no_permission_to_write)
   {
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
     #endif
     #ifdef _WIN32
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
     #endif
 
     ls::std::io::FileOutputStream outputStream{file};

+ 9 - 8
test/cases/io/FileReaderTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <TestHelper.hpp>
-#include <ls_std/ls_std.hpp>
+#include <ls_std_io_test.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {
@@ -29,7 +30,7 @@ namespace
 
   TEST_F(FileReaderTest, constructor_file_does_not_exist)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "does_not_exist.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "does_not_exist.txt"};
 
     EXPECT_THROW({
                    try
@@ -45,7 +46,7 @@ namespace
 
   TEST_F(FileReaderTest, read)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "simple.txt"};
     ls::std::io::FileReader reader{file};
     std::string expectedUnix = "Hello!" + ls::std::io::NewLine::getUnixNewLine();
     std::string expectedWindows = "Hello!" + ls::std::io::NewLine::getWindowsNewLine();
@@ -56,7 +57,7 @@ namespace
 
   TEST_F(FileReaderTest, read_file_gets_lost_in_between)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "lost_readable_file.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "lost_readable_file.txt"};
     file.createNewFile();
     ls::std::io::FileReader reader{file};
     file.remove();
@@ -75,7 +76,7 @@ namespace
 
   TEST_F(FileReaderTest, reset)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "simple.txt"};
     ls::std::io::FileReader reader{file};
     std::string expectedUnix = "Hello!" + ls::std::io::NewLine::getUnixNewLine();
     std::string expectedWindows = "Hello!" + ls::std::io::NewLine::getWindowsNewLine();
@@ -83,7 +84,7 @@ namespace
     ls::std::core::type::byte_field content = reader.read();
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
 
-    ls::std::io::File anotherFile{TestHelper::getResourcesFolderLocation() + "list_test/bla.txt"};
+    ls::std::io::File anotherFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test/bla.txt"};
     reader.reset(anotherFile);
     expectedUnix = "nothing to say!" + ls::std::io::NewLine::getUnixNewLine();
     expectedWindows = "nothing to say!" + ls::std::io::NewLine::getWindowsNewLine();

+ 32 - 31
test/cases/io/FileTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <TestHelper.hpp>
-#include <ls_std/ls_std.hpp>
+#include <ls_std_io_test.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {
@@ -20,7 +21,7 @@ namespace
       FileTest() = default;
       ~FileTest() override = default;
 
-      std::string fileLocation = TestHelper::getResourcesFolderLocation() + "simple.txt";
+      std::string fileLocation = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "simple.txt";
 
       void SetUp() override
       {}
@@ -47,7 +48,7 @@ namespace
   TEST_F(FileTest, operator_not_equals)
   {
     ls::std::io::File file{this->fileLocation};
-    ls::std::io::File file2{TestHelper::getResourcesFolderLocation() + "app.exe"};
+    ls::std::io::File file2{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
 
     ASSERT_TRUE(file != file2);
     ASSERT_TRUE(file2 != file);
@@ -58,10 +59,10 @@ namespace
   TEST_F(FileTest, canExecute)
   {
     #ifdef _WIN32
-    ls::std::io::File executableFile{TestHelper::getResourcesFolderLocation() + "app.exe"};
+    ls::std::io::File executableFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
     #endif
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File executableFile{TestHelper::getResourcesFolderLocation() + "app"};
+    ls::std::io::File executableFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "app"};
     #endif
 
     ASSERT_TRUE(executableFile.canExecute());
@@ -104,18 +105,18 @@ namespace
   TEST_F(FileTest, canWrite_not_writable)
   {
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
+    ls::std::io::File noWritableFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
     ASSERT_FALSE(noWritableFile.canWrite());
     #endif
     #ifdef _WIN32
-    ls::std::io::File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
+    ls::std::io::File noWritableFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
     ASSERT_FALSE(noWritableFile.canWrite());
     #endif
   }
 
   TEST_F(FileTest, createNewFile)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "tmp.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp.txt"};
     ASSERT_FALSE(file.exists());
 
     file.createNewFile();
@@ -127,7 +128,7 @@ namespace
 
   TEST_F(FileTest, createNewFile_file_does_already_exist)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "simple.txt"};
 
     EXPECT_THROW({
                    try
@@ -144,7 +145,7 @@ namespace
   TEST_F(FileTest, exists)
   {
     ls::std::io::File file{this->fileLocation};
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation()};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation()};
 
     ASSERT_TRUE(file.exists());
     ASSERT_TRUE(directory.exists());
@@ -152,7 +153,7 @@ namespace
 
   TEST_F(FileTest, exists_does_not_exist)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "bla.txt"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "bla.txt"};
     ASSERT_FALSE(file.exists());
   }
 
@@ -171,9 +172,9 @@ namespace
   TEST_F(FileTest, getName)
   {
     ls::std::io::File file{this->fileLocation};
-    ls::std::io::File executableFile{TestHelper::getResourcesFolderLocation() + "app.exe"};
+    ls::std::io::File executableFile{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
     ls::std::io::File anotherFile{"bla.txt"};
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation()};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation()};
 
     ASSERT_STREQ("simple.txt", file.getName().c_str());
     ASSERT_STREQ("app.exe", executableFile.getName().c_str());
@@ -184,7 +185,7 @@ namespace
   TEST_F(FileTest, getParent)
   {
     ls::std::io::File file{this->fileLocation};
-    ASSERT_STREQ(TestHelper::getResourcesFolderLocation().c_str(), file.getParent().c_str());
+    ASSERT_STREQ(ls_std_io_test::TestHelper::getResourcesFolderLocation().c_str(), file.getParent().c_str());
   }
 
   TEST_F(FileTest, getWorkingDirectory)
@@ -203,7 +204,7 @@ namespace
 
   TEST_F(FileTest, isDirectory)
   {
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation()};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation()};
     ASSERT_TRUE(directory.isDirectory());
   }
 
@@ -220,13 +221,13 @@ namespace
     ls::std::io::File file{this->fileLocation};
     ASSERT_TRUE(file.isFile());
 
-    ls::std::io::File file2{TestHelper::getResourcesFolderLocation() + "list_test" + separator + "bla.txt"};
+    ls::std::io::File file2{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test" + separator + "bla.txt"};
     ASSERT_TRUE(file2.isFile());
   }
 
   TEST_F(FileTest, isFile_is_a_directory)
   {
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation()};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation()};
     ASSERT_FALSE(directory.isFile());
   }
 
@@ -238,7 +239,7 @@ namespace
 
   TEST_F(FileTest, list)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "list_test"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test"};
     std::list<std::string> filesInDirectory = file.list();
     std::string expectedFile{};
     const char separator = ls::std::io::FilePathSeparator::get();
@@ -266,7 +267,7 @@ namespace
 
   TEST_F(FileTest, listFiles)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "list_test"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test"};
     std::list<std::string> filesInDirectory = file.listFiles();
     std::string expectedFile{};
     const char separator = ls::std::io::FilePathSeparator::get();
@@ -286,7 +287,7 @@ namespace
 
   TEST_F(FileTest, makeDirectory)
   {
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation() + "testDir"};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "testDir"};
     ASSERT_FALSE(directory.exists());
 
     directory.makeDirectory();
@@ -298,7 +299,7 @@ namespace
 
   TEST_F(FileTest, makeDirectory_directory_already_exists)
   {
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation() + "list_test"};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test"};
 
     EXPECT_THROW({
                    try
@@ -314,7 +315,7 @@ namespace
 
   TEST_F(FileTest, makeDirectories)
   {
-    ls::std::io::File directory{TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp/bla"};
+    ls::std::io::File directory{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp/bla"};
     ASSERT_FALSE(directory.exists());
 
     directory.makeDirectories();
@@ -323,17 +324,17 @@ namespace
     // clean up
 
     directory.remove();
-    directory = ls::std::io::File(TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp");
+    directory = ls::std::io::File(ls_std_io_test::TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp");
     directory.remove();
-    directory = ls::std::io::File(TestHelper::getResourcesFolderLocation() + "testDir/sub");
+    directory = ls::std::io::File(ls_std_io_test::TestHelper::getResourcesFolderLocation() + "testDir/sub");
     directory.remove();
-    directory = ls::std::io::File(TestHelper::getResourcesFolderLocation() + "testDir");
+    directory = ls::std::io::File(ls_std_io_test::TestHelper::getResourcesFolderLocation() + "testDir");
     directory.remove();
   }
 
   TEST_F(FileTest, remove)
   {
-    std::string fileName = TestHelper::getResourcesFolderLocation() + "removable_file.txt";
+    std::string fileName = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "removable_file.txt";
     ls::std::io::File file{fileName};
     file.createNewFile();
 
@@ -345,8 +346,8 @@ namespace
 
   TEST_F(FileTest, renameTo)
   {
-    std::string currentName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to.txt";
-    std::string newName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to_better_name.txt";
+    std::string currentName = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_rename_to.txt";
+    std::string newName = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_rename_to_better_name.txt";
 
     ls::std::io::File file{currentName};
     file.createNewFile();
@@ -366,7 +367,7 @@ namespace
     ls::std::io::File file{this->fileLocation};
     ASSERT_TRUE(file.exists());
 
-    file.reset(TestHelper::getResourcesFolderLocation() + "list_test/hello.txt");
+    file.reset(ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test/hello.txt");
     ASSERT_TRUE(file.exists());
   }
 }

+ 8 - 7
test/cases/io/FileWriterTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestHelper.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -29,7 +30,7 @@ namespace
 
   TEST_F(FileWriterTest, constructor_file_does_not_exist)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "not_existing_file.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "not_existing_file.txt";
     ls::std::io::File file{path};
 
     EXPECT_THROW({
@@ -46,7 +47,7 @@ namespace
 
   TEST_F(FileWriterTest, reset)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
     ls::std::io::File file{path};
     file.createNewFile();
     ls::std::io::FileWriter writer{file};
@@ -54,7 +55,7 @@ namespace
 
     // reset
 
-    path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test2.txt";
+    path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test2.txt";
     ls::std::io::File anotherFile{path};
     anotherFile.createNewFile();
 
@@ -71,7 +72,7 @@ namespace
 
   TEST_F(FileWriterTest, write)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
     ls::std::io::File file{path};
 
     ASSERT_FALSE(file.exists());

+ 3 - 2
test/cases/io/StandardOutputWriterTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2021-09-18
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

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

@@ -3,13 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <TestHelper.hpp>
-#include <ls_std/ls_std.hpp>
+#include <ls_std_io_test.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {
@@ -20,7 +20,7 @@ namespace
       StorableFileTest() = default;
       ~StorableFileTest() override = default;
 
-      std::string fileLocation = TestHelper::getResourcesFolderLocation() + "simple.txt";
+      std::string fileLocation = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "simple.txt";
 
       void SetUp() override
       {}
@@ -58,7 +58,7 @@ namespace
 
     // reset
 
-    std::string anotherFileLocation = TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
+    std::string anotherFileLocation = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
     storableFile.reset(anotherFileLocation);
     content = storableFile.load();
 
@@ -70,7 +70,7 @@ namespace
 
   TEST_F(StorableFileTest, save)
   {
-    std::string path = TestHelper::getResourcesFolderLocation() + "tmp_storable_file.txt";
+    std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "tmp_storable_file.txt";
     ls::std::io::File file{path};
     file.createNewFile();
 

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

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 6 - 5
test/cases/io/kv/KvFileReaderTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestHelper.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -28,7 +29,7 @@ namespace
 
       static std::shared_ptr<ls::std::io::KvFileReader> createTestKVFileReader()
       {
-        std::string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+        std::string kvPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "server_settings.kv";
         std::shared_ptr<ls::std::io::KvDocument> document = std::make_shared<ls::std::io::KvDocument>();
 
         return std::make_shared<ls::std::io::KvFileReader>(document, kvPath);
@@ -40,7 +41,7 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     std::string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+                     std::string kvPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "server_settings.kv";
                      ls::std::io::KvFileReader reader = ls::std::io::KvFileReader(nullptr, kvPath);
                    }
                    catch (const ls::std::core::IllegalArgumentException &_exception)

+ 3 - 2
test/cases/io/kv/KvPairTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 3 - 2
test/cases/io/kv/KvParserTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 3 - 2
test/cases/io/logging/LogLevelTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2021-05-02
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 56 - 55
test/cases/io/logging/LoggerTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-05-11
+ * Changed:         2022-05-15
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestHelper.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -28,7 +29,7 @@ namespace
 
       static std::shared_ptr<ls::std::core::IWriter> createFileLogger(const std::string &_logName)
       {
-        std::string path = TestHelper::getResourcesFolderLocation() + _logName;
+        std::string path = ls_std_io_test::TestHelper::getResourcesFolderLocation() + _logName;
         ls::std::io::File file{path};
 
         if (!file.exists())
@@ -41,11 +42,11 @@ namespace
         return writer;
       }
 
-      static ls::std::boxing::String getContentFromLogFile(const std::string &_logName)
+      static ::std::string getContentFromLogFile(const std::string &_logName)
       {
-        ls::std::io::File file{TestHelper::getResourcesFolderLocation() + _logName};
+        ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + _logName};
         ls::std::io::FileReader reader{file};
-        ls::std::boxing::String content{reader.read()};
+        ::std::string content{reader.read()};
         file.remove();
 
         return content;
@@ -85,14 +86,14 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_TRUE(content.contains("1. line!"));
-    ASSERT_TRUE(content.contains("2. line!"));
-    ASSERT_TRUE(content.contains("3. line!"));
-    ASSERT_TRUE(content.contains("4. line!"));
-    ASSERT_TRUE(content.contains("5. line!"));
-    ASSERT_FALSE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_TRUE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("6. line!") != ::std::string::npos);
   }
 
   TEST_F(LoggerTest, error)
@@ -114,14 +115,14 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_FALSE(content.contains("1. line!"));
-    ASSERT_FALSE(content.contains("2. line!"));
-    ASSERT_TRUE(content.contains("3. line!"));
-    ASSERT_TRUE(content.contains("4. line!"));
-    ASSERT_FALSE(content.contains("5. line!"));
-    ASSERT_FALSE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_FALSE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("6. line!") != ::std::string::npos);
   }
 
   TEST_F(LoggerTest, fatal)
@@ -143,14 +144,14 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_FALSE(content.contains("1. line!"));
-    ASSERT_FALSE(content.contains("2. line!"));
-    ASSERT_FALSE(content.contains("3. line!"));
-    ASSERT_TRUE(content.contains("4. line!"));
-    ASSERT_FALSE(content.contains("5. line!"));
-    ASSERT_FALSE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_FALSE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("6. line!") != ::std::string::npos);
   }
 
   TEST_F(LoggerTest, getLogLevel)
@@ -178,14 +179,14 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_TRUE(content.contains("1. line!"));
-    ASSERT_TRUE(content.contains("2. line!"));
-    ASSERT_TRUE(content.contains("3. line!"));
-    ASSERT_TRUE(content.contains("4. line!"));
-    ASSERT_FALSE(content.contains("5. line!"));
-    ASSERT_FALSE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_TRUE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("6. line!") != ::std::string::npos);
   }
 
   TEST_F(LoggerTest, setLogLevel)
@@ -215,14 +216,14 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_TRUE(content.contains("1. line!"));
-    ASSERT_TRUE(content.contains("2. line!"));
-    ASSERT_TRUE(content.contains("3. line!"));
-    ASSERT_TRUE(content.contains("4. line!"));
-    ASSERT_TRUE(content.contains("5. line!"));
-    ASSERT_TRUE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_TRUE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("6. line!") != ::std::string::npos);
   }
 
   TEST_F(LoggerTest, warn)
@@ -244,13 +245,13 @@ namespace
     // get content and check
 
     std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ls::std::boxing::String content = getContentFromLogFile(logName);
-
-    ASSERT_TRUE(content.contains("1. line!"));
-    ASSERT_TRUE(content.contains("2. line!"));
-    ASSERT_TRUE(content.contains("3. line!"));
-    ASSERT_FALSE(content.contains("4. line!"));
-    ASSERT_FALSE(content.contains("5. line!"));
-    ASSERT_FALSE(content.contains("6. line!"));
+    ::std::string content = getContentFromLogFile(logName);
+
+    ASSERT_TRUE(content.find("1. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("2. line!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("3. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("4. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("5. line!") != ::std::string::npos);
+    ASSERT_FALSE(content.find("6. line!") != ::std::string::npos);
   }
 }

+ 3 - 2
test/cases/io/xml/XmlAttributeTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 3 - 2
test/cases/io/xml/XmlDeclarationTest.cpp

@@ -3,12 +3,13 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-29
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
 
 namespace
 {

+ 6 - 5
test/cases/io/xml/XmlDocumentTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-30
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestDataFactory.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -72,7 +73,7 @@ namespace
     ASSERT_TRUE(document.getRootElement() == nullptr);
 
     ls::std::io::XmlDeclaration declaration{"1.0"};
-    document.setRootElement(ls_std_test::TestDataFactory::createXmlContent());
+    document.setRootElement(ls_std_io_test::TestDataFactory::createXmlContent());
     ASSERT_TRUE(document.getRootElement() != nullptr);
     ASSERT_STREQ("dialog", document.getRootElement()->getName().c_str());
   }
@@ -102,7 +103,7 @@ namespace
     declaration.setStandalone("yes");
     document.setDeclaration(std::make_shared<ls::std::io::XmlDeclaration>(declaration));
 
-    document.setRootElement(ls_std_test::TestDataFactory::createXmlContent());
+    document.setRootElement(ls_std_io_test::TestDataFactory::createXmlContent());
     std::string xmlStream = document.toXml();
 
     ASSERT_TRUE(!xmlStream.empty());

+ 8 - 7
test/cases/io/xml/XmlNodeTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-25
- * Changed:         2022-05-11
+ * Changed:         2022-05-15
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestDataFactory.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -892,7 +893,7 @@ namespace
 
   TEST_F(XmlNodeTest, toXml)
   {
-    auto root = ls_std_test::TestDataFactory::createXmlContent();
+    auto root = ls_std_io_test::TestDataFactory::createXmlContent();
     std::string xmlContent = root->toXml();
 
     ASSERT_TRUE(!xmlContent.empty());
@@ -905,9 +906,9 @@ namespace
     attribute->setValue("important");
     singleLineElement->addAttributeToEnd(attribute);
 
-    ls::std::boxing::String xmlContent{singleLineElement->toXml()};
-    std::string expectedXmlString = R"(<info id="important" />)";
+    ::std::string xmlContent{singleLineElement->toXml()};
+    ::std::string expectedXmlString = R"(<info id="important" />)";
 
-    ASSERT_TRUE(xmlContent.contains(expectedXmlString));
+    ASSERT_TRUE(xmlContent.find(expectedXmlString) != ::std::string::npos);
   }
 }

+ 7 - 6
test/cases/io/xml/XmlParserTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestHelper.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -22,7 +23,7 @@ namespace
 
       static ls::std::core::type::byte_field readXmlStateMachine()
       {
-        std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+        std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
         ls::std::io::File file{xmlPath};
         ls::std::core::type::byte_field data = ls::std::io::FileReader{file}.read();
 
@@ -221,7 +222,7 @@ namespace
 
   TEST_F(XmlParserTest, getDocument)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     ls::std::io::XmlParser xmlParser{std::make_shared<ls::std::io::XmlDocument>()};
 
     ASSERT_TRUE(xmlParser.getDocument() != nullptr);
@@ -229,7 +230,7 @@ namespace
 
   TEST_F(XmlParserTest, setDocument)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     std::shared_ptr<ls::std::io::XmlDocument> document = std::make_shared<ls::std::io::XmlDocument>();
     ls::std::io::XmlParser xmlParser{document};
     ASSERT_TRUE(xmlParser.getDocument() == document);

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

@@ -3,12 +3,12 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2021-05-11
+ * Changed:         2021-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std_test.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -28,11 +28,11 @@ namespace
 
   TEST_F(XmlParserTestWrapperTest, readAttribute)
   {
-    std::pair<std::string, std::string> attribute = ls_std_test::XmlParserTestWrapper::readAttribute(R"(name="tim")");
+    std::pair<std::string, std::string> attribute = ls_std_io_test::XmlParserTestWrapper::readAttribute(R"(name="tim")");
     ASSERT_TRUE(attribute.first == "name");
     ASSERT_TRUE(attribute.second == "tim");
 
-    attribute = ls_std_test::XmlParserTestWrapper::readAttribute(R"(id="dialog_001")");
+    attribute = ls_std_io_test::XmlParserTestWrapper::readAttribute(R"(id="dialog_001")");
     ASSERT_TRUE(attribute.first == "id");
     ASSERT_TRUE(attribute.second == "dialog_001");
   }
@@ -42,7 +42,7 @@ namespace
     // first case
 
     std::string tag = R"(<?xml version="1.0" encoding="UTF-8" ?>)";
-    std::list<std::pair<std::string, std::string>> attributes = ls_std_test::XmlParserTestWrapper::readAttributes(tag);
+    std::list<std::pair<std::string, std::string>> attributes = ls_std_io_test::XmlParserTestWrapper::readAttributes(tag);
 
     ASSERT_EQ(2, attributes.size());
 
@@ -57,7 +57,7 @@ namespace
     // second case
 
     tag = R"(<stateMachine name="test_machine">)";
-    attributes = ls_std_test::XmlParserTestWrapper::readAttributes(tag);
+    attributes = ls_std_io_test::XmlParserTestWrapper::readAttributes(tag);
 
     ASSERT_EQ(1, attributes.size());
 

+ 10 - 9
test/cases/io/xml/XmlReaderTest.cpp

@@ -3,13 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-10
- * Changed:         2022-05-11
+ * Changed:         2022-05-14
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std.hpp>
-#include <TestHelper.hpp>
+#include <ls_std/ls_std_core.hpp>
+#include <ls_std/ls_std_io.hpp>
+#include <ls_std_io_test.hpp>
 
 namespace
 {
@@ -29,7 +30,7 @@ namespace
 
   TEST_F(XmlReaderTest, read)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     ls::std::io::XmlReader xmlReader{std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(!xmlReader.read().empty());
@@ -37,7 +38,7 @@ namespace
 
   TEST_F(XmlReaderTest, getDocument)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     ls::std::io::XmlReader xmlReader{std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(xmlReader.getDocument() != nullptr);
@@ -45,7 +46,7 @@ namespace
 
   TEST_F(XmlReaderTest, setDocument)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     std::shared_ptr<ls::std::io::XmlDocument> document = std::make_shared<ls::std::io::XmlDocument>();
     ls::std::io::XmlReader xmlReader{document, xmlPath};
     ASSERT_TRUE(xmlReader.getDocument() == document);
@@ -57,7 +58,7 @@ namespace
 
   TEST_F(XmlReaderTest, setDocument_no_reference)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     std::shared_ptr<ls::std::io::XmlDocument> document = std::make_shared<ls::std::io::XmlDocument>();
     ls::std::io::XmlReader xmlReader{document, xmlPath};
 
@@ -75,7 +76,7 @@ namespace
 
   TEST_F(XmlReaderTest, setFile)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     ls::std::io::XmlReader xmlReader{std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
     ls::std::io::File xmlFile{xmlPath};
     xmlReader.setFile(xmlFile);
@@ -85,7 +86,7 @@ namespace
 
   TEST_F(XmlReaderTest, setFile_does_not_exist)
   {
-    std::string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    std::string xmlPath = ls_std_io_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
     ls::std::io::XmlReader xmlReader{std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
     ls::std::io::File xmlFile{xmlPath};
 

+ 4 - 4
test/cases/logic/serialization/SerializableJsonStateMachineTest.cpp

@@ -3,14 +3,14 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-17
- * Changed:         2022-05-11
+ * Changed:         2022-05-15
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std.hpp>
 #include <TestDataFactory.hpp>
-#include <TestHelper.hpp>
+#include "classes/io/xml/TestHelper.hpp"
 
 namespace
 {
@@ -54,7 +54,7 @@ namespace
     std::string jsonString = serializable.marshal();
     ASSERT_TRUE(!jsonString.empty());
 
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "/state_machine_test.json"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "/state_machine_test.json"};
     ls::std::io::FileReader reader{file};
     ls::std::boxing::String data{reader.read()};
 
@@ -63,7 +63,7 @@ namespace
 
   TEST_F(SerializableJsonStateMachineTest, unmarshal)
   {
-    ls::std::io::File file{TestHelper::getResourcesFolderLocation() + "/state_machine_test.json"};
+    ls::std::io::File file{ls_std_io_test::TestHelper::getResourcesFolderLocation() + "/state_machine_test.json"};
     ls::std::io::FileReader reader{file};
     std::shared_ptr<ls::std::logic::StateMachine> machine = std::make_shared<ls::std::logic::StateMachine>("bla");
     ls::std::logic::SerializableJsonStateMachine serializable{machine};

+ 42 - 0
test/classes/io/xml/TestDataFactory.cpp

@@ -0,0 +1,42 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2022-05-14
+ * Changed:         2022-05-14
+ *
+ * */
+
+#include "TestDataFactory.hpp"
+
+std::shared_ptr<ls::std::io::XmlNode> ls_std_io_test::TestDataFactory::createXmlContent()
+{
+  std::shared_ptr<ls::std::io::XmlNode> root = std::make_shared<ls::std::io::XmlNode>("dialog");
+  std::shared_ptr<ls::std::io::XmlAttribute> attribute{};
+  std::shared_ptr<ls::std::io::XmlNode> child{};
+  std::shared_ptr<ls::std::io::XmlNode> text{};
+
+  attribute = std::make_shared<ls::std::io::XmlAttribute>("name");
+  attribute->setValue("dungeon_001");
+  root->addAttributeToEnd(attribute);
+
+  child = std::make_shared<ls::std::io::XmlNode>("dialogUnit");
+  attribute = std::make_shared<ls::std::io::XmlAttribute>("id");
+  attribute->setValue("001");
+  child->addAttributeToEnd(attribute);
+  text = std::make_shared<ls::std::io::XmlNode>("text");
+  text->setValue("Hello!");
+  child->addChildToEnd(text);
+  root->addChildToEnd(child);
+
+  child = std::make_shared<ls::std::io::XmlNode>("dialogUnit");
+  attribute = std::make_shared<ls::std::io::XmlAttribute>("id");
+  attribute->setValue("002");
+  child->addAttributeToEnd(attribute);
+  text = std::make_shared<ls::std::io::XmlNode>("text");
+  text->setValue("Hello again!");
+  child->addChildToEnd(text);
+  root->addChildToEnd(child);
+
+  return root;
+}

+ 29 - 0
test/classes/io/xml/TestDataFactory.hpp

@@ -0,0 +1,29 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2022-05-14
+ * Changed:         2022-05-14
+ *
+ * */
+
+#ifndef LS_STD_IO_TEST_DATA_FACTORY_HPP
+#define LS_STD_IO_TEST_DATA_FACTORY_HPP
+
+#include <memory>
+#include <ls_std/ls_std_io.hpp>
+
+namespace ls_std_io_test
+{
+  class TestDataFactory
+  {
+    public:
+
+      TestDataFactory() = default;
+      ~TestDataFactory() = default;
+
+      static std::shared_ptr<ls::std::io::XmlNode> createXmlContent();
+  };
+}
+
+#endif

+ 38 - 0
test/classes/io/xml/TestHelper.hpp

@@ -0,0 +1,38 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2020-08-15
+ * Changed:         2022-05-14
+ *
+ * */
+
+#ifndef LS_STD_IO_TEST_HELPER_HPP
+#define LS_STD_IO_TEST_HELPER_HPP
+
+#include <string>
+#include <ls_std/ls_std_io.hpp>
+
+namespace ls_std_io_test
+{
+  class TestHelper
+  {
+    public:
+
+      TestHelper() = default;
+      ~TestHelper() = default;
+
+      static std::string getResourcesFolderLocation()
+      {
+        return TestHelper::getTestFolderLocation() + "resources" + ls::std::io::FilePathSeparator::get();
+      }
+
+      static std::string getTestFolderLocation()
+      {
+        ls::std::io::File buildDirectory{ls::std::io::File::getWorkingDirectory()};
+        return buildDirectory.getParent() + "test" + ls::std::io::FilePathSeparator::get();
+      }
+  };
+}
+
+#endif

+ 4 - 4
test/classes/io/xml/XmlParserTestWrapper.cpp

@@ -3,21 +3,21 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
 #include "XmlParserTestWrapper.hpp"
 
-ls_std_test::XmlParserTestWrapper::XmlParserTestWrapper() : ls::std::io::XmlParser(nullptr)
+ls_std_io_test::XmlParserTestWrapper::XmlParserTestWrapper() : ls::std::io::XmlParser(nullptr)
 {}
 
-std::pair<std::string, std::string> ls_std_test::XmlParserTestWrapper::readAttribute(const ls::std::core::type::byte_field &_data)
+std::pair<std::string, std::string> ls_std_io_test::XmlParserTestWrapper::readAttribute(const ls::std::core::type::byte_field &_data)
 {
   return ls::std::io::XmlParser::_readAttribute_(_data);
 }
 
-std::list<std::pair<std::string, std::string>> ls_std_test::XmlParserTestWrapper::readAttributes(ls::std::core::type::byte_field _data)
+std::list<std::pair<std::string, std::string>> ls_std_io_test::XmlParserTestWrapper::readAttributes(ls::std::core::type::byte_field _data)
 {
   return ls::std::io::XmlParser::_readAttributes_(std::move(_data));
 }

+ 2 - 2
test/classes/io/xml/XmlParserTestWrapper.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2022-05-12
+ * Changed:         2022-05-14
  *
  * */
 
@@ -12,7 +12,7 @@
 
 #include <ls_std/io/xml/XmlParser.hpp>
 
-namespace ls_std_test
+namespace ls_std_io_test
 {
   class XmlParserTestWrapper : public ls::std::io::XmlParser
   {

+ 17 - 0
test/ls_std_io_test.hpp

@@ -0,0 +1,17 @@
+/*
+ * Author:          Patrick-Christopher Mattulat
+ * Company:         Lynar Studios
+ * E-Mail:          webmaster@lynarstudios.com
+ * Created:         2022-05-14
+ * Changed:         2022-05-14
+ *
+ * */
+
+#ifndef LS_STD_LS_STD_IO_TEST_HPP
+#define LS_STD_LS_STD_IO_TEST_HPP
+
+#include <classes/io/xml/TestDataFactory.hpp>
+#include <classes/io/xml/TestHelper.hpp>
+#include <classes/io/xml/XmlParserTestWrapper.hpp>
+
+#endif