123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-05-24
- * Changed: 2024-05-31
- *
- * */
- #include <gtest/gtest.h>
- #include <ls-std/ls-std-core.hpp>
- using ls::std::core::NullPointerException;
- using ls::std::core::RawNullPointerEvaluator;
- using ls::std::core::type::RawPointer;
- using std::string;
- using testing::Test;
- namespace
- {
- class RawNullPointerEvaluatorTest : public Test
- {
- public:
- RawNullPointerEvaluatorTest() = default;
- ~RawNullPointerEvaluatorTest() override = default;
- };
- TEST_F(RawNullPointerEvaluatorTest, evaluate_raw_pointer)
- {
- EXPECT_THROW(
- {
- try
- {
- RawNullPointerEvaluator{RawPointer<void>{nullptr}}.evaluate();
- }
- catch (const NullPointerException &_exception)
- {
- const string actual = _exception.what();
- const string expected = _exception.getName() + " thrown - reference in use is null!";
- ASSERT_STREQ(expected.c_str(), actual.c_str());
- throw;
- }
- },
- NullPointerException);
- }
- }
|