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