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

Asserts that two values are equal.

For normal values, both arguments must have the same unqualified type and are compared with operator==. C string forms are handled specially so text is compared instead of pointer identity. This allows practical checks like comparing char const* with a string literal.

#include <string>
#include <kaycxx/test.hpp>
using namespace kaycxx::test;
int main() {
assert_equal(40 + 2, 42);
auto name = std::string{"Kay"};
assert_equal(name, "Kay");
}
Unit test framework functions and types.
Definition test.hpp:15
Includes the complete public test API.

On failure, the exception message includes rendered actual and expected values.