Kaynağa Gözat

Remove namespaces from library test class definitions

Patrick-Christopher Mattulat 1 yıl önce
ebeveyn
işleme
b9c60e05bd

+ 2 - 2
test/cases/event/NarratorTest.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2023-02-22
+ * Changed:         2023-02-23
  *
  * */
 
@@ -157,7 +157,7 @@ namespace
     ASSERT_STREQ("blue", this->mercedes2->getColor().c_str());
     ASSERT_STREQ("red", this->mercedes3->getColor().c_str());
 
-    Colour newColor{"black"};
+    Colour newColor = Colour{"black"};
     paintingMachine.tell(static_cast<const Class &>(newColor));
 
     ASSERT_STREQ("black", this->mercedes1->getColor().c_str());

+ 51 - 52
test/classes/TestHelper.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-05
-* Changed:         2023-02-08
+* Changed:         2023-02-23
 *
 * */
 
@@ -22,47 +22,46 @@
   #include <windows.h>
 #endif
 
-ls::std::test::TestHelper::TestHelper() = default;
+using ls::std::test::TestHelper;
+using std::getline;
+using std::replace;
+using std::runtime_error;
+using std::string;
+using std::stringstream;
+using std::vector;
 
-ls::std::test::TestHelper::~TestHelper() = default;
+TestHelper::TestHelper() = default;
 
-::std::string ls::std::test::TestHelper::getResourcesFolderLocation()
-{
-  return TestHelper::getTestFolderLocation() + "resources" + ls::std::test::TestHelper::_getFilePathSeparator();
-}
+TestHelper::~TestHelper() = default;
 
-::std::string ls::std::test::TestHelper::getTestFolderLocation()
+string TestHelper::getResourcesFolderLocation()
 {
-  ::std::string buildDirectory = ls::std::test::TestHelper::_getWorkingDirectory();
-  buildDirectory = ls::std::test::TestHelper::_normalizePath(buildDirectory);
-
-  return ls::std::test::TestHelper::_getParent(buildDirectory) + "test" + ls::std::test::TestHelper::_getFilePathSeparator();
+  return TestHelper::getTestFolderLocation() + "resources" + TestHelper::_getFilePathSeparator();
 }
 
-::std::string ls::std::test::TestHelper::normalize(const ::std::string &_path)
+string TestHelper::getTestFolderLocation()
 {
-  return ls::std::test::TestHelper::_normalizePath(_path);
+  string buildDirectory = TestHelper::_getWorkingDirectory();
+  buildDirectory = TestHelper::_normalizePath(buildDirectory);
+
+  return TestHelper::_getParent(buildDirectory) + "test" + TestHelper::_getFilePathSeparator();
 }
 
-char ls::std::test::TestHelper::_getFilePathSeparator()
+char TestHelper::_getFilePathSeparator()
 {
-  char separator;
-
 #ifdef _WIN32
-  separator = '\\';
+  return '\\';
 #endif
 #if defined(unix) || defined(__APPLE__)
-  separator = '/';
+  return '/';
 #endif
-
-  return separator;
 }
 
-::std::string ls::std::test::TestHelper::_getParent(const ::std::string &_path)
+string TestHelper::_getParent(const string &_path)
 {
-  ::std::string parent{};
-  ::std::vector<::std::string> subDirectoryNames = ls::std::test::TestHelper::_splitIntoSubDirectoryNames(_path);
-  const char separator = ls::std::test::TestHelper::_getFilePathSeparator();
+  string parent{};
+  vector<string> subDirectoryNames = TestHelper::_splitIntoSubDirectoryNames(_path);
+  const char separator = TestHelper::_getFilePathSeparator();
   subDirectoryNames.pop_back();
 
   for (auto const &subDirectoryName : subDirectoryNames)
@@ -73,33 +72,33 @@ char ls::std::test::TestHelper::_getFilePathSeparator()
   return parent;
 }
 
-::std::string ls::std::test::TestHelper::_getWorkingDirectory()
+string TestHelper::_getWorkingDirectory()
 {
-  ::std::string workingDirectory{};
+  string workingDirectory{};
 
 #if defined(unix) || defined(__APPLE__)
-  workingDirectory = ls::std::test::TestHelper::_getWorkingDirectoryUnix();
+  workingDirectory = TestHelper::_getWorkingDirectoryUnix();
 #endif
 #ifdef _WIN32
-  workingDirectory = ls::std::test::TestHelper::_getWorkingDirectoryWindows();
+  workingDirectory = TestHelper::_getWorkingDirectoryWindows();
 #endif
 
   return workingDirectory;
 }
 
 #if defined(unix) || defined(__APPLE__)
-::std::string ls::std::test::TestHelper::_getWorkingDirectoryUnix()
+string TestHelper::_getWorkingDirectoryUnix()
 {
-  ::std::string workingDirectory{};
+  string workingDirectory{};
   char buffer[PATH_MAX];
 
   if (getcwd(buffer, sizeof(buffer)) == nullptr)
   {
-    throw ::std::runtime_error{"invalid file operation!"};
+    throw runtime_error{"invalid file operation!"};
   }
   else
   {
-    workingDirectory = ::std::string(buffer);
+    workingDirectory = string(buffer);
   }
 
   return workingDirectory;
@@ -107,36 +106,36 @@ char ls::std::test::TestHelper::_getFilePathSeparator()
 #endif
 
 #ifdef _WIN32
-::std::string ls::std::test::TestHelper::_getWorkingDirectoryWindows()
+string TestHelper::_getWorkingDirectoryWindows()
 {
-  ::std::string workingDirectory{};
+  string workingDirectory{};
   TCHAR buffer[MAX_PATH];
 
   if (!GetCurrentDirectory(MAX_PATH, buffer))
   {
-    throw ::std::runtime_error{"invalid file operation!"};
+    throw runtime_error{"invalid file operation!"};
   }
   else
   {
-    workingDirectory = ::std::string(buffer);
+    workingDirectory = string(buffer);
   }
 
   return workingDirectory;
 }
 #endif
 
-::std::string ls::std::test::TestHelper::_normalizePath(::std::string _path)
+string TestHelper::_normalizePath(string _path)
 {
-  _path = ls::std::test::TestHelper::_replaceWrongSeparator(_path);
-  _path = ls::std::test::TestHelper::_reduceSeparators(_path);
+  _path = TestHelper::_replaceWrongSeparator(_path);
+  _path = TestHelper::_reduceSeparators(_path);
 
   return _path;
 }
 
-::std::string ls::std::test::TestHelper::_reduceSeparators(const ::std::string &_path)
+string TestHelper::_reduceSeparators(const string &_path)
 {
-  static const char separator = {ls::std::test::TestHelper::_getFilePathSeparator()};
-  ::std::string normalizedPath{};
+  static const char separator = {TestHelper::_getFilePathSeparator()};
+  string normalizedPath{};
   int index{};
 
   while (index < _path.size())
@@ -160,30 +159,30 @@ char ls::std::test::TestHelper::_getFilePathSeparator()
   return normalizedPath;
 }
 
-::std::string ls::std::test::TestHelper::_replaceWrongSeparator(::std::string _path)
+string TestHelper::_replaceWrongSeparator(string _path)
 {
   static const char unixSeparator = '/';
   static const char windowsSeparator = '\\';
 
 #if defined(unix) || defined(__APPLE__)
-  ::std::replace(_path.begin(), _path.end(), windowsSeparator, unixSeparator);
+  replace(_path.begin(), _path.end(), windowsSeparator, unixSeparator);
 #endif
 
 #ifdef _WIN32
-  ::std::replace(_path.begin(), _path.end(), unixSeparator, windowsSeparator);
+  replace(_path.begin(), _path.end(), unixSeparator, windowsSeparator);
 #endif
 
   return _path;
 }
 
-::std::vector<::std::string> ls::std::test::TestHelper::_splitIntoSubDirectoryNames(const ::std::string &_path)
+vector<string> TestHelper::_splitIntoSubDirectoryNames(const string &_path)
 {
-  ::std::vector<::std::string> subDirectoryNames{};
-  ::std::stringstream _stream{_path};
-  ::std::string subDirectoryName{};
-  const char separator = ls::std::test::TestHelper::_getFilePathSeparator();
+  vector<string> subDirectoryNames{};
+  stringstream _stream{_path};
+  string subDirectoryName{};
+  const char separator = TestHelper::_getFilePathSeparator();
 
-  while (::std::getline(_stream, subDirectoryName, separator))
+  while (getline(_stream, subDirectoryName, separator))
   {
     subDirectoryNames.push_back(subDirectoryName);
   }

+ 1 - 2
test/classes/TestHelper.hpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-15
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
@@ -24,7 +24,6 @@ namespace ls::std::test
 
       static ::std::string getResourcesFolderLocation();
       static ::std::string getTestFolderLocation();
-      static ::std::string normalize(const ::std::string &_path);
 
     private:
 

+ 6 - 3
test/classes/core/ClassWrapper.cpp

@@ -3,16 +3,19 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-05
-* Changed:         2023-02-05
+* Changed:         2023-02-23
 *
 * */
 
 #include <classes/core/ClassWrapper.hpp>
 
-test::core::ClassWrapper::ClassWrapper() : ls::std::core::Class("ClassWrapper")
+using ls::std::core::Class;
+using test::core::ClassWrapper;
+
+ClassWrapper::ClassWrapper() : Class("ClassWrapper")
 {}
 
-test::core::ClassWrapper::~ClassWrapper()
+ClassWrapper::~ClassWrapper()
 {
   Die();
 }

+ 6 - 9
test/classes/core/MathOddValidator.cpp

@@ -3,27 +3,24 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-13
-* Changed:         2023-02-13
+* Changed:         2023-02-23
 *
 * */
 
 #include "MathOddValidator.hpp"
 
-test::core::MathOddValidator::MathOddValidator() = default;
+using test::core::MathOddValidator;
 
-test::core::MathOddValidator::~MathOddValidator() = default;
+MathOddValidator::MathOddValidator() = default;
 
-bool test::core::MathOddValidator::isEven() const
-{
-  return !this->isOddNumber;
-}
+MathOddValidator::~MathOddValidator() = default;
 
-bool test::core::MathOddValidator::isOdd() const
+bool MathOddValidator::isOdd() const
 {
   return this->isOddNumber;
 }
 
-void test::core::MathOddValidator::validate(int _number)
+void MathOddValidator::validate(int _number)
 {
   this->isOddNumber = _number % 2 != 0;
 }

+ 1 - 2
test/classes/core/MathOddValidator.hpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-13
-* Changed:         2023-02-13
+* Changed:         2023-02-23
 *
 * */
 
@@ -19,7 +19,6 @@ namespace test::core
       MathOddValidator();
       ~MathOddValidator();
 
-      [[nodiscard]] bool isEven() const;
       [[nodiscard]] bool isOdd() const;
       void validate(int _number);
 

+ 8 - 4
test/classes/event/Colour.cpp

@@ -3,20 +3,24 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-05-14
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "Colour.hpp"
 
-test::event::Colour::Colour(const ::std::string &_value) : ls::std::core::Class("Colour")
+using ls::std::core::Class;
+using std::string;
+using test::event::Colour;
+
+Colour::Colour(const string &_value) : Class("Colour")
 {
   this->value = _value;
 }
 
-test::event::Colour::~Colour() = default;
+Colour::~Colour() = default;
 
-::std::string test::event::Colour::getValue() const
+string Colour::getValue() const
 {
   return this->value;
 }

+ 13 - 7
test/classes/event/DailyNewsAgency.cpp

@@ -3,21 +3,27 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "DailyNewsAgency.hpp"
 #include <ls-std/ls-std-event.hpp>
 
-test::event::DailyNewsAgency::DailyNewsAgency() : test::event::NewsAgency("DailyNewsAgency")
+using ls::std::core::Class;
+using ls::std::event::Event;
+using std::string;
+using test::event::DailyNewsAgency;
+using test::event::NewsAgency;
+
+DailyNewsAgency::DailyNewsAgency() : NewsAgency("DailyNewsAgency")
 {}
 
-test::event::DailyNewsAgency::~DailyNewsAgency() = default;
+DailyNewsAgency::~DailyNewsAgency() = default;
 
-void test::event::DailyNewsAgency::listen(const ls::std::core::Class &_info)
+void DailyNewsAgency::listen(const Class &_info)
 {
-  ls::std::event::Event event = dynamic_cast<const ls::std::event::Event &>(_info);
+  Event event = dynamic_cast<const Event &>(_info);
 
   if (event.getId() == "SeriousNewsEvent")
   {
@@ -25,12 +31,12 @@ void test::event::DailyNewsAgency::listen(const ls::std::core::Class &_info)
   }
 }
 
-void test::event::DailyNewsAgency::clear()
+void DailyNewsAgency::clear()
 {
   this->news.clear();
 }
 
-::std::string test::event::DailyNewsAgency::getNews()
+string DailyNewsAgency::getNews()
 {
   return this->news;
 }

+ 13 - 7
test/classes/event/GossipNewsAgency.cpp

@@ -3,21 +3,27 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "GossipNewsAgency.hpp"
 #include <ls-std/ls-std-event.hpp>
 
-test::event::GossipNewsAgency::GossipNewsAgency() : test::event::NewsAgency("GossipNewsAgency")
+using ls::std::core::Class;
+using ls::std::event::Event;
+using std::string;
+using test::event::GossipNewsAgency;
+using test::event::NewsAgency;
+
+GossipNewsAgency::GossipNewsAgency() : NewsAgency("GossipNewsAgency")
 {}
 
-test::event::GossipNewsAgency::~GossipNewsAgency() = default;
+GossipNewsAgency::~GossipNewsAgency() = default;
 
-void test::event::GossipNewsAgency::listen(const ls::std::core::Class &_info)
+void GossipNewsAgency::listen(const Class &_info)
 {
-  ls::std::event::Event event = dynamic_cast<const ls::std::event::Event &>(_info);
+  Event event = dynamic_cast<const Event &>(_info);
 
   if (event.getId() == "SeriousNewsEvent")
   {
@@ -30,12 +36,12 @@ void test::event::GossipNewsAgency::listen(const ls::std::core::Class &_info)
   }
 }
 
-void test::event::GossipNewsAgency::clear()
+void GossipNewsAgency::clear()
 {
   this->news.clear();
 }
 
-::std::string test::event::GossipNewsAgency::getNews()
+string GossipNewsAgency::getNews()
 {
   return this->news;
 }

+ 10 - 4
test/classes/event/GossipNewsEvent.cpp

@@ -3,16 +3,22 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "GossipNewsEvent.hpp"
 
-test::event::GossipNewsEvent::GossipNewsEvent(const ::std::string &_news) : ls::std::event::Event("GossipNewsEvent")
+using ls::std::core::type::event_parameter;
+using ls::std::event::Event;
+using std::make_pair;
+using std::string;
+using test::event::GossipNewsEvent;
+
+GossipNewsEvent::GossipNewsEvent(const string &_news) : Event("GossipNewsEvent")
 {
-  ls::std::core::type::event_parameter newsParameter = ::std::make_pair("news", _news);
+  event_parameter newsParameter = make_pair("news", _news);
   this->addParameter(newsParameter);
 }
 
-test::event::GossipNewsEvent::~GossipNewsEvent() = default;
+GossipNewsEvent::~GossipNewsEvent() = default;

+ 8 - 4
test/classes/event/NewsAgency.cpp

@@ -3,18 +3,22 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "NewsAgency.hpp"
 
-test::event::NewsAgency::NewsAgency(::std::string _agencyName) : agencyName(::std::move(_agencyName))
+using std::move;
+using std::string;
+using test::event::NewsAgency;
+
+NewsAgency::NewsAgency(string _agencyName) : agencyName(::move(_agencyName))
 {}
 
-test::event::NewsAgency::~NewsAgency() = default;
+NewsAgency::~NewsAgency() = default;
 
-::std::string test::event::NewsAgency::getName()
+string NewsAgency::getName()
 {
   return this->agencyName;
 }

+ 10 - 4
test/classes/event/SeriousNewsEvent.cpp

@@ -3,16 +3,22 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-27
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "SeriousNewsEvent.hpp"
 
-test::event::SeriousNewsEvent::SeriousNewsEvent(const ::std::string &_news) : ls::std::event::Event("SeriousNewsEvent")
+using ls::std::core::type::event_parameter;
+using ls::std::event::Event;
+using std::make_pair;
+using std::string;
+using test::event::SeriousNewsEvent;
+
+SeriousNewsEvent::SeriousNewsEvent(const string &_news) : Event("SeriousNewsEvent")
 {
-  ls::std::core::type::event_parameter newsParameter = ::std::make_pair("news", _news);
+  event_parameter newsParameter = make_pair("news", _news);
   this->addParameter(newsParameter);
 }
 
-test::event::SeriousNewsEvent::~SeriousNewsEvent() = default;
+SeriousNewsEvent::~SeriousNewsEvent() = default;

+ 10 - 6
test/classes/event/TestDataCar.cpp

@@ -3,23 +3,27 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "TestDataCar.hpp"
 
-test::event::TestDataCar::TestDataCar() : color("white")
+using std::move;
+using std::string;
+using test::event::TestDataCar;
+
+TestDataCar::TestDataCar() : color("white")
 {}
 
-test::event::TestDataCar::~TestDataCar() = default;
+TestDataCar::~TestDataCar() = default;
 
-::std::string test::event::TestDataCar::getColor()
+string TestDataCar::getColor()
 {
   return this->color;
 }
 
-void test::event::TestDataCar::setColor(::std::string _color)
+void TestDataCar::setColor(string _color)
 {
-  this->color = ::std::move(_color);
+  this->color = ::move(_color);
 }

+ 9 - 5
test/classes/event/TestDataMercedesCar.cpp

@@ -3,21 +3,25 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-11-14
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "TestDataMercedesCar.hpp"
 #include "Colour.hpp"
 
-test::event::TestDataMercedesCar::TestDataMercedesCar() : TestDataCar()
+using ls::std::core::Class;
+using test::event::Colour;
+using test::event::TestDataMercedesCar;
+
+TestDataMercedesCar::TestDataMercedesCar() : TestDataCar()
 {
   this->setColor("blue");
 }
 
-test::event::TestDataMercedesCar::~TestDataMercedesCar() = default;
+TestDataMercedesCar::~TestDataMercedesCar() = default;
 
-void test::event::TestDataMercedesCar::listen(const ls::std::core::Class &_info)
+void TestDataMercedesCar::listen(const Class &_info)
 {
-  this->setColor(dynamic_cast<const test::event::Colour &>(_info).getValue());
+  this->setColor(dynamic_cast<const Colour &>(_info).getValue());
 }

+ 11 - 6
test/classes/io/MockFileExistenceEvaluator.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-21
-* Changed:         2023-02-21
+* Changed:         2023-02-23
 *
 * */
 
@@ -11,16 +11,21 @@
 #include <ls-std/core/exception/FileNotFoundException.hpp>
 #include <string>
 
-test::io::MockFileExistenceEvaluator::MockFileExistenceEvaluator(bool _fileExists) : ls::std::core::Class("MockFileExistenceEvaluator"), fileExists(_fileExists)
+using ls::std::core::Class;
+using ls::std::core::FileNotFoundException;
+using std::string;
+using test::io::MockFileExistenceEvaluator;
+
+MockFileExistenceEvaluator::MockFileExistenceEvaluator(bool _fileExists) : Class("MockFileExistenceEvaluator"), fileExists(_fileExists)
 {}
 
-test::io::MockFileExistenceEvaluator::~MockFileExistenceEvaluator() = default;
+MockFileExistenceEvaluator::~MockFileExistenceEvaluator() = default;
 
-void test::io::MockFileExistenceEvaluator::evaluate()
+void MockFileExistenceEvaluator::evaluate()
 {
   if (!this->fileExists)
   {
-    ::std::string message = this->getClassName() + " called - this is just a simulation!";
-    throw ls::std::core::FileNotFoundException{message};
+    string message = this->getClassName() + " called - this is just a simulation!";
+    throw FileNotFoundException{message};
   }
 }

+ 5 - 3
test/classes/io/MockFileReader.cpp

@@ -3,12 +3,14 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-21
-* Changed:         2023-02-21
+* Changed:         2023-02-23
 *
 * */
 
 #include "MockFileReader.hpp"
 
-test::io::MockFileReader::MockFileReader() = default;
+using test::io::MockFileReader;
 
-test::io::MockFileReader::~MockFileReader() = default;
+MockFileReader::MockFileReader() = default;
+
+MockFileReader::~MockFileReader() = default;

+ 31 - 18
test/classes/io/section-pair/SectionPairDocumentProvider.cpp

@@ -3,7 +3,7 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-16
-* Changed:         2023-02-21
+* Changed:         2023-02-23
 *
 * */
 
@@ -11,33 +11,46 @@
 #include <classes/io/section-pair/SectionPairSectionProvider.hpp>
 #include <ls-std/ls-std-io.hpp>
 
-test::io::SectionPairDocumentProvider::SectionPairDocumentProvider() = default;
+using ls::std::core::type::byte_field;
+using ls::std::io::SectionPairDocument;
+using ls::std::io::SectionPairRow;
+using ls::std::io::SectionPairRowEnumType;
+using ls::std::io::SectionPairRowSingleValue;
+using ls::std::io::SectionPairSection;
+using std::dynamic_pointer_cast;
+using std::make_shared;
+using std::shared_ptr;
+using std::string;
+using test::io::SectionPairDocumentProvider;
+using test::io::SectionPairSectionProvider;
 
-test::io::SectionPairDocumentProvider::~SectionPairDocumentProvider() = default;
+SectionPairDocumentProvider::SectionPairDocumentProvider() = default;
 
-::std::shared_ptr<ls::std::io::SectionPairDocument> test::io::SectionPairDocumentProvider::createDocument()
+SectionPairDocumentProvider::~SectionPairDocumentProvider() = default;
+
+shared_ptr<SectionPairDocument> SectionPairDocumentProvider::createDocument()
 {
-  ::std::shared_ptr<ls::std::io::SectionPairDocument> document = ::std::make_shared<ls::std::io::SectionPairDocument>();
+  shared_ptr<SectionPairDocument> document = make_shared<SectionPairDocument>();
 
   // general section
 
-  ::std::shared_ptr<ls::std::io::SectionPairSection> generalSection = test::io::SectionPairSectionProvider::createSectionWithSandraExample();
+  shared_ptr<SectionPairSection> generalSection = SectionPairSectionProvider::createSectionWithSandraExample();
   document->add(generalSection);
 
   // physical
 
-  ::std::shared_ptr<ls::std::io::SectionPairSection> physicalSection = ::std::make_shared<ls::std::io::SectionPairSection>("physical");
+  shared_ptr<SectionPairSection> physicalSection = make_shared<SectionPairSection>("physical");
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> eyeColor = ::std::make_shared<ls::std::io::SectionPairRow>("eye-color", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(eyeColor->getValue())->set("blue");
+  shared_ptr<SectionPairRow> eyeColor = make_shared<SectionPairRow>("eye-color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(eyeColor->getValue())->set("blue");
   physicalSection->add(eyeColor);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> hairColor = ::std::make_shared<ls::std::io::SectionPairRow>("hair-color", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(hairColor->getValue())->set("red");
+  shared_ptr<SectionPairRow> hairColor = make_shared<SectionPairRow>("hair-color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(hairColor->getValue())->set("red");
   physicalSection->add(hairColor);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> height = ::std::make_shared<ls::std::io::SectionPairRow>("height", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(height->getValue())->set("167");
+  shared_ptr<SectionPairRow> height = make_shared<SectionPairRow>("height", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(height->getValue())->set("167");
   physicalSection->add(height);
 
   document->add(physicalSection);
@@ -45,13 +58,13 @@ test::io::SectionPairDocumentProvider::~SectionPairDocumentProvider() = default;
   return document;
 }
 
-ls::std::core::type::byte_field test::io::SectionPairDocumentProvider::createSerializedDocument(const ::std::string &_newLine)
+byte_field SectionPairDocumentProvider::createSerializedDocument(const string &_newLine)
 {
-  ls::std::core::type::byte_field serializedDocument = "# section-pair document" + _newLine;
+  byte_field serializedDocument = "# section-pair document" + _newLine;
 
   // general section
 
-  serializedDocument += test::io::SectionPairSectionProvider::createSerializedSectionWithSandraExample(_newLine);
+  serializedDocument += SectionPairSectionProvider::createSerializedSectionWithSandraExample(_newLine);
 
   // physical
 
@@ -63,9 +76,9 @@ ls::std::core::type::byte_field test::io::SectionPairDocumentProvider::createSer
   return serializedDocument;
 }
 
-ls::std::core::type::byte_field test::io::SectionPairDocumentProvider::createSerializedDocumentComputerExample(const ::std::string &_newLine)
+byte_field SectionPairDocumentProvider::createSerializedDocumentComputerExample(const string &_newLine)
 {
-  ls::std::core::type::byte_field serializedDocument = "# section-pair document" + _newLine;
+  byte_field serializedDocument = "# section-pair document" + _newLine;
   serializedDocument += _newLine + "[model]" + _newLine + _newLine;
   serializedDocument += "graphics-card=GTX 720" + _newLine;
   serializedDocument += "ram-size=4096" + _newLine;

+ 40 - 28
test/classes/io/section-pair/SectionPairSectionProvider.cpp

@@ -3,61 +3,73 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-15
-* Changed:         2023-02-17
+* Changed:         2023-02-23
 *
 * */
 
 #include "SectionPairSectionProvider.hpp"
 
-test::io::SectionPairSectionProvider::SectionPairSectionProvider() = default;
+using ls::std::core::type::byte_field;
+using ls::std::io::SectionPairRow;
+using ls::std::io::SectionPairRowEnumType;
+using ls::std::io::SectionPairRowListValue;
+using ls::std::io::SectionPairRowSingleValue;
+using ls::std::io::SectionPairSection;
+using std::dynamic_pointer_cast;
+using std::make_shared;
+using std::shared_ptr;
+using std::string;
+using test::io::SectionPairSectionProvider;
 
-test::io::SectionPairSectionProvider::~SectionPairSectionProvider() = default;
+SectionPairSectionProvider::SectionPairSectionProvider() = default;
 
-::std::shared_ptr<ls::std::io::SectionPairSection> test::io::SectionPairSectionProvider::createSectionWithSandraExample()
+SectionPairSectionProvider::~SectionPairSectionProvider() = default;
+
+shared_ptr<SectionPairSection> SectionPairSectionProvider::createSectionWithSandraExample()
 {
-  ::std::shared_ptr<ls::std::io::SectionPairSection> generalSection = ::std::make_shared<ls::std::io::SectionPairSection>("general");
+  shared_ptr<SectionPairSection> generalSection = make_shared<SectionPairSection>("general");
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> name = ::std::make_shared<ls::std::io::SectionPairRow>("name", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(name->getValue())->set("Sandra");
+  shared_ptr<SectionPairRow> name = make_shared<SectionPairRow>("name", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(name->getValue())->set("Sandra");
   generalSection->add(name);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> age = ::std::make_shared<ls::std::io::SectionPairRow>("age", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(age->getValue())->set("24");
+  shared_ptr<SectionPairRow> age = make_shared<SectionPairRow>("age", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(age->getValue())->set("24");
   generalSection->add(age);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> hobbies = ::std::make_shared<ls::std::io::SectionPairRow>("hobbies", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowListValue>(hobbies->getValue())->add("swimming");
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowListValue>(hobbies->getValue())->add("cycling");
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowListValue>(hobbies->getValue())->add("singing");
+  shared_ptr<SectionPairRow> hobbies = make_shared<SectionPairRow>("hobbies", SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
+  dynamic_pointer_cast<SectionPairRowListValue>(hobbies->getValue())->add("swimming");
+  dynamic_pointer_cast<SectionPairRowListValue>(hobbies->getValue())->add("cycling");
+  dynamic_pointer_cast<SectionPairRowListValue>(hobbies->getValue())->add("singing");
   generalSection->add(hobbies);
 
   return generalSection;
 }
 
-::std::shared_ptr<ls::std::io::SectionPairSection> test::io::SectionPairSectionProvider::createSectionWithTomExample()
+shared_ptr<SectionPairSection> SectionPairSectionProvider::createSectionWithTomExample()
 {
-  ::std::shared_ptr<ls::std::io::SectionPairSection> section = ::std::make_shared<ls::std::io::SectionPairSection>("general");
+  shared_ptr<SectionPairSection> section = make_shared<SectionPairSection>("general");
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> name = ::std::make_shared<ls::std::io::SectionPairRow>("name", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(name->getValue())->set("Tom");
+  shared_ptr<SectionPairRow> name = make_shared<SectionPairRow>("name", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(name->getValue())->set("Tom");
   section->add(name);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> jobs = ::std::make_shared<ls::std::io::SectionPairRow>("jobs", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
-  ::std::shared_ptr<ls::std::io::SectionPairRowListValue> jobList = ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowListValue>(jobs->getValue());
+  shared_ptr<SectionPairRow> jobs = make_shared<SectionPairRow>("jobs", SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
+  shared_ptr<SectionPairRowListValue> jobList = dynamic_pointer_cast<SectionPairRowListValue>(jobs->getValue());
   jobList->add("Farmer");
   jobList->add("Bounty Hunter");
   section->add(jobs);
 
-  ::std::shared_ptr<ls::std::io::SectionPairRow> age = ::std::make_shared<ls::std::io::SectionPairRow>("age", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
-  ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(age->getValue())->set("33");
+  shared_ptr<SectionPairRow> age = make_shared<SectionPairRow>("age", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  dynamic_pointer_cast<SectionPairRowSingleValue>(age->getValue())->set("33");
   section->add(age);
 
   return section;
 }
 
-ls::std::core::type::byte_field test::io::SectionPairSectionProvider::createSerializedSectionWithSandraExample(const ::std::string &_newLine)
+byte_field SectionPairSectionProvider::createSerializedSectionWithSandraExample(const string &_newLine)
 {
-  ls::std::core::type::byte_field serializedDocument{};
+  byte_field serializedDocument{};
 
   serializedDocument += _newLine + "[general]" + _newLine + _newLine;
   serializedDocument += "name=Sandra" + _newLine;
@@ -70,12 +82,12 @@ ls::std::core::type::byte_field test::io::SectionPairSectionProvider::createSeri
   return serializedDocument;
 }
 
-ls::std::core::type::byte_field test::io::SectionPairSectionProvider::createSerializedSectionWithTomExample(const ::std::string &_newLine)
+byte_field SectionPairSectionProvider::createSerializedSectionWithTomExample(const string &_newLine)
 {
-  ls::std::core::type::byte_field serializedSection = _newLine + "[general]" + _newLine + _newLine;
-  ls::std::core::type::byte_field serializedNameRow = "name=Tom" + _newLine;
-  ls::std::core::type::byte_field serializedJobsRow = "jobs:" + _newLine + "  Farmer" + _newLine + "  Bounty Hunter" + _newLine;
-  ls::std::core::type::byte_field serializedAgeRow = "age=33" + _newLine;
+  byte_field serializedSection = _newLine + "[general]" + _newLine + _newLine;
+  byte_field serializedNameRow = "name=Tom" + _newLine;
+  byte_field serializedJobsRow = "jobs:" + _newLine + "  Farmer" + _newLine + "  Bounty Hunter" + _newLine;
+  byte_field serializedAgeRow = "age=33" + _newLine;
 
   return serializedSection + serializedNameRow + serializedJobsRow + serializedAgeRow;
 }

+ 33 - 21
test/classes/io/section-pair/SerializableSectionPairRowProvider.cpp

@@ -3,58 +3,70 @@
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2023-02-17
-* Changed:         2023-02-17
+* Changed:         2023-02-23
 *
 * */
 
 #include "SerializableSectionPairRowProvider.hpp"
 
-test::io::SerializableSectionPairRowProvider::SerializableSectionPairRowProvider() = default;
+using ls::std::io::SectionPairRow;
+using ls::std::io::SectionPairRowEnumType;
+using ls::std::io::SectionPairRowListValue;
+using ls::std::io::SectionPairRowSingleValue;
+using ls::std::io::SerializableSectionPairParameter;
+using ls::std::io::SerializableSectionPairRow;
+using std::dynamic_pointer_cast;
+using std::make_shared;
+using std::shared_ptr;
+using std::string;
+using test::io::SerializableSectionPairRowProvider;
 
-test::io::SerializableSectionPairRowProvider::~SerializableSectionPairRowProvider() = default;
+SerializableSectionPairRowProvider::SerializableSectionPairRowProvider() = default;
 
-::std::shared_ptr<ls::std::io::SerializableSectionPairRow> test::io::SerializableSectionPairRowProvider::createListValueForMarshal(const ::std::string &_newLine)
+SerializableSectionPairRowProvider::~SerializableSectionPairRowProvider() = default;
+
+shared_ptr<SerializableSectionPairRow> SerializableSectionPairRowProvider::createListValueForMarshal(const string &_newLine)
 {
-  ls::std::io::SerializableSectionPairParameter parameter{};
+  SerializableSectionPairParameter parameter{};
   parameter.setNewLine(_newLine);
-  ::std::shared_ptr<ls::std::io::SectionPairRow> row = ::std::make_shared<ls::std::io::SectionPairRow>("favourite-colors", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
+  shared_ptr<SectionPairRow> row = make_shared<SectionPairRow>("favourite-colors", SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
   parameter.setValue(row);
-  ::std::shared_ptr<ls::std::io::SectionPairRowListValue> listValue = ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowListValue>(row->getValue());
+  shared_ptr<SectionPairRowListValue> listValue = dynamic_pointer_cast<SectionPairRowListValue>(row->getValue());
   listValue->add("blue");
   listValue->add("red");
   listValue->add("purple");
 
-  return ::std::make_shared<ls::std::io::SerializableSectionPairRow>(parameter);
+  return make_shared<SerializableSectionPairRow>(parameter);
 }
 
-::std::shared_ptr<ls::std::io::SerializableSectionPairRow> test::io::SerializableSectionPairRowProvider::createListValueForUnmarshal(const ::std::string &_newLine)
+shared_ptr<SerializableSectionPairRow> SerializableSectionPairRowProvider::createListValueForUnmarshal(const string &_newLine)
 {
-  ls::std::io::SerializableSectionPairParameter parameter{};
+  SerializableSectionPairParameter parameter{};
   parameter.setNewLine(_newLine);
-  ::std::shared_ptr<ls::std::io::SectionPairRow> row = ::std::make_shared<ls::std::io::SectionPairRow>("tmp-key", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
+  shared_ptr<SectionPairRow> row = make_shared<SectionPairRow>("tmp-key", SectionPairRowEnumType::SECTION_PAIR_ROW_LIST_VALUE);
   parameter.setValue(row);
 
-  return ::std::make_shared<ls::std::io::SerializableSectionPairRow>(parameter);
+  return make_shared<SerializableSectionPairRow>(parameter);
 }
 
-::std::shared_ptr<ls::std::io::SerializableSectionPairRow> test::io::SerializableSectionPairRowProvider::createSingleValueForMarshal(const ::std::string &_newLine)
+shared_ptr<SerializableSectionPairRow> SerializableSectionPairRowProvider::createSingleValueForMarshal(const string &_newLine)
 {
-  ls::std::io::SerializableSectionPairParameter parameter{};
+  SerializableSectionPairParameter parameter{};
   parameter.setNewLine(_newLine);
-  ::std::shared_ptr<ls::std::io::SectionPairRow> row = ::std::make_shared<ls::std::io::SectionPairRow>("favourite-color", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  shared_ptr<SectionPairRow> row = make_shared<SectionPairRow>("favourite-color", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
   parameter.setValue(row);
-  ::std::shared_ptr<ls::std::io::SectionPairRowSingleValue> singleValue = ::std::dynamic_pointer_cast<ls::std::io::SectionPairRowSingleValue>(row->getValue());
+  shared_ptr<SectionPairRowSingleValue> singleValue = dynamic_pointer_cast<SectionPairRowSingleValue>(row->getValue());
   singleValue->set("blue");
 
-  return ::std::make_shared<ls::std::io::SerializableSectionPairRow>(parameter);
+  return make_shared<SerializableSectionPairRow>(parameter);
 }
 
-::std::shared_ptr<ls::std::io::SerializableSectionPairRow> test::io::SerializableSectionPairRowProvider::createSingleValueForUnmarshal(const ::std::string &_newLine)
+shared_ptr<SerializableSectionPairRow> SerializableSectionPairRowProvider::createSingleValueForUnmarshal(const string &_newLine)
 {
-  ls::std::io::SerializableSectionPairParameter parameter{};
+  SerializableSectionPairParameter parameter{};
   parameter.setNewLine(_newLine);
-  ::std::shared_ptr<ls::std::io::SectionPairRow> row = ::std::make_shared<ls::std::io::SectionPairRow>("tmp-key", ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
+  shared_ptr<SectionPairRow> row = make_shared<SectionPairRow>("tmp-key", SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE);
   parameter.setValue(row);
 
-  return ::std::make_shared<ls::std::io::SerializableSectionPairRow>(parameter);
+  return make_shared<SerializableSectionPairRow>(parameter);
 }

+ 21 - 15
test/classes/io/xml/TestDataFactory.cpp

@@ -3,41 +3,47 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2022-05-14
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "TestDataFactory.hpp"
 
-test::io::TestDataFactory::TestDataFactory() = default;
+using ls::std::io::XmlAttribute;
+using ls::std::io::XmlNode;
+using std::make_shared;
+using std::shared_ptr;
+using test::io::TestDataFactory;
 
-test::io::TestDataFactory::~TestDataFactory() = default;
+TestDataFactory::TestDataFactory() = default;
 
-::std::shared_ptr<ls::std::io::XmlNode> test::io::TestDataFactory::createXmlContent()
+TestDataFactory::~TestDataFactory() = default;
+
+shared_ptr<XmlNode> TestDataFactory::createXmlContent()
 {
-  ::std::shared_ptr<ls::std::io::XmlNode> root = ::std::make_shared<ls::std::io::XmlNode>("dialog");
-  ::std::shared_ptr<ls::std::io::XmlAttribute> attribute{};
-  ::std::shared_ptr<ls::std::io::XmlNode> child{};
-  ::std::shared_ptr<ls::std::io::XmlNode> text{};
+  shared_ptr<XmlNode> root = make_shared<XmlNode>("dialog");
+  shared_ptr<XmlAttribute> attribute{};
+  shared_ptr<XmlNode> child{};
+  shared_ptr<XmlNode> text{};
 
-  attribute = ::std::make_shared<ls::std::io::XmlAttribute>("name");
+  attribute = make_shared<XmlAttribute>("name");
   attribute->setValue("dungeon_001");
   root->addAttributeToEnd(attribute);
 
-  child = ::std::make_shared<ls::std::io::XmlNode>("dialogUnit");
-  attribute = ::std::make_shared<ls::std::io::XmlAttribute>("id");
+  child = make_shared<XmlNode>("dialogUnit");
+  attribute = make_shared<XmlAttribute>("id");
   attribute->setValue("001");
   child->addAttributeToEnd(attribute);
-  text = ::std::make_shared<ls::std::io::XmlNode>("text");
+  text = make_shared<XmlNode>("text");
   text->setValue("Hello!");
   child->addChildToEnd(text);
   root->addChildToEnd(child);
 
-  child = ::std::make_shared<ls::std::io::XmlNode>("dialogUnit");
-  attribute = ::std::make_shared<ls::std::io::XmlAttribute>("id");
+  child = make_shared<XmlNode>("dialogUnit");
+  attribute = make_shared<XmlAttribute>("id");
   attribute->setValue("002");
   child->addAttributeToEnd(attribute);
-  text = ::std::make_shared<ls::std::io::XmlNode>("text");
+  text = make_shared<XmlNode>("text");
   text->setValue("Hello again!");
   child->addChildToEnd(text);
   root->addChildToEnd(child);

+ 15 - 7
test/classes/io/xml/XmlParserTestWrapper.cpp

@@ -3,23 +3,31 @@
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-10-18
- * Changed:         2023-02-05
+ * Changed:         2023-02-23
  *
  * */
 
 #include "XmlParserTestWrapper.hpp"
 
-test::io::XmlParserTestWrapper::XmlParserTestWrapper() : ls::std::io::XmlParser(nullptr)
+using ls::std::core::type::byte_field;
+using ls::std::io::XmlParser;
+using std::list;
+using std::move;
+using std::pair;
+using std::string;
+using test::io::XmlParserTestWrapper;
+
+XmlParserTestWrapper::XmlParserTestWrapper() : XmlParser(nullptr)
 {}
 
-test::io::XmlParserTestWrapper::~XmlParserTestWrapper() = default;
+XmlParserTestWrapper::~XmlParserTestWrapper() = default;
 
-::std::pair<::std::string, ::std::string> test::io::XmlParserTestWrapper::readAttribute(const ls::std::core::type::byte_field &_data)
+pair<string, string> XmlParserTestWrapper::readAttribute(const byte_field &_data)
 {
-  return ls::std::io::XmlParser::_readAttribute_(_data);
+  return XmlParser::_readAttribute_(_data);
 }
 
-::std::list<::std::pair<::std::string, ::std::string>> test::io::XmlParserTestWrapper::readAttributes(ls::std::core::type::byte_field _data)
+list<pair<string, string>> XmlParserTestWrapper::readAttributes(byte_field _data)
 {
-  return ls::std::io::XmlParser::_readAttributes_(::std::move(_data));
+  return XmlParser::_readAttributes_(::move(_data));
 }