Ver Fonte

Remove unused WrongCallException

This exception has no purpose and is now removed.
Patrick-Christopher Mattulat há 1 ano atrás
pai
commit
d3d514ccf0

+ 0 - 2
CMakeLists.txt

@@ -142,7 +142,6 @@ set(SOURCE_FILES_CORE
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IncompleteJsonException.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/IndexOutOfBoundsException.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/NullPointerException.cpp
-        ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/exception/WrongCallException.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IBoxing.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEncoding.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/core/interface/IEvaluator.cpp
@@ -253,7 +252,6 @@ if (${LS_STD_BUILD_WITH_TESTS})
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IncompleteJsonExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/IndexOutOfBoundsExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/NullPointerExceptionTest.cpp
-            ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/exception/WrongCallExceptionTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ClassTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/ConditionalFunctionExecutorTest.cpp
             ${CMAKE_CURRENT_SOURCE_DIR}/test/cases/core/LibraryVersionTest.cpp

+ 0 - 35
include/ls-std/core/exception/WrongCallException.hpp

@@ -1,35 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-10
-* Changed:         2023-02-11
-*
-* */
-
-#ifndef LS_STD_WRONG_CALL_EXCEPTION_HPP
-#define LS_STD_WRONG_CALL_EXCEPTION_HPP
-
-#include <exception>
-#include <ls-std/os/dynamic-goal.hpp>
-#include <string>
-
-namespace ls::std::core
-{
-  class LS_STD_DYNAMIC_GOAL WrongCallException : public ::std::exception // TODO: remove, really makes no sense :D
-  {
-    public:
-
-      WrongCallException();
-      explicit WrongCallException(::std::string _message);
-      ~WrongCallException() override;
-
-      [[nodiscard]] const char *what() const noexcept override;
-
-    private:
-
-      ::std::string message{};
-  };
-}
-
-#endif

+ 0 - 1
include/ls-std/ls-std-core.hpp

@@ -26,7 +26,6 @@
 #include <ls-std/core/exception/IncompleteJsonException.hpp>
 #include <ls-std/core/exception/IndexOutOfBoundsException.hpp>
 #include <ls-std/core/exception/NullPointerException.hpp>
-#include <ls-std/core/exception/WrongCallException.hpp>
 
 #include <ls-std/core/interface/IBoxing.hpp>
 #include <ls-std/core/interface/IEncoding.hpp>

+ 0 - 34
source/ls-std/core/exception/WrongCallException.cpp

@@ -1,34 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-10
-* Changed:         2023-02-10
-*
-* */
-
-#include <ls-std/core/exception/WrongCallException.hpp>
-#include <ls-std/core/exception/ExceptionMessage.hpp>
-
-ls::std::core::WrongCallException::WrongCallException() = default;
-
-ls::std::core::WrongCallException::WrongCallException(::std::string _message) : message(::std::move(_message))
-{}
-
-ls::std::core::WrongCallException::~WrongCallException() = default;
-
-const char *ls::std::core::WrongCallException::what() const noexcept
-{
-  ::std::string concatenatedMessage = "WrongCallException thrown - ";
-
-  if (this->message.empty())
-  {
-    concatenatedMessage = concatenatedMessage + "this function / method call is invalid!";
-  }
-  else
-  {
-    concatenatedMessage = concatenatedMessage + this->message;
-  }
-
-  return ExceptionMessage{concatenatedMessage}.toCharacterPointer();
-}

+ 0 - 67
test/cases/core/exception/WrongCallExceptionTest.cpp

@@ -1,67 +0,0 @@
-/*
-* Author:          Patrick-Christopher Mattulat
-* Company:         Lynar Studios
-* E-Mail:          webmaster@lynarstudios.com
-* Created:         2023-02-10
-* Changed:         2023-02-10
-*
-* */
-
-#include <gtest/gtest.h>
-#include <ls-std/ls-std-core.hpp>
-#include <string>
-
-using namespace ls::std::core;
-
-namespace
-{
- class WrongCallExceptionTest : public ::testing::Test
- {
-   protected:
-
-     WrongCallExceptionTest() = default;
-     ~WrongCallExceptionTest() override = default;
-
-     void SetUp() override
-     {}
-
-     void TearDown() override
-     {}
- };
-
- TEST_F(WrongCallExceptionTest, constructor)
- {
-   EXPECT_THROW(
-       {
-         try
-         {
-           throw WrongCallException{};
-         }
-         catch (const WrongCallException &_exception)
-         {
-           ::std::string message = _exception.what();
-           EXPECT_STREQ("WrongCallException thrown - this function / method call is invalid!", message.c_str());
-           throw;
-         }
-       },
-       WrongCallException);
- }
-
- TEST_F(WrongCallExceptionTest, constructor_dedicated_message)
- {
-   EXPECT_THROW(
-       {
-         try
-         {
-           throw WrongCallException{"method \"getValue()\" was called, although this is forbidden!"};
-         }
-         catch (const WrongCallException &_exception)
-         {
-           ::std::string message = _exception.what();
-           EXPECT_STREQ("WrongCallException thrown - method \"getValue()\" was called, although this is forbidden!", message.c_str());
-           throw;
-         }
-       },
-       WrongCallException);
- }
-}