Quellcode durchsuchen

Remove namespaces from io module's tests

Patrick-Christopher Mattulat vor 2 Jahren
Ursprung
Commit
96b0c184f8

+ 26 - 21
test/cases/io/FileOutputStreamTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class FileOutputStreamTest : public ::testing::Test
@@ -30,29 +35,29 @@ namespace
 
   TEST_F(FileOutputStreamTest, constructor_file_does_not_exist)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "not_existing.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "not_existing.txt";
+    File file{path};
 
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::FileOutputStream outputStream{file};
+                     FileOutputStream outputStream{file};
                    }
-                   catch (const ls::std::core::FileNotFoundException &_exception)
+                   catch (const FileNotFoundException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileNotFoundException);
+                 }, FileNotFoundException);
   }
 
   TEST_F(FileOutputStreamTest, write)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());
 
-    ls::std::io::FileOutputStream outputStream{file};
+    FileOutputStream outputStream{file};
     ASSERT_TRUE(outputStream.write("Hello! "));
     ASSERT_TRUE(outputStream.write("How are you?"));
     outputStream.close();
@@ -63,27 +68,27 @@ namespace
 
   TEST_F(FileOutputStreamTest, write_with_another_appending_stream)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "tmp_output_stream.txt";
+    File file{path};
     file.createNewFile();
     ASSERT_TRUE(file.exists());
 
-    ls::std::io::FileOutputStream outputStream{file};
+    FileOutputStream outputStream{file};
     ASSERT_TRUE(outputStream.write("Hello! "));
     ASSERT_TRUE(outputStream.write("How are you?"));
     outputStream.close();
 
-    ls::std::io::FileOutputStream newOutputStream{file, true};
+    FileOutputStream newOutputStream{file, true};
     ASSERT_TRUE(newOutputStream.write(" I'm fine! "));
     ASSERT_TRUE(newOutputStream.write("Thank you!"));
     newOutputStream.close();
 
     // validation
 
-    ls::std::io::FileReader reader{file};
-    ::std::string content{reader.read()};
+    FileReader reader{file};
+    string content{reader.read()};
 
-    ASSERT_TRUE(content.find("Hello! How are you? I'm fine! Thank you!") != ::std::string::npos);
+    ASSERT_TRUE(content.find("Hello! How are you? I'm fine! Thank you!") != string::npos);
 
     file.remove();
     ASSERT_FALSE(file.exists());
@@ -92,23 +97,23 @@ namespace
   TEST_F(FileOutputStreamTest, write_no_permission_to_write)
   {
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
     #endif
     #ifdef _WIN32
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
     #endif
 
-    ls::std::io::FileOutputStream outputStream{file};
+    FileOutputStream outputStream{file};
 
     EXPECT_THROW({
                    try
                    {
                      outputStream.write("something");
                    }
-                   catch (const ls::std::core::FileOperationException &_exception)
+                   catch (const FileOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileOperationException);
+                 }, FileOperationException);
   }
 }

+ 29 - 23
test/cases/io/FileReaderTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-18
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,12 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::core::type;
+using namespace ls::std::io;
+using namespace ls_std_test;
+using namespace ::std;
+
 namespace
 {
   class FileReaderTest : public ::testing::Test
@@ -30,64 +36,64 @@ namespace
 
   TEST_F(FileReaderTest, constructor_file_does_not_exist)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "does_not_exist.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "does_not_exist.txt"};
 
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::FileReader reader{file};
+                     FileReader reader{file};
                    }
-                   catch (const ls::std::core::FileNotFoundException &_exception)
+                   catch (const FileNotFoundException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileNotFoundException);
+                 }, FileNotFoundException);
   }
 
   TEST_F(FileReaderTest, read)
   {
-    ls::std::io::File file{ls_std_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();
+    File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    FileReader reader{file};
+    string expectedUnix = "Hello!" + NewLine::getUnixNewLine();
+    string expectedWindows = "Hello!" + NewLine::getWindowsNewLine();
 
-    ls::std::core::type::byte_field content = reader.read();
+    byte_field content = reader.read();
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
   }
 
   TEST_F(FileReaderTest, read_file_gets_lost_in_between)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "lost_readable_file.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "lost_readable_file.txt"};
     file.createNewFile();
-    ls::std::io::FileReader reader{file};
+    FileReader reader{file};
     file.remove();
 
     EXPECT_THROW({
                    try
                    {
-                     ls::std::core::type::byte_field content = reader.read();
+                     byte_field content = reader.read();
                    }
-                   catch (const ls::std::core::FileOperationException &_exception)
+                   catch (const FileOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileOperationException);
+                 }, FileOperationException);
   }
 
   TEST_F(FileReaderTest, reset)
   {
-    ls::std::io::File file{ls_std_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();
+    File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    FileReader reader{file};
+    string expectedUnix = "Hello!" + NewLine::getUnixNewLine();
+    string expectedWindows = "Hello!" + NewLine::getWindowsNewLine();
 
-    ls::std::core::type::byte_field content = reader.read();
+    byte_field content = reader.read();
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
 
-    ls::std::io::File anotherFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test/bla.txt"};
+    File anotherFile{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();
+    expectedUnix = "nothing to say!" + NewLine::getUnixNewLine();
+    expectedWindows = "nothing to say!" + NewLine::getWindowsNewLine();
 
     content = reader.read();
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);

+ 84 - 79
test/cases/io/FileTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ls_std_test;
+using namespace ::std;
+
 namespace
 {
   class FileTest : public ::testing::Test
@@ -21,7 +26,7 @@ namespace
       FileTest() = default;
       ~FileTest() override = default;
 
-      ::std::string fileLocation = ls_std_test::TestHelper::getResourcesFolderLocation() + "simple.txt";
+      string fileLocation = TestHelper::getResourcesFolderLocation() + "simple.txt";
 
       void SetUp() override
       {}
@@ -34,10 +39,10 @@ namespace
 
   TEST_F(FileTest, operator_equals)
   {
-    ls::std::io::File file{this->fileLocation};
-    ls::std::io::File file2{this->fileLocation};
-    ls::std::io::File file3{"/home/bla/text.txt"};
-    ls::std::io::File file4{"\\home/bla\\text.txt"};
+    File file{this->fileLocation};
+    File file2{this->fileLocation};
+    File file3{"/home/bla/text.txt"};
+    File file4{"\\home/bla\\text.txt"};
 
     ASSERT_TRUE(file == file2);
     ASSERT_TRUE(file2 == file);
@@ -47,8 +52,8 @@ namespace
 
   TEST_F(FileTest, operator_not_equals)
   {
-    ls::std::io::File file{this->fileLocation};
-    ls::std::io::File file2{ls_std_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
+    File file{this->fileLocation};
+    File file2{TestHelper::getResourcesFolderLocation() + "app.exe"};
 
     ASSERT_TRUE(file != file2);
     ASSERT_TRUE(file2 != file);
@@ -59,10 +64,10 @@ namespace
   TEST_F(FileTest, canExecute)
   {
     #ifdef _WIN32
-    ls::std::io::File executableFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
+    File executableFile{TestHelper::getResourcesFolderLocation() + "app.exe"};
     #endif
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File executableFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "app"};
+    File executableFile{TestHelper::getResourcesFolderLocation() + "app"};
     #endif
 
     ASSERT_TRUE(executableFile.canExecute());
@@ -70,53 +75,53 @@ namespace
 
   TEST_F(FileTest, canExecute_not_executable)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_FALSE(file.canExecute());
   }
 
   TEST_F(FileTest, canRead)
   {
-    ls::std::io::File readableFile{this->fileLocation};
+    File readableFile{this->fileLocation};
     ASSERT_TRUE(readableFile.canRead());
   }
 
   TEST_F(FileTest, canRead_file_does_not_exist)
   {
-    ls::std::io::File file{""};
+    File file{""};
 
     EXPECT_THROW({
                    try
                    {
                      file.canRead();
                    }
-                   catch (const ls::std::core::FileOperationException &_exception)
+                   catch (const FileOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileOperationException);
+                 }, FileOperationException);
   }
 
   TEST_F(FileTest, canWrite)
   {
-    ls::std::io::File readableFile{this->fileLocation};
+    File readableFile{this->fileLocation};
     ASSERT_TRUE(readableFile.canWrite());
   }
 
   TEST_F(FileTest, canWrite_not_writable)
   {
     #if defined(unix) || defined(__APPLE__)
-    ls::std::io::File noWritableFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
+    File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable.txt"};
     ASSERT_FALSE(noWritableFile.canWrite());
     #endif
     #ifdef _WIN32
-    ls::std::io::File noWritableFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
+    File noWritableFile{TestHelper::getResourcesFolderLocation() + "no_writable_windows.txt"};
     ASSERT_FALSE(noWritableFile.canWrite());
     #endif
   }
 
   TEST_F(FileTest, createNewFile)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "tmp.txt"};
     ASSERT_FALSE(file.exists());
 
     file.createNewFile();
@@ -128,24 +133,24 @@ namespace
 
   TEST_F(FileTest, createNewFile_file_does_already_exist)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "simple.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "simple.txt"};
 
     EXPECT_THROW({
                    try
                    {
                      file.createNewFile();
                    }
-                   catch (const ls::std::core::FileOperationException &_exception)
+                   catch (const FileOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileOperationException);
+                 }, FileOperationException);
   }
 
   TEST_F(FileTest, exists)
   {
-    ls::std::io::File file{this->fileLocation};
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation()};
+    File file{this->fileLocation};
+    File directory{TestHelper::getResourcesFolderLocation()};
 
     ASSERT_TRUE(file.exists());
     ASSERT_TRUE(directory.exists());
@@ -153,28 +158,28 @@ namespace
 
   TEST_F(FileTest, exists_does_not_exist)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "bla.txt"};
+    File file{TestHelper::getResourcesFolderLocation() + "bla.txt"};
     ASSERT_FALSE(file.exists());
   }
 
   TEST_F(FileTest, getAbsoluteFilePath)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_STREQ(this->fileLocation.c_str(), file.getAbsoluteFilePath().c_str());
-    ::std::string s = {ls::std::io::FilePathSeparator::get()};
+    string s = {FilePathSeparator::get()};
 
-    ::std::string wrongFilePath = "home" + s + s + s + "user" + s + "bla" + s + s + "sub_folder";
-    ::std::string expectedFilePath = "home" + s + "user" + s + "bla" + s + "sub_folder";
-    ls::std::io::File anotherFile{wrongFilePath};
+    string wrongFilePath = "home" + s + s + s + "user" + s + "bla" + s + s + "sub_folder";
+    string expectedFilePath = "home" + s + "user" + s + "bla" + s + "sub_folder";
+    File anotherFile{wrongFilePath};
     ASSERT_STREQ(expectedFilePath.c_str(), anotherFile.getAbsoluteFilePath().c_str());
   }
 
   TEST_F(FileTest, getName)
   {
-    ls::std::io::File file{this->fileLocation};
-    ls::std::io::File executableFile{ls_std_test::TestHelper::getResourcesFolderLocation() + "app.exe"};
-    ls::std::io::File anotherFile{"bla.txt"};
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation()};
+    File file{this->fileLocation};
+    File executableFile{TestHelper::getResourcesFolderLocation() + "app.exe"};
+    File anotherFile{"bla.txt"};
+    File directory{TestHelper::getResourcesFolderLocation()};
 
     ASSERT_STREQ("simple.txt", file.getName().c_str());
     ASSERT_STREQ("app.exe", executableFile.getName().c_str());
@@ -184,19 +189,19 @@ namespace
 
   TEST_F(FileTest, getParent)
   {
-    ls::std::io::File file{this->fileLocation};
-    ASSERT_STREQ(ls_std_test::TestHelper::getResourcesFolderLocation().c_str(), file.getParent().c_str());
+    File file{this->fileLocation};
+    ASSERT_STREQ(TestHelper::getResourcesFolderLocation().c_str(), file.getParent().c_str());
   }
 
   TEST_F(FileTest, getWorkingDirectory)
   {
-    ::std::string workingDirectory = ls::std::io::File::getWorkingDirectory();
+    string workingDirectory = File::getWorkingDirectory();
     ASSERT_FALSE(workingDirectory.empty());
   }
 
   TEST_F(FileTest, getSize)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     size_t size = file.getSize();
 
     ASSERT_TRUE(size == 7 || size == 8); // different OS specific new lines
@@ -204,45 +209,45 @@ namespace
 
   TEST_F(FileTest, isDirectory)
   {
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation()};
+    File directory{TestHelper::getResourcesFolderLocation()};
     ASSERT_TRUE(directory.isDirectory());
   }
 
   TEST_F(FileTest, isDirectory_is_a_file)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_FALSE(file.isDirectory());
   }
 
   TEST_F(FileTest, isFile)
   {
-    const char separator = ls::std::io::FilePathSeparator::get();
+    const char separator = FilePathSeparator::get();
 
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_TRUE(file.isFile());
 
-    ls::std::io::File file2{ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test" + separator + "bla.txt"};
+    File file2{TestHelper::getResourcesFolderLocation() + "list_test" + separator + "bla.txt"};
     ASSERT_TRUE(file2.isFile());
   }
 
   TEST_F(FileTest, isFile_is_a_directory)
   {
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation()};
+    File directory{TestHelper::getResourcesFolderLocation()};
     ASSERT_FALSE(directory.isFile());
   }
 
   TEST_F(FileTest, lastModified)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_TRUE(file.lastModified() > 1590000000);
   }
 
   TEST_F(FileTest, list)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test"};
-    ::std::list<std::string> filesInDirectory = file.list();
-    ::std::string expectedFile{};
-    const char separator = ls::std::io::FilePathSeparator::get();
+    File file{TestHelper::getResourcesFolderLocation() + "list_test"};
+    list<string> filesInDirectory = file.list();
+    string expectedFile{};
+    const char separator = FilePathSeparator::get();
 
     auto filesIterator = filesInDirectory.begin();
 
@@ -250,44 +255,44 @@ namespace
     ASSERT_EQ(7, filesInDirectory.size());
 
     expectedFile = file.getAbsoluteFilePath() + separator + ".";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "..";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "another_file.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "list_test_sub";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + ".hidden_file.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
   }
 
   TEST_F(FileTest, listFiles)
   {
-    ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test"};
-    ::std::list<::std::string> filesInDirectory = file.listFiles();
-    ::std::string expectedFile{};
-    const char separator = ls::std::io::FilePathSeparator::get();
+    File file{TestHelper::getResourcesFolderLocation() + "list_test"};
+    list<string> filesInDirectory = file.listFiles();
+    string expectedFile{};
+    const char separator = FilePathSeparator::get();
 
     ASSERT_FALSE(filesInDirectory.empty());
     ASSERT_EQ(4, filesInDirectory.size());
 
     expectedFile = file.getAbsoluteFilePath() + separator + "another_file.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "bla.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + "hello.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
     expectedFile = file.getAbsoluteFilePath() + separator + ".hidden_file.txt";
-    ASSERT_TRUE((ls::std::core::STLUtils::contains(filesInDirectory, expectedFile)));
+    ASSERT_TRUE((STLUtils::contains(filesInDirectory, expectedFile)));
   }
 
   TEST_F(FileTest, makeDirectory)
   {
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation() + "testDir"};
+    File directory{TestHelper::getResourcesFolderLocation() + "testDir"};
     ASSERT_FALSE(directory.exists());
 
     directory.makeDirectory();
@@ -299,23 +304,23 @@ namespace
 
   TEST_F(FileTest, makeDirectory_directory_already_exists)
   {
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test"};
+    File directory{TestHelper::getResourcesFolderLocation() + "list_test"};
 
     EXPECT_THROW({
                    try
                    {
                      directory.makeDirectory();
                    }
-                   catch (const ls::std::core::FileOperationException &_exception)
+                   catch (const FileOperationException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileOperationException);
+                 }, FileOperationException);
   }
 
   TEST_F(FileTest, makeDirectories)
   {
-    ls::std::io::File directory{ls_std_test::TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp/bla"};
+    File directory{TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp/bla"};
     ASSERT_FALSE(directory.exists());
 
     directory.makeDirectories();
@@ -324,18 +329,18 @@ namespace
     // clean up
 
     directory.remove();
-    directory = ls::std::io::File(ls_std_test::TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp");
+    directory = File(TestHelper::getResourcesFolderLocation() + "testDir/sub/tmp");
     directory.remove();
-    directory = ls::std::io::File(ls_std_test::TestHelper::getResourcesFolderLocation() + "testDir/sub");
+    directory = File(TestHelper::getResourcesFolderLocation() + "testDir/sub");
     directory.remove();
-    directory = ls::std::io::File(ls_std_test::TestHelper::getResourcesFolderLocation() + "testDir");
+    directory = File(TestHelper::getResourcesFolderLocation() + "testDir");
     directory.remove();
   }
 
   TEST_F(FileTest, remove)
   {
-    ::std::string fileName = ls_std_test::TestHelper::getResourcesFolderLocation() + "removable_file.txt";
-    ls::std::io::File file{fileName};
+    string fileName = TestHelper::getResourcesFolderLocation() + "removable_file.txt";
+    File file{fileName};
     file.createNewFile();
 
     ASSERT_TRUE(file.exists());
@@ -346,10 +351,10 @@ namespace
 
   TEST_F(FileTest, renameTo)
   {
-    ::std::string currentName = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_rename_to.txt";
-    ::std::string newName = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_rename_to_better_name.txt";
+    string currentName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to.txt";
+    string newName = TestHelper::getResourcesFolderLocation() + "tmp_rename_to_better_name.txt";
 
-    ls::std::io::File file{currentName};
+    File file{currentName};
     file.createNewFile();
 
     ASSERT_TRUE(file.exists());
@@ -364,10 +369,10 @@ namespace
 
   TEST_F(FileTest, reset)
   {
-    ls::std::io::File file{this->fileLocation};
+    File file{this->fileLocation};
     ASSERT_TRUE(file.exists());
 
-    file.reset(ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test/hello.txt");
+    file.reset(TestHelper::getResourcesFolderLocation() + "list_test/hello.txt");
     ASSERT_TRUE(file.exists());
   }
 }

+ 19 - 14
test/cases/io/FileWriterTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-17
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class FileWriterTest : public ::testing::Test
@@ -30,33 +35,33 @@ namespace
 
   TEST_F(FileWriterTest, constructor_file_does_not_exist)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "not_existing_file.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "not_existing_file.txt";
+    File file{path};
 
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::FileWriter writer{file};
+                     FileWriter writer{file};
                    }
-                   catch (const ls::std::core::FileNotFoundException &_exception)
+                   catch (const FileNotFoundException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::FileNotFoundException);
+                 }, FileNotFoundException);
   }
 
   TEST_F(FileWriterTest, reset)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    File file{path};
     file.createNewFile();
-    ls::std::io::FileWriter writer{file};
+    FileWriter writer{file};
     ASSERT_TRUE(writer.write("Testing something!\n"));
 
     // reset
 
-    path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test2.txt";
-    ls::std::io::File anotherFile{path};
+    path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test2.txt";
+    File anotherFile{path};
     anotherFile.createNewFile();
 
     writer.reset(anotherFile);
@@ -72,14 +77,14 @@ namespace
 
   TEST_F(FileWriterTest, write)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "tmp_file_writer_test.txt";
+    File file{path};
 
     ASSERT_FALSE(file.exists());
     file.createNewFile();
     ASSERT_TRUE(file.exists());
 
-    ls::std::io::FileWriter writer{file};
+    FileWriter writer{file};
     ASSERT_TRUE(writer.write("Testing something!\n"));
 
     file.remove();

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

@@ -3,14 +3,15 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2021-09-18
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
 #include <gtest/gtest.h>
-#include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::io;
+
 namespace
 {
   class StandardOutputWriterTest : public ::testing::Test
@@ -29,7 +30,7 @@ namespace
 
   TEST_F(StandardOutputWriterTest, write)
   {
-    ls::std::io::StandardOutputWriter writer{};
+    StandardOutputWriter writer{};
     ASSERT_TRUE(writer.write("Try something!"));
   }
 }

+ 26 - 20
test/cases/io/StorableFileTest.cpp

@@ -3,14 +3,20 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-19
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
 #include <gtest/gtest.h>
+#include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core::type;
+using namespace ls::std::io;
+using namespace ls_std_test;
+using namespace ::std;
+
 namespace
 {
   class StorableFileTest : public ::testing::Test
@@ -20,7 +26,7 @@ namespace
       StorableFileTest() = default;
       ~StorableFileTest() override = default;
 
-      ::std::string fileLocation = ls_std_test::TestHelper::getResourcesFolderLocation() + "simple.txt";
+      string fileLocation = TestHelper::getResourcesFolderLocation() + "simple.txt";
 
       void SetUp() override
       {}
@@ -31,55 +37,55 @@ namespace
 
   TEST_F(StorableFileTest, getFile)
   {
-    ls::std::io::StorableFile storableFile{this->fileLocation};
+    StorableFile storableFile{this->fileLocation};
     ASSERT_STREQ(this->fileLocation.c_str(), storableFile.getFile()->getAbsoluteFilePath().c_str());
   }
 
   TEST_F(StorableFileTest, load)
   {
-    ls::std::io::StorableFile storableFile{this->fileLocation};
-    ls::std::core::type::byte_field content = storableFile.load();
+    StorableFile storableFile{this->fileLocation};
+    byte_field content = storableFile.load();
 
-    ::std::string expectedUnix = "Hello!" + ls::std::io::NewLine::getUnixNewLine();
-    ::std::string expectedWindows = "Hello!" + ls::std::io::NewLine::getWindowsNewLine();
+    string expectedUnix = "Hello!" + NewLine::getUnixNewLine();
+    string expectedWindows = "Hello!" + NewLine::getWindowsNewLine();
 
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
   }
 
   TEST_F(StorableFileTest, reset)
   {
-    ls::std::io::StorableFile storableFile{this->fileLocation};
-    ls::std::core::type::byte_field content = storableFile.load();
+    StorableFile storableFile{this->fileLocation};
+    byte_field content = storableFile.load();
 
-    ::std::string expectedUnix = "Hello!" + ls::std::io::NewLine::getUnixNewLine();
-    ::std::string expectedWindows = "Hello!" + ls::std::io::NewLine::getWindowsNewLine();
+    string expectedUnix = "Hello!" + NewLine::getUnixNewLine();
+    string expectedWindows = "Hello!" + NewLine::getWindowsNewLine();
 
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
 
     // reset
 
-    ::std::string anotherFileLocation = ls_std_test::TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
+    string anotherFileLocation = TestHelper::getResourcesFolderLocation() + "list_test/bla.txt";
     storableFile.reset(anotherFileLocation);
     content = storableFile.load();
 
-    expectedUnix = "nothing to say!" + ls::std::io::NewLine::getUnixNewLine();
-    expectedWindows = "nothing to say!" + ls::std::io::NewLine::getWindowsNewLine();
+    expectedUnix = "nothing to say!" + NewLine::getUnixNewLine();
+    expectedWindows = "nothing to say!" + NewLine::getWindowsNewLine();
 
     ASSERT_TRUE(content == expectedUnix || content == expectedWindows);
   }
 
   TEST_F(StorableFileTest, save)
   {
-    ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + "tmp_storable_file.txt";
-    ls::std::io::File file{path};
+    string path = TestHelper::getResourcesFolderLocation() + "tmp_storable_file.txt";
+    File file{path};
     file.createNewFile();
 
-    ls::std::io::StorableFile storableFile{path};
-    ls::std::core::type::byte_field textUnix = "Testing save method!" + ls::std::io::NewLine::getUnixNewLine();
-    ls::std::core::type::byte_field textWindows = "Testing save method!" + ls::std::io::NewLine::getWindowsNewLine();
+    StorableFile storableFile{path};
+    byte_field textUnix = "Testing save method!" + NewLine::getUnixNewLine();
+    byte_field textWindows = "Testing save method!" + NewLine::getWindowsNewLine();
 
     storableFile.save(textUnix);
-    ls::std::core::type::byte_field content = storableFile.load();
+    byte_field content = storableFile.load();
     ASSERT_TRUE(content == textUnix || content == textWindows);
 
     file.remove();

+ 18 - 16
test/cases/io/kv/KvDocumentTest.cpp

@@ -3,13 +3,15 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::io;
+
 namespace
 {
   class KvDocumentTest : public ::testing::Test
@@ -28,8 +30,8 @@ namespace
 
   TEST_F(KvDocumentTest, addPair)
   {
-    ls::std::io::KvDocument document{};
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvDocument document{};
+    KvPair pair{"port", "13088"};
 
     ASSERT_TRUE(document.addPair(pair));
     ASSERT_EQ(1, document.getPairs().size());
@@ -37,8 +39,8 @@ namespace
 
   TEST_F(KvDocumentTest, addPair_retry_to_add_pair)
   {
-    ls::std::io::KvDocument document{};
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvDocument document{};
+    KvPair pair{"port", "13088"};
 
     ASSERT_TRUE(document.addPair(pair));
     ASSERT_FALSE(document.addPair(pair));
@@ -48,8 +50,8 @@ namespace
   {
     // preparation
 
-    ls::std::io::KvDocument document{};
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvDocument document{};
+    KvPair pair{"port", "13088"};
     document.addPair(pair);
 
     // check
@@ -61,21 +63,21 @@ namespace
 
   TEST_F(KvDocumentTest, getPairs)
   {
-    ls::std::io::KvDocument document{};
+    KvDocument document{};
     ASSERT_TRUE(document.getPairs().empty());
   }
 
   TEST_F(KvDocumentTest, hasPair)
   {
-    ls::std::io::KvDocument document{};
-    document.addPair(ls::std::io::KvPair{"port", "80"});
+    KvDocument document{};
+    document.addPair(KvPair{"port", "80"});
 
     ASSERT_TRUE(document.hasPair("port"));
   }
 
   TEST_F(KvDocumentTest, hasPair_no_pairs_available)
   {
-    ls::std::io::KvDocument document{};
+    KvDocument document{};
     ASSERT_FALSE(document.hasPair("port"));
   }
 
@@ -83,10 +85,10 @@ namespace
   {
     // preparation
 
-    ls::std::io::KvDocument document{};
-    document.addPair(ls::std::io::KvPair{"port", "80"});
-    document.addPair(ls::std::io::KvPair{"host", "localhost"});
-    document.addPair(ls::std::io::KvPair{"protocol", "TCP"});
+    KvDocument document{};
+    document.addPair(KvPair{"port", "80"});
+    document.addPair(KvPair{"host", "localhost"});
+    document.addPair(KvPair{"protocol", "TCP"});
 
     // remove pair and check
 
@@ -98,7 +100,7 @@ namespace
 
   TEST_F(KvDocumentTest, removePair_no_pair_available)
   {
-    ls::std::io::KvDocument document{};
+    KvDocument document{};
     ASSERT_FALSE(document.removePair("port"));
   }
 }

+ 29 - 24
test/cases/io/kv/KvFileReaderTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class KvFileReaderTest : public ::testing::Test
@@ -27,12 +32,12 @@ namespace
       void TearDown() override
       {}
 
-      static std::shared_ptr<ls::std::io::KvFileReader> createTestKVFileReader()
+      static shared_ptr<KvFileReader> createTestKVFileReader()
       {
-        ::std::string kvPath = ls_std_test::TestHelper::getResourcesFolderLocation() + "server_settings.kv";
-        ::std::shared_ptr<ls::std::io::KvDocument> document = ::std::make_shared<ls::std::io::KvDocument>();
+        string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+        shared_ptr<KvDocument> document = make_shared<KvDocument>();
 
-        return ::std::make_shared<ls::std::io::KvFileReader>(document, kvPath);
+        return make_shared<KvFileReader>(document, kvPath);
       }
   };
 
@@ -41,14 +46,14 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ::std::string kvPath = ls_std_test::TestHelper::getResourcesFolderLocation() + "server_settings.kv";
-                     ls::std::io::KvFileReader reader = ls::std::io::KvFileReader(nullptr, kvPath);
+                     string kvPath = TestHelper::getResourcesFolderLocation() + "server_settings.kv";
+                     KvFileReader reader = KvFileReader(nullptr, kvPath);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(KvFileReaderTest, constructor_invalid_file_path)
@@ -56,18 +61,18 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::KvFileReader reader = ls::std::io::KvFileReader(::std::make_shared<ls::std::io::KvDocument>(), "invalid_path");
+                     KvFileReader reader = KvFileReader(make_shared<KvDocument>(), "invalid_path");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(KvFileReaderTest, getDocument)
   {
-    const ::std::shared_ptr<ls::std::io::KvFileReader> &reader = createTestKVFileReader();
+    const shared_ptr<KvFileReader> &reader = createTestKVFileReader();
     ASSERT_TRUE(reader->getDocument() != nullptr);
   }
 
@@ -75,12 +80,12 @@ namespace
   {
     // preparation
 
-    const ::std::shared_ptr<ls::std::io::KvFileReader> &reader = createTestKVFileReader();
+    const shared_ptr<KvFileReader> &reader = createTestKVFileReader();
 
     // read file and check
 
     reader->read();
-    const ::std::shared_ptr<ls::std::io::KvDocument> &document = reader->getDocument();
+    const shared_ptr<KvDocument> &document = reader->getDocument();
 
     ASSERT_EQ(3, document->getPairs().size());
     ASSERT_TRUE(document->hasPair("port"));
@@ -94,46 +99,46 @@ namespace
 
   TEST_F(KvFileReaderTest, setFile_no_existing_file)
   {
-    const ::std::shared_ptr<ls::std::io::KvFileReader> &reader = createTestKVFileReader();
+    const shared_ptr<KvFileReader> &reader = createTestKVFileReader();
 
     EXPECT_THROW({
                    try
                    {
-                     reader->setFile(ls::std::io::File{"invalid_path"});
+                     reader->setFile(File{"invalid_path"});
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(KvFileReaderTest, setDocument)
   {
     // preparation
 
-    const ::std::shared_ptr<ls::std::io::KvFileReader> &reader = createTestKVFileReader();
+    const shared_ptr<KvFileReader> &reader = createTestKVFileReader();
 
     // set new document and check
 
-    ::std::shared_ptr<ls::std::io::KvDocument> newDocument = ::std::make_shared<ls::std::io::KvDocument>();
+    shared_ptr<KvDocument> newDocument = make_shared<KvDocument>();
     reader->setDocument(newDocument);
     ASSERT_TRUE(reader->getDocument() == newDocument);
   }
 
   TEST_F(KvFileReaderTest, setDocument_no_reference)
   {
-    const ::std::shared_ptr<ls::std::io::KvFileReader> &reader = createTestKVFileReader();
+    const shared_ptr<KvFileReader> &reader = createTestKVFileReader();
 
     EXPECT_THROW({
                    try
                    {
                      reader->setDocument(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

+ 10 - 7
test/cases/io/kv/KvPairTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+
 namespace
 {
   class KvPairTest : public ::testing::Test
@@ -33,30 +36,30 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::KvPair pair = ls::std::io::KvPair("", "1989");
+                     KvPair pair = KvPair("", "1989");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(KvPairTest, getKey)
   {
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvPair pair{"port", "13088"};
     ASSERT_STREQ("port", pair.getKey().c_str());
   }
 
   TEST_F(KvPairTest, getValue)
   {
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvPair pair{"port", "13088"};
     ASSERT_STREQ("13088", pair.getValue().c_str());
   }
 
   TEST_F(KvPairTest, setValue)
   {
-    ls::std::io::KvPair pair{"port", "13088"};
+    KvPair pair{"port", "13088"};
     ASSERT_STREQ("13088", pair.getValue().c_str());
 
     pair.setValue("8080");

+ 20 - 15
test/cases/io/kv/KvParserTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-12-25
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,11 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::core::type;
+using namespace ls::std::io;
+using namespace ::std;
+
 namespace
 {
   class KvParserTest : public ::testing::Test
@@ -32,26 +37,26 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::KvParser parser{nullptr};
+                     KvParser parser{nullptr};
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(KvParserTest, getDocument)
   {
-    ls::std::io::KvParser parser{::std::make_shared<ls::std::io::KvDocument>()};
+    KvParser parser{make_shared<KvDocument>()};
     ASSERT_TRUE(parser.getDocument() != nullptr);
   }
 
   TEST_F(KvParserTest, parse)
   {
-    ::std::shared_ptr<ls::std::io::KvDocument> document = ::std::make_shared<ls::std::io::KvDocument>();
-    ls::std::io::KvParser parser{document};
-    ls::std::core::type::byte_field data = "# starting comment\n\nport=8080; # some comment\nhost=localhost;\nservice-name=deamon;";
+    shared_ptr<KvDocument> document = make_shared<KvDocument>();
+    KvParser parser{document};
+    byte_field data = "# starting comment\n\nport=8080; # some comment\nhost=localhost;\nservice-name=deamon;";
     parser.parse(data);
 
     ASSERT_EQ(3, document->getPairs().size());
@@ -68,30 +73,30 @@ namespace
   {
     // preparation
 
-    ::std::shared_ptr<ls::std::io::KvDocument> document = ::std::make_shared<ls::std::io::KvDocument>();
-    ls::std::io::KvParser parser{document};
+    shared_ptr<KvDocument> document = make_shared<KvDocument>();
+    KvParser parser{document};
 
     // set and check
 
-    ::std::shared_ptr<ls::std::io::KvDocument> newDocument = ::std::make_shared<ls::std::io::KvDocument>();
+    shared_ptr<KvDocument> newDocument = make_shared<KvDocument>();
     parser.setDocument(newDocument);
     ASSERT_TRUE(parser.getDocument() == newDocument);
   }
 
   TEST_F(KvParserTest, setDocument_no_reference)
   {
-    ::std::shared_ptr<ls::std::io::KvDocument> document = ::std::make_shared<ls::std::io::KvDocument>();
-    ls::std::io::KvParser parser{document};
+    shared_ptr<KvDocument> document = make_shared<KvDocument>();
+    KvParser parser{document};
 
     EXPECT_THROW({
                    try
                    {
                      parser.setDocument(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

+ 59 - 56
test/cases/io/logging/LogLevelTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2021-05-02
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+
 namespace
 {
   class LogLevelTest : public ::testing::Test
@@ -29,150 +32,150 @@ namespace
 
   TEST_F(LogLevelTest, constructor_with_log_level_value_parameter)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::INFO};
-    ASSERT_EQ(ls::std::io::LogLevelValue::INFO, logLevel);
+    LogLevel logLevel{LogLevelValue::INFO};
+    ASSERT_EQ(LogLevelValue::INFO, logLevel);
   }
 
   TEST_F(LogLevelTest, constructor_default)
   {
-    ls::std::io::LogLevel logLevel{};
-    ASSERT_EQ(ls::std::io::LogLevelValue::FATAL, logLevel);
+    LogLevel logLevel{};
+    ASSERT_EQ(LogLevelValue::FATAL, logLevel);
   }
 
   TEST_F(LogLevelTest, operator_assign)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    logLevel = ls::std::io::LogLevelValue::INFO;
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    logLevel = LogLevelValue::INFO;
 
-    ASSERT_EQ(ls::std::io::LogLevelValue::INFO, logLevel);
+    ASSERT_EQ(LogLevelValue::INFO, logLevel);
   }
 
   TEST_F(LogLevelTest, operator_lessThan)
   {
-    ls::std::io::LogLevel logLevel{}; // default is FATAL
+    LogLevel logLevel{}; // default is FATAL
 
-    ASSERT_TRUE(logLevel < ls::std::io::LogLevelValue::ERR);
-    ASSERT_TRUE(logLevel < ls::std::io::LogLevelValue::WARN);
-    ASSERT_TRUE(logLevel < ls::std::io::LogLevelValue::INFO);
-    ASSERT_TRUE(logLevel < ls::std::io::LogLevelValue::DEBUG);
-    ASSERT_TRUE(logLevel < ls::std::io::LogLevelValue::TRACE);
+    ASSERT_TRUE(logLevel < LogLevelValue::ERR);
+    ASSERT_TRUE(logLevel < LogLevelValue::WARN);
+    ASSERT_TRUE(logLevel < LogLevelValue::INFO);
+    ASSERT_TRUE(logLevel < LogLevelValue::DEBUG);
+    ASSERT_TRUE(logLevel < LogLevelValue::TRACE);
   }
 
   TEST_F(LogLevelTest, operator_lessThan_not_less_than)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_FALSE(logLevel < ls::std::io::LogLevelValue::ERR);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_FALSE(logLevel < LogLevelValue::ERR);
   }
 
   TEST_F(LogLevelTest, operator_less_than_equals)
   {
-    ls::std::io::LogLevel logLevel{}; // default is FATAL
+    LogLevel logLevel{}; // default is FATAL
 
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::FATAL);
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::ERR);
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::WARN);
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::INFO);
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::DEBUG);
-    ASSERT_TRUE(logLevel <= ls::std::io::LogLevelValue::TRACE);
+    ASSERT_TRUE(logLevel <= LogLevelValue::FATAL);
+    ASSERT_TRUE(logLevel <= LogLevelValue::ERR);
+    ASSERT_TRUE(logLevel <= LogLevelValue::WARN);
+    ASSERT_TRUE(logLevel <= LogLevelValue::INFO);
+    ASSERT_TRUE(logLevel <= LogLevelValue::DEBUG);
+    ASSERT_TRUE(logLevel <= LogLevelValue::TRACE);
   }
 
   TEST_F(LogLevelTest, operator_less_than_equals_not_less_than_equals)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_FALSE(logLevel <= ls::std::io::LogLevelValue::ERR);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_FALSE(logLevel <= LogLevelValue::ERR);
   }
 
   TEST_F(LogLevelTest, operator_greater_than)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_TRUE(logLevel > ls::std::io::LogLevelValue::ERR);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_TRUE(logLevel > LogLevelValue::ERR);
   }
 
   TEST_F(LogLevelTest, operator_greater_than_not_greater_than)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_FALSE(logLevel > ls::std::io::LogLevelValue::DEBUG);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_FALSE(logLevel > LogLevelValue::DEBUG);
   }
 
   TEST_F(LogLevelTest, operator_greater_than_equals)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_TRUE(logLevel >= ls::std::io::LogLevelValue::ERR);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_TRUE(logLevel >= LogLevelValue::ERR);
   }
 
   TEST_F(LogLevelTest, operator_greater_than_equals_not_greater_than_equals)
   {
-    ls::std::io::LogLevel logLevel{};
-    ASSERT_FALSE(logLevel >= ls::std::io::LogLevelValue::ERR);
+    LogLevel logLevel{};
+    ASSERT_FALSE(logLevel >= LogLevelValue::ERR);
   }
 
   TEST_F(LogLevelTest, operator_equals)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::DEBUG};
-    ASSERT_TRUE(logLevel == ls::std::io::LogLevelValue::DEBUG);
+    LogLevel logLevel{LogLevelValue::DEBUG};
+    ASSERT_TRUE(logLevel == LogLevelValue::DEBUG);
   }
 
   TEST_F(LogLevelTest, operator_equals_not_equals)
   {
-    ls::std::io::LogLevel logLevel{ls::std::io::LogLevelValue::TRACE};
-    ASSERT_FALSE(logLevel == ls::std::io::LogLevelValue::DEBUG);
+    LogLevel logLevel{LogLevelValue::TRACE};
+    ASSERT_FALSE(logLevel == LogLevelValue::DEBUG);
   }
 
   TEST_F(LogLevelTest, setLogLevel_with_log_level_value)
   {
-    ls::std::io::LogLevel logLevel{};
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::INFO);
+    LogLevel logLevel{};
+    logLevel.setLogLevel(LogLevelValue::INFO);
 
-    ASSERT_EQ(ls::std::io::LogLevelValue::INFO, logLevel);
+    ASSERT_EQ(LogLevelValue::INFO, logLevel);
   }
 
   TEST_F(LogLevelTest, setLogLevel_with_string)
   {
-    ls::std::io::LogLevel logLevel{};
+    LogLevel logLevel{};
 
     logLevel.setLogLevel("FATAL");
-    ASSERT_EQ(ls::std::io::LogLevelValue::FATAL, logLevel);
+    ASSERT_EQ(LogLevelValue::FATAL, logLevel);
     logLevel.setLogLevel("ERROR");
-    ASSERT_EQ(ls::std::io::LogLevelValue::ERR, logLevel);
+    ASSERT_EQ(LogLevelValue::ERR, logLevel);
     logLevel.setLogLevel("WARN");
-    ASSERT_EQ(ls::std::io::LogLevelValue::WARN, logLevel);
+    ASSERT_EQ(LogLevelValue::WARN, logLevel);
     logLevel.setLogLevel("INFO");
-    ASSERT_EQ(ls::std::io::LogLevelValue::INFO, logLevel);
+    ASSERT_EQ(LogLevelValue::INFO, logLevel);
     logLevel.setLogLevel("DEBUG");
-    ASSERT_EQ(ls::std::io::LogLevelValue::DEBUG, logLevel);
+    ASSERT_EQ(LogLevelValue::DEBUG, logLevel);
     logLevel.setLogLevel("TRACE");
-    ASSERT_EQ(ls::std::io::LogLevelValue::TRACE, logLevel);
+    ASSERT_EQ(LogLevelValue::TRACE, logLevel);
   }
 
   TEST_F(LogLevelTest, setLogLevel_string_no_valid_string)
   {
-    ls::std::io::LogLevel logLevel{};
+    LogLevel logLevel{};
 
     EXPECT_THROW({
                    try
                    {
                      logLevel.setLogLevel("This is not a valid log level!");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(LogLevelTest, toString)
   {
-    ls::std::io::LogLevel logLevel{};
+    LogLevel logLevel{};
     ASSERT_STREQ("FATAL", logLevel.toString().c_str());
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::ERR);
+    logLevel.setLogLevel(LogLevelValue::ERR);
     ASSERT_STREQ("ERROR", logLevel.toString().c_str());
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::WARN);
+    logLevel.setLogLevel(LogLevelValue::WARN);
     ASSERT_STREQ("WARN", logLevel.toString().c_str());
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::INFO);
+    logLevel.setLogLevel(LogLevelValue::INFO);
     ASSERT_STREQ("INFO", logLevel.toString().c_str());
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::DEBUG);
+    logLevel.setLogLevel(LogLevelValue::DEBUG);
     ASSERT_STREQ("DEBUG", logLevel.toString().c_str());
-    logLevel.setLogLevel(ls::std::io::LogLevelValue::TRACE);
+    logLevel.setLogLevel(LogLevelValue::TRACE);
     ASSERT_STREQ("TRACE", logLevel.toString().c_str());
   }
 }

+ 95 - 89
test/cases/io/logging/LoggerTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-20
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,12 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::core::interface_type;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class LoggerTest : public ::testing::Test
@@ -27,26 +33,26 @@ namespace
       void TearDown() override
       {}
 
-      static ::std::shared_ptr<ls::std::core::interface_type::IWriter> createFileLogger(const ::std::string &_logName)
+      static shared_ptr<IWriter> createFileLogger(const string &_logName)
       {
-        ::std::string path = ls_std_test::TestHelper::getResourcesFolderLocation() + _logName;
-        ls::std::io::File file{path};
+        string path = TestHelper::getResourcesFolderLocation() + _logName;
+        File file{path};
 
         if (!file.exists())
         {
           file.createNewFile();
         }
 
-        ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = ::std::dynamic_pointer_cast<ls::std::core::interface_type::IWriter>(::std::make_shared<ls::std::io::FileOutputStream>(file));
+        shared_ptr<IWriter> writer = dynamic_pointer_cast<IWriter>(make_shared<FileOutputStream>(file));
 
         return writer;
       }
 
-      static ::std::string getContentFromLogFile(const ::std::string &_logName)
+      static string getContentFromLogFile(const string &_logName)
       {
-        ls::std::io::File file{ls_std_test::TestHelper::getResourcesFolderLocation() + _logName};
-        ls::std::io::FileReader reader{file};
-        ::std::string content{reader.read()};
+        File file{TestHelper::getResourcesFolderLocation() + _logName};
+        FileReader reader{file};
+        string content{reader.read()};
         file.remove();
 
         return content;
@@ -58,24 +64,24 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::Logger logger{nullptr};
+                     Logger logger{nullptr};
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(LoggerTest, debug)
   {
     // write to log file
 
-    ::std::string logName = "output_debug.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_debug.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::DEBUG);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::DEBUG);
     logger.debug("1. line!");
     logger.info("2. line!");
     logger.error("3. line!");
@@ -85,26 +91,26 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_TRUE(content.find("1. line!") != string::npos);
+    ASSERT_TRUE(content.find("2. line!") != string::npos);
+    ASSERT_TRUE(content.find("3. line!") != string::npos);
+    ASSERT_TRUE(content.find("4. line!") != string::npos);
+    ASSERT_TRUE(content.find("5. line!") != string::npos);
+    ASSERT_FALSE(content.find("6. line!") != string::npos);
   }
 
   TEST_F(LoggerTest, error)
   {
     // write to log file
 
-    ::std::string logName = "output_error.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_error.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::ERR);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::ERR);
     logger.debug("1. line!");
     logger.info("2. line!");
     logger.error("3. line!");
@@ -114,26 +120,26 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_FALSE(content.find("1. line!") != string::npos);
+    ASSERT_FALSE(content.find("2. line!") != string::npos);
+    ASSERT_TRUE(content.find("3. line!") != string::npos);
+    ASSERT_TRUE(content.find("4. line!") != string::npos);
+    ASSERT_FALSE(content.find("5. line!") != string::npos);
+    ASSERT_FALSE(content.find("6. line!") != string::npos);
   }
 
   TEST_F(LoggerTest, fatal)
   {
     // write to log file
 
-    ::std::string logName = "output_fatal.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_fatal.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::FATAL);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::FATAL);
     logger.debug("1. line!");
     logger.info("2. line!");
     logger.error("3. line!");
@@ -143,32 +149,32 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_FALSE(content.find("1. line!") != string::npos);
+    ASSERT_FALSE(content.find("2. line!") != string::npos);
+    ASSERT_FALSE(content.find("3. line!") != string::npos);
+    ASSERT_TRUE(content.find("4. line!") != string::npos);
+    ASSERT_FALSE(content.find("5. line!") != string::npos);
+    ASSERT_FALSE(content.find("6. line!") != string::npos);
   }
 
   TEST_F(LoggerTest, getLogLevel)
   {
-    ls::std::io::Logger logger{createFileLogger("output.log")};
-    ASSERT_EQ(ls::std::io::LogLevelValue::INFO, logger.getLogLevel());
+    Logger logger{createFileLogger("output.log")};
+    ASSERT_EQ(LogLevelValue::INFO, logger.getLogLevel());
   }
 
   TEST_F(LoggerTest, info)
   {
     // write to log file
 
-    ::std::string logName = "output_info.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_info.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::INFO);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::INFO);
     logger.fatal("1. line!");
     logger.error("2. line!");
     logger.warn("3. line!");
@@ -178,34 +184,34 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_TRUE(content.find("1. line!") != string::npos);
+    ASSERT_TRUE(content.find("2. line!") != string::npos);
+    ASSERT_TRUE(content.find("3. line!") != string::npos);
+    ASSERT_TRUE(content.find("4. line!") != string::npos);
+    ASSERT_FALSE(content.find("5. line!") != string::npos);
+    ASSERT_FALSE(content.find("6. line!") != string::npos);
   }
 
   TEST_F(LoggerTest, setLogLevel)
   {
-    ls::std::io::Logger logger{createFileLogger("output.log")};
-    logger.setLogLevel(ls::std::io::LogLevelValue::ERR);
+    Logger logger{createFileLogger("output.log")};
+    logger.setLogLevel(LogLevelValue::ERR);
 
-    ASSERT_EQ(ls::std::io::LogLevelValue::ERR, logger.getLogLevel());
+    ASSERT_EQ(LogLevelValue::ERR, logger.getLogLevel());
   }
 
   TEST_F(LoggerTest, trace)
   {
     // write to log file
 
-    ::std::string logName = "output_trace.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_trace.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::TRACE);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::TRACE);
     logger.fatal("1. line!");
     logger.error("2. line!");
     logger.warn("3. line!");
@@ -215,26 +221,26 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_TRUE(content.find("1. line!") != string::npos);
+    ASSERT_TRUE(content.find("2. line!") != string::npos);
+    ASSERT_TRUE(content.find("3. line!") != string::npos);
+    ASSERT_TRUE(content.find("4. line!") != string::npos);
+    ASSERT_TRUE(content.find("5. line!") != string::npos);
+    ASSERT_TRUE(content.find("6. line!") != string::npos);
   }
 
   TEST_F(LoggerTest, warn)
   {
     // write to log file
 
-    ::std::string logName = "output_warn.log";
-    ::std::shared_ptr<ls::std::core::interface_type::IWriter> writer = createFileLogger(logName);
+    string logName = "output_warn.log";
+    shared_ptr<IWriter> writer = createFileLogger(logName);
 
-    ls::std::io::Logger logger{writer};
-    logger.setLogLevel(ls::std::io::LogLevelValue::WARN);
+    Logger logger{writer};
+    logger.setLogLevel(LogLevelValue::WARN);
     logger.fatal("1. line!");
     logger.error("2. line!");
     logger.warn("3. line!");
@@ -244,14 +250,14 @@ namespace
 
     // get content and check
 
-    ::std::dynamic_pointer_cast<ls::std::io::FileOutputStream>(writer)->close();
-    ::std::string content = getContentFromLogFile(logName);
+    dynamic_pointer_cast<FileOutputStream>(writer)->close();
+    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);
+    ASSERT_TRUE(content.find("1. line!") != string::npos);
+    ASSERT_TRUE(content.find("2. line!") != string::npos);
+    ASSERT_TRUE(content.find("3. line!") != string::npos);
+    ASSERT_FALSE(content.find("4. line!") != string::npos);
+    ASSERT_FALSE(content.find("5. line!") != string::npos);
+    ASSERT_FALSE(content.find("6. line!") != string::npos);
   }
 }

+ 18 - 15
test/cases/io/xml/XmlAttributeTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-23
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+
 namespace
 {
   class XmlAttributeTest : public ::testing::Test
@@ -32,30 +35,30 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::XmlAttribute attribute{""};
+                     XmlAttribute attribute{""};
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlAttributeTest, getName)
   {
-    ls::std::io::XmlAttribute attribute{"id"};
+    XmlAttribute attribute{"id"};
     ASSERT_STREQ("id", attribute.getName().c_str());
   }
 
   TEST_F(XmlAttributeTest, getValue)
   {
-    ls::std::io::XmlAttribute attribute{"id"};
+    XmlAttribute attribute{"id"};
     ASSERT_TRUE(attribute.getValue().empty());
   }
 
   TEST_F(XmlAttributeTest, setName)
   {
-    ls::std::io::XmlAttribute attribute{"id"};
+    XmlAttribute attribute{"id"};
     attribute.setName("id2");
 
     ASSERT_STREQ("id2", attribute.getName().c_str());
@@ -66,19 +69,19 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::XmlAttribute attribute{"id"};
+                     XmlAttribute attribute{"id"};
                      attribute.setName("");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlAttributeTest, setValue)
   {
-    ls::std::io::XmlAttribute attribute{"id"};
+    XmlAttribute attribute{"id"};
     attribute.setValue("some_content");
 
     ASSERT_STREQ("some_content", attribute.getValue().c_str());
@@ -89,19 +92,19 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::XmlAttribute attribute{"id"};
+                     XmlAttribute attribute{"id"};
                      attribute.setValue("");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlAttributeTest, toXml)
   {
-    ls::std::io::XmlAttribute attribute{"id"};
+    XmlAttribute attribute{"id"};
     attribute.setValue("some_content");
 
     ASSERT_STREQ(R"(id="some_content")", attribute.toXml().c_str());

+ 23 - 20
test/cases/io/xml/XmlDeclarationTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-29
- * Changed:         2022-05-14
+ * Changed:         2022-11-09
  *
  * */
 
@@ -11,6 +11,9 @@
 #include <ls_std/ls_std_core.hpp>
 #include <ls_std/ls_std_io.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+
 namespace
 {
   class XmlDeclarationTest : public ::testing::Test
@@ -32,36 +35,36 @@ namespace
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::XmlDeclaration declaration{""};
+                     XmlDeclaration declaration{""};
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDeclarationTest, getEncoding)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
     ASSERT_TRUE(declaration.getEncoding().empty());
   }
 
   TEST_F(XmlDeclarationTest, getStandalone)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
     ASSERT_TRUE(declaration.getStandalone().empty());
   }
 
   TEST_F(XmlDeclarationTest, getVersion)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
     ASSERT_STREQ("1.0", declaration.getVersion().c_str());
   }
 
   TEST_F(XmlDeclarationTest, setEncoding)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     ASSERT_TRUE(declaration.getEncoding().empty());
 
@@ -71,23 +74,23 @@ namespace
 
   TEST_F(XmlDeclarationTest, setEncoding_empty_encoding)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     EXPECT_THROW({
                    try
                    {
                      declaration.setEncoding("");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDeclarationTest, setStandalone)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     ASSERT_TRUE(declaration.getStandalone().empty());
 
@@ -97,23 +100,23 @@ namespace
 
   TEST_F(XmlDeclarationTest, setStandalone_empty_standalone)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     EXPECT_THROW({
                    try
                    {
                      declaration.setStandalone("");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDeclarationTest, setVersion)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     ASSERT_FALSE(declaration.getVersion().empty());
     ASSERT_STREQ("1.0", declaration.getVersion().c_str());
@@ -124,23 +127,23 @@ namespace
 
   TEST_F(XmlDeclarationTest, setVersion_empty_version)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
 
     EXPECT_THROW({
                    try
                    {
                      declaration.setVersion("");
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDeclarationTest, toXml)
   {
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
     ASSERT_STREQ(R"(<?xml version="1.0" ?>)", declaration.toXml().c_str());
 
     declaration.setStandalone("yes");

+ 26 - 21
test/cases/io/xml/XmlDocumentTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-09-30
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include <ls_std_io_test.hpp>
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_io_test;
+
 namespace
 {
   class XmlDocumentTest : public ::testing::Test
@@ -30,85 +35,85 @@ namespace
 
   TEST_F(XmlDocumentTest, getDeclaration)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
     ASSERT_TRUE(document.getDeclaration() == nullptr);
   }
 
   TEST_F(XmlDocumentTest, getRootElement)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
     ASSERT_TRUE(document.getRootElement() == nullptr);
   }
 
   TEST_F(XmlDocumentTest, setDeclaration)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
     ASSERT_TRUE(document.getDeclaration() == nullptr);
 
-    ls::std::io::XmlDeclaration declaration{"1.0"};
-    document.setDeclaration(::std::make_shared<ls::std::io::XmlDeclaration>(declaration));
+    XmlDeclaration declaration{"1.0"};
+    document.setDeclaration(make_shared<XmlDeclaration>(declaration));
     ASSERT_TRUE(document.getDeclaration() != nullptr);
     ASSERT_STREQ("1.0", document.getDeclaration()->getVersion().c_str());
   }
 
   TEST_F(XmlDocumentTest, setDeclaration_no_reference)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
 
     EXPECT_THROW({
                    try
                    {
                      document.setDeclaration(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDocumentTest, setRootElement)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
     ASSERT_TRUE(document.getRootElement() == nullptr);
 
-    ls::std::io::XmlDeclaration declaration{"1.0"};
-    document.setRootElement(ls_std_io_test::TestDataFactory::createXmlContent());
+    XmlDeclaration declaration{"1.0"};
+    document.setRootElement(TestDataFactory::createXmlContent());
     ASSERT_TRUE(document.getRootElement() != nullptr);
     ASSERT_STREQ("dialog", document.getRootElement()->getName().c_str());
   }
 
   TEST_F(XmlDocumentTest, setRootElement_no_reference)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
 
     EXPECT_THROW({
                    try
                    {
                      document.setRootElement(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlDocumentTest, toXml)
   {
-    ls::std::io::XmlDocument document{};
+    XmlDocument document{};
 
-    ls::std::io::XmlDeclaration declaration{"1.0"};
+    XmlDeclaration declaration{"1.0"};
     declaration.setEncoding("UTF-8");
     declaration.setStandalone("yes");
-    document.setDeclaration(::std::make_shared<ls::std::io::XmlDeclaration>(declaration));
+    document.setDeclaration(make_shared<XmlDeclaration>(declaration));
 
-    document.setRootElement(ls_std_io_test::TestDataFactory::createXmlContent());
-    ::std::string xmlStream = document.toXml();
+    document.setRootElement(TestDataFactory::createXmlContent());
+    string xmlStream = document.toXml();
 
     ASSERT_TRUE(!xmlStream.empty());
 
-    ::std::string expectedXmlString = R"(<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+    string expectedXmlString = R"(<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
 <dialog name="dungeon_001">
     <dialogUnit id="001">
         <text>Hello!</text>

Datei-Diff unterdrückt, da er zu groß ist
+ 258 - 253
test/cases/io/xml/XmlNodeTest.cpp


+ 144 - 138
test/cases/io/xml/XmlParserTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-26
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,12 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::core::type;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class XmlParserTest : public ::testing::Test
@@ -21,11 +27,11 @@ namespace
       XmlParserTest() = default;
       ~XmlParserTest() override = default;
 
-      static ls::std::core::type::byte_field readXmlStateMachine()
+      static byte_field readXmlStateMachine()
       {
-        ::std::string xmlPath = ls_std_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();
+        string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+        File file{xmlPath};
+        byte_field data = FileReader{file}.read();
 
         return data;
       }
@@ -39,27 +45,27 @@ namespace
 
   TEST_F(XmlParserTest, constructor)
   {
-    ::std::shared_ptr<ls::std::io::XmlDocument> document{};
+    shared_ptr<XmlDocument> document{};
 
     EXPECT_THROW({
                    try
                    {
-                     ls::std::io::XmlParser xmlParser{document};
+                     XmlParser xmlParser{document};
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlParserTest, read)
   {
-    ls::std::io::XmlParser xmlParser{::std::make_shared<ls::std::io::XmlDocument>()};
-    ::std::list<::std::shared_ptr<ls::std::io::XmlNode>> children, statesChildren, memoryChildren, connectionChildren{};
-    ::std::list<::std::shared_ptr<ls::std::io::XmlAttribute>> attributes{};
+    XmlParser xmlParser{make_shared<XmlDocument>()};
+    list<shared_ptr<XmlNode>> children, statesChildren, memoryChildren, connectionChildren{};
+    list<shared_ptr<XmlAttribute>> attributes{};
 
-    ls::std::core::type::byte_field data = readXmlStateMachine();
+    byte_field data = readXmlStateMachine();
     xmlParser.parse(data);
 
     // check declaration
@@ -70,7 +76,7 @@ namespace
 
     // check root element
 
-    ::std::shared_ptr<ls::std::io::XmlNode> root = xmlParser.getDocument()->getRootElement();
+    shared_ptr<XmlNode> root = xmlParser.getDocument()->getRootElement();
     ASSERT_STREQ("stateMachine", root->getName().c_str());
     ASSERT_STREQ("name", root->getAttributes().front()->getName().c_str());
     ASSERT_EQ(1, root->getAttributes().size());
@@ -80,180 +86,180 @@ namespace
 
     children = root->getChildren();
     ASSERT_EQ(3, children.size());
-    ASSERT_STREQ("states", ls::std::core::STLUtils::getListElementAt(children, 0)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(children, 0)->getAttributes().empty());
-    ASSERT_STREQ("currentState", ls::std::core::STLUtils::getListElementAt(children, 1)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(children, 1)->getAttributes().empty());
-    ASSERT_STREQ("memory", ls::std::core::STLUtils::getListElementAt(children, 2)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(children, 2)->getAttributes().empty());
+    ASSERT_STREQ("states", STLUtils::getListElementAt(children, 0)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(children, 0)->getAttributes().empty());
+    ASSERT_STREQ("currentState", STLUtils::getListElementAt(children, 1)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(children, 1)->getAttributes().empty());
+    ASSERT_STREQ("memory", STLUtils::getListElementAt(children, 2)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(children, 2)->getAttributes().empty());
 
     // states
 
-    statesChildren = ls::std::core::STLUtils::getListElementAt(children, 0)->getChildren();
+    statesChildren = STLUtils::getListElementAt(children, 0)->getChildren();
     ASSERT_EQ(5, statesChildren.size());
 
-    ASSERT_STREQ("state", ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getName().c_str());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getAttributes().size());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("A", ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getValue().empty());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getChildren().size());
-    ASSERT_STREQ("connections", ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getAttributes().empty());
-    connectionChildren = ls::std::core::STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getChildren();
+    ASSERT_STREQ("state", STLUtils::getListElementAt(statesChildren, 0)->getName().c_str());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 0)->getAttributes().size());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("A", STLUtils::getListElementAt(statesChildren, 0)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 0)->getValue().empty());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 0)->getChildren().size());
+    ASSERT_STREQ("connections", STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getAttributes().empty());
+    connectionChildren = STLUtils::getListElementAt(statesChildren, 0)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
+    attributes = STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("AB", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("B", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getName().c_str());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getAttributes().size());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("B", ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getValue().empty());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getChildren().size());
-    ASSERT_STREQ("connections", ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getAttributes().empty());
-    connectionChildren = ls::std::core::STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", STLUtils::getListElementAt(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("AB", STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", STLUtils::getListElementAt(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("B", STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", STLUtils::getListElementAt(statesChildren, 1)->getName().c_str());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 1)->getAttributes().size());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("B", STLUtils::getListElementAt(statesChildren, 1)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 1)->getValue().empty());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 1)->getChildren().size());
+    ASSERT_STREQ("connections", STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getAttributes().empty());
+    connectionChildren = STLUtils::getListElementAt(statesChildren, 1)->getChildren().front()->getChildren();
     ASSERT_EQ(2, connectionChildren.size());
-    ASSERT_STREQ("connection", ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
+    attributes = STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("BC", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("C", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
-    ASSERT_STREQ("connection", ls::std::core::STLUtils::getListElementAt(connectionChildren, 1)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(connectionChildren, 1)->getValue().empty());
-    attributes = ls::std::core::STLUtils::getListElementAt(connectionChildren, 1)->getAttributes();
+    ASSERT_STREQ("connectionId", STLUtils::getListElementAt(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("BC", STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", STLUtils::getListElementAt(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("C", STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
+    ASSERT_STREQ("connection", STLUtils::getListElementAt(connectionChildren, 1)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(connectionChildren, 1)->getValue().empty());
+    attributes = STLUtils::getListElementAt(connectionChildren, 1)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("BD", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("D", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getName().c_str());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getAttributes().size());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("C", ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getValue().empty());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getChildren().size());
-    ASSERT_STREQ("connections", ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getValue().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getAttributes().empty());
-    connectionChildren = ls::std::core::STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", STLUtils::getListElementAt(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("BD", STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", STLUtils::getListElementAt(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("D", STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", STLUtils::getListElementAt(statesChildren, 2)->getName().c_str());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 2)->getAttributes().size());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("C", STLUtils::getListElementAt(statesChildren, 2)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 2)->getValue().empty());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 2)->getChildren().size());
+    ASSERT_STREQ("connections", STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getValue().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getAttributes().empty());
+    connectionChildren = STLUtils::getListElementAt(statesChildren, 2)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
+    attributes = STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("CE", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("E", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getName().c_str());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getAttributes().size());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("D", ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getAttributes().empty());
-    connectionChildren = ls::std::core::STLUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getChildren();
+    ASSERT_STREQ("connectionId", STLUtils::getListElementAt(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("CE", STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", STLUtils::getListElementAt(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("E", STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", STLUtils::getListElementAt(statesChildren, 3)->getName().c_str());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 3)->getAttributes().size());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("D", STLUtils::getListElementAt(statesChildren, 3)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getAttributes().empty());
+    connectionChildren = STLUtils::getListElementAt(statesChildren, 3)->getChildren().front()->getChildren();
     ASSERT_EQ(1, connectionChildren.size());
-    ASSERT_STREQ("connection", ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
-    attributes = ls::std::core::STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
+    ASSERT_STREQ("connection", STLUtils::getListElementAt(connectionChildren, 0)->getName().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(connectionChildren, 0)->getValue().empty());
+    attributes = STLUtils::getListElementAt(connectionChildren, 0)->getAttributes();
     ASSERT_EQ(3, attributes.size());
-    ASSERT_STREQ("connectionId", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getName().c_str());
-    ASSERT_STREQ("DE", ls::std::core::STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
-    ASSERT_STREQ("condition", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getName().c_str());
-    ASSERT_STREQ("false", ls::std::core::STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getName().c_str());
-    ASSERT_STREQ("E", ls::std::core::STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
-
-    ASSERT_STREQ("state", ls::std::core::STLUtils::getListElementAt(statesChildren, 4)->getName().c_str());
-    ASSERT_EQ(1, ls::std::core::STLUtils::getListElementAt(statesChildren, 4)->getAttributes().size());
-    ASSERT_STREQ("id", ls::std::core::STLUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getName().c_str());
-    ASSERT_STREQ("E", ls::std::core::STLUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(statesChildren, 4)->getChildren().empty());
+    ASSERT_STREQ("connectionId", STLUtils::getListElementAt(attributes, 0)->getName().c_str());
+    ASSERT_STREQ("DE", STLUtils::getListElementAt(attributes, 0)->getValue().c_str());
+    ASSERT_STREQ("condition", STLUtils::getListElementAt(attributes, 1)->getName().c_str());
+    ASSERT_STREQ("false", STLUtils::getListElementAt(attributes, 1)->getValue().c_str());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(attributes, 2)->getName().c_str());
+    ASSERT_STREQ("E", STLUtils::getListElementAt(attributes, 2)->getValue().c_str());
+
+    ASSERT_STREQ("state", STLUtils::getListElementAt(statesChildren, 4)->getName().c_str());
+    ASSERT_EQ(1, STLUtils::getListElementAt(statesChildren, 4)->getAttributes().size());
+    ASSERT_STREQ("id", STLUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getName().c_str());
+    ASSERT_STREQ("E", STLUtils::getListElementAt(statesChildren, 4)->getAttributes().front()->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(statesChildren, 4)->getChildren().empty());
 
     // current state
 
-    ASSERT_STREQ("currentState", ls::std::core::STLUtils::getListElementAt(children, 1)->getName().c_str());
-    ASSERT_STREQ("A", ls::std::core::STLUtils::getListElementAt(children, 1)->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(children, 1)->getChildren().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(children, 1)->getAttributes().empty());
+    ASSERT_STREQ("currentState", STLUtils::getListElementAt(children, 1)->getName().c_str());
+    ASSERT_STREQ("A", STLUtils::getListElementAt(children, 1)->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(children, 1)->getChildren().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(children, 1)->getAttributes().empty());
 
     // memory
 
-    memoryChildren = ls::std::core::STLUtils::getListElementAt(children, 2)->getChildren();
+    memoryChildren = STLUtils::getListElementAt(children, 2)->getChildren();
     ASSERT_EQ(3, memoryChildren.size());
 
-    ASSERT_STREQ("location", ls::std::core::STLUtils::getListElementAt(memoryChildren, 0)->getName().c_str());
-    ASSERT_STREQ("A", ls::std::core::STLUtils::getListElementAt(memoryChildren, 0)->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 0)->getChildren().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 0)->getAttributes().empty());
+    ASSERT_STREQ("location", STLUtils::getListElementAt(memoryChildren, 0)->getName().c_str());
+    ASSERT_STREQ("A", STLUtils::getListElementAt(memoryChildren, 0)->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 0)->getChildren().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 0)->getAttributes().empty());
 
-    ASSERT_STREQ("location", ls::std::core::STLUtils::getListElementAt(memoryChildren, 1)->getName().c_str());
-    ASSERT_STREQ("B", ls::std::core::STLUtils::getListElementAt(memoryChildren, 1)->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 1)->getChildren().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 1)->getAttributes().empty());
+    ASSERT_STREQ("location", STLUtils::getListElementAt(memoryChildren, 1)->getName().c_str());
+    ASSERT_STREQ("B", STLUtils::getListElementAt(memoryChildren, 1)->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 1)->getChildren().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 1)->getAttributes().empty());
 
-    ASSERT_STREQ("location", ls::std::core::STLUtils::getListElementAt(memoryChildren, 2)->getName().c_str());
-    ASSERT_STREQ("C", ls::std::core::STLUtils::getListElementAt(memoryChildren, 2)->getValue().c_str());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 2)->getChildren().empty());
-    ASSERT_TRUE(ls::std::core::STLUtils::getListElementAt(memoryChildren, 2)->getAttributes().empty());
+    ASSERT_STREQ("location", STLUtils::getListElementAt(memoryChildren, 2)->getName().c_str());
+    ASSERT_STREQ("C", STLUtils::getListElementAt(memoryChildren, 2)->getValue().c_str());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 2)->getChildren().empty());
+    ASSERT_TRUE(STLUtils::getListElementAt(memoryChildren, 2)->getAttributes().empty());
   }
 
   TEST_F(XmlParserTest, getDocument)
   {
-    ::std::string xmlPath = ls_std_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
-    ls::std::io::XmlParser xmlParser{::std::make_shared<ls::std::io::XmlDocument>()};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    XmlParser xmlParser{make_shared<XmlDocument>()};
 
     ASSERT_TRUE(xmlParser.getDocument() != nullptr);
   }
 
   TEST_F(XmlParserTest, setDocument)
   {
-    ::std::string xmlPath = ls_std_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};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
+    XmlParser xmlParser{document};
     ASSERT_TRUE(xmlParser.getDocument() == document);
 
-    document = ::std::make_shared<ls::std::io::XmlDocument>();
+    document = make_shared<XmlDocument>();
     xmlParser.setDocument(document);
     ASSERT_TRUE(xmlParser.getDocument() == document);
   }
 
   TEST_F(XmlParserTest, setDocument_no_reference)
   {
-    ::std::shared_ptr<ls::std::io::XmlDocument> document = ::std::make_shared<ls::std::io::XmlDocument>();
-    ls::std::io::XmlParser xmlParser{document};
+    shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
+    XmlParser xmlParser{document};
 
     EXPECT_THROW({
                    try
                    {
                      xmlParser.setDocument(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

+ 12 - 9
test/cases/io/xml/XmlParserTestWrapperTest.cpp

@@ -3,13 +3,16 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2021-05-20
+ * Changed:         2021-11-09
  *
  * */
 
 #include <gtest/gtest.h>
 #include <ls_std_io_test.hpp>
 
+using namespace ls_std_io_test;
+using namespace ::std;
+
 namespace
 {
   class XmlParserTestWrapperTest : public ::testing::Test
@@ -28,11 +31,11 @@ namespace
 
   TEST_F(XmlParserTestWrapperTest, readAttribute)
   {
-    ::std::pair<::std::string, ::std::string> attribute = ls_std_io_test::XmlParserTestWrapper::readAttribute(R"(name="tim")");
+    pair<string, string> attribute = XmlParserTestWrapper::readAttribute(R"(name="tim")");
     ASSERT_TRUE(attribute.first == "name");
     ASSERT_TRUE(attribute.second == "tim");
 
-    attribute = ls_std_io_test::XmlParserTestWrapper::readAttribute(R"(id="dialog_001")");
+    attribute = XmlParserTestWrapper::readAttribute(R"(id="dialog_001")");
     ASSERT_TRUE(attribute.first == "id");
     ASSERT_TRUE(attribute.second == "dialog_001");
   }
@@ -41,27 +44,27 @@ 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_io_test::XmlParserTestWrapper::readAttributes(tag);
+    string tag = R"(<?xml version="1.0" encoding="UTF-8" ?>)";
+    list<pair<string, string>> attributes = XmlParserTestWrapper::readAttributes(tag);
 
     ASSERT_EQ(2, attributes.size());
 
-    auto iterator = ::std::next(attributes.begin(), 0);
+    auto iterator = next(attributes.begin(), 0);
     ASSERT_TRUE(iterator->first == "version");
     ASSERT_TRUE(iterator->second == "1.0");
 
-    iterator = ::std::next(attributes.begin(), 1);
+    iterator = next(attributes.begin(), 1);
     ASSERT_TRUE(iterator->first == "encoding");
     ASSERT_TRUE(iterator->second == "UTF-8");
 
     // second case
 
     tag = R"(<stateMachine name="test_machine">)";
-    attributes = ls_std_io_test::XmlParserTestWrapper::readAttributes(tag);
+    attributes = XmlParserTestWrapper::readAttributes(tag);
 
     ASSERT_EQ(1, attributes.size());
 
-    iterator = ::std::next(attributes.begin(), 0);
+    iterator = next(attributes.begin(), 0);
     ASSERT_TRUE(iterator->first == "name");
     ASSERT_TRUE(iterator->second == "test_machine");
   }

+ 28 - 23
test/cases/io/xml/XmlReaderTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-10
- * Changed:         2022-05-20
+ * Changed:         2022-11-09
  *
  * */
 
@@ -12,6 +12,11 @@
 #include <ls_std/ls_std_io.hpp>
 #include "TestHelper.hpp"
 
+using namespace ls::std::core;
+using namespace ls::std::io;
+using namespace ::std;
+using namespace ls_std_test;
+
 namespace
 {
   class XmlReaderTest : public ::testing::Test
@@ -30,55 +35,55 @@ namespace
 
   TEST_F(XmlReaderTest, read)
   {
-    ::std::string xmlPath = ls_std_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
-    ls::std::io::XmlReader xmlReader{::std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(!xmlReader.read().empty());
   }
 
   TEST_F(XmlReaderTest, getDocument)
   {
-    ::std::string xmlPath = ls_std_test::TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
-    ls::std::io::XmlReader xmlReader{::std::make_shared<ls::std::io::XmlDocument>(), xmlPath};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
 
     ASSERT_TRUE(xmlReader.getDocument() != nullptr);
   }
 
   TEST_F(XmlReaderTest, setDocument)
   {
-    ::std::string xmlPath = ls_std_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};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
+    XmlReader xmlReader{document, xmlPath};
     ASSERT_TRUE(xmlReader.getDocument() == document);
 
-    document = ::std::make_shared<ls::std::io::XmlDocument>();
+    document = make_shared<XmlDocument>();
     xmlReader.setDocument(document);
     ASSERT_TRUE(xmlReader.getDocument() == document);
   }
 
   TEST_F(XmlReaderTest, setDocument_no_reference)
   {
-    ::std::string xmlPath = ls_std_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};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    shared_ptr<XmlDocument> document = make_shared<XmlDocument>();
+    XmlReader xmlReader{document, xmlPath};
 
     EXPECT_THROW({
                    try
                    {
                      xmlReader.setDocument(nullptr);
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 
   TEST_F(XmlReaderTest, setFile)
   {
-    ::std::string xmlPath = ls_std_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};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
+    File xmlFile{xmlPath};
     xmlReader.setFile(xmlFile);
 
     ASSERT_TRUE(true);
@@ -86,19 +91,19 @@ namespace
 
   TEST_F(XmlReaderTest, setFile_does_not_exist)
   {
-    ::std::string xmlPath = ls_std_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};
+    string xmlPath = TestHelper::getResourcesFolderLocation() + "state_machine_test.xml";
+    XmlReader xmlReader{make_shared<XmlDocument>(), xmlPath};
+    File xmlFile{xmlPath};
 
     EXPECT_THROW({
                    try
                    {
-                     xmlReader.setFile(ls::std::io::File{""});
+                     xmlReader.setFile(File{""});
                    }
-                   catch (const ls::std::core::IllegalArgumentException &_exception)
+                   catch (const IllegalArgumentException &_exception)
                    {
                      throw;
                    }
-                 }, ls::std::core::IllegalArgumentException);
+                 }, IllegalArgumentException);
   }
 }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.