kaycxx-test
C++ unit test framework
Loading...
Searching...
No Matches
assert_not_null

Asserts that a raw pointer value is not null.

This assertion is intentionally limited to raw pointers and std::nullptr_t. It does not treat smart pointers or arbitrary nullable-looking classes as null values.

#include <kaycxx/test.hpp>
using namespace kaycxx::test;
int main() {
auto value = 42;
auto pointer = &value;
assert_not_null(pointer);
}
Unit test framework functions and types.
Definition test.hpp:15
Includes the complete public test API.

Use this instead of assert_true(pointer != nullptr) so failures report the pointer value as a nullness assertion.