We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I was trying to test a string view default constructor and to see if the pointer was indeed null. Since I've assigned nullptr to it.
nullptr
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "doctest.h" struct test { const char * ptr; test() : ptr(nullptr) { } const char * get() const { return ptr; } }; TEST_CASE("dummy") { test o; FAST_REQUIRE_NE(o.get(), nullptr); }
Output:
src\main.cpp(15) TEST CASE: dummy src\main.cpp(19) FATAL ERROR! FAST_REQUIRE_NE( o.get(), nullptr ) with expansion: FAST_REQUIRE_NE( NULL, nullptr )
Am I required to use NULL instead of nullptr ? Because I would prefer the later.
NULL
The text was updated successfully, but these errors were encountered:
Seems to work if i use CHECK(o.get() == nullptr); I guess I should use that instead. But still bothers me why the first approach failed.
CHECK(o.get() == nullptr);
Sorry, something went wrong.
Never mind. I was too focused on the error to notice my copy/paste mistake. As I was testing NE instead of EQ. My apologies.
NE
EQ
Glad you solved the issue :)
No branches or pull requests
Description
I was trying to test a string view default constructor and to see if the pointer was indeed null. Since I've assigned
nullptr
to it.Steps to reproduce
Output:
Am I required to use
NULL
instead ofnullptr
? Because I would prefer the later.Extra information
The text was updated successfully, but these errors were encountered: