RawNullPointerArgumentEvaluatorTest.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2023-05-23
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #include <gtest/gtest.h>
  11. #include <ls-std/ls-std-core.hpp>
  12. using ls::standard::core::IllegalArgumentException;
  13. using ls::standard::core::RawNullPointerArgumentEvaluator;
  14. using ls::standard::core::type::RawPointer;
  15. using std::string;
  16. using testing::Test;
  17. namespace
  18. {
  19. class RawNullPointerArgumentEvaluatorTest : public Test
  20. {
  21. public:
  22. RawNullPointerArgumentEvaluatorTest() = default;
  23. ~RawNullPointerArgumentEvaluatorTest() override = default;
  24. };
  25. TEST_F(RawNullPointerArgumentEvaluatorTest, evaluate_raw_pointer)
  26. {
  27. EXPECT_THROW(
  28. {
  29. try
  30. {
  31. RawNullPointerArgumentEvaluator<void>{RawPointer<void>{nullptr}}.evaluate();
  32. }
  33. catch (const IllegalArgumentException &_exception)
  34. {
  35. const string actual = _exception.what();
  36. const string expected = _exception.getName() + " thrown - passed argument is null!";
  37. ASSERT_STREQ(expected.c_str(), actual.c_str());
  38. throw;
  39. }
  40. },
  41. IllegalArgumentException);
  42. }
  43. }