Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHECK_MESSAGE no longer works with DOCTEST_CONFIG_SUPER_FAST_ASSERTS #280

Closed
u3shit opened this issue Aug 24, 2019 · 2 comments
Closed

CHECK_MESSAGE no longer works with DOCTEST_CONFIG_SUPER_FAST_ASSERTS #280

u3shit opened this issue Aug 24, 2019 · 2 comments

Comments

@u3shit
Copy link

u3shit commented Aug 24, 2019

Description

While updating doctest, CHECK_MESSAGE broke and it causes a compilation failure. It looks like it was broke in c494843, it works in 2.1.0 while in 2.2.0 it fails with an error:

foo2.cpp:8:3: error: use of undeclared identifier 'DT_CHECK'
  CHECK_MESSAGE(x == 0, "Boo boo");
  ^
./doctest/doctest.h:2476:23: note: expanded from macro 'CHECK_MESSAGE'
#define CHECK_MESSAGE DOCTEST_CHECK_MESSAGE
                      ^
./doctest/doctest.h:2022:93: note: expanded from macro 'DOCTEST_CHECK_MESSAGE'
#define DOCTEST_CHECK_MESSAGE(cond, msg) do { DOCTEST_INFO(msg); DOCTEST_ASSERT_IMPLEMENT_2(DT_CHECK, cond); } while((void)0, 0)
                                                                                            ^
1 error generated.

I get the same error with 2.3.4.

Steps to reproduce

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#define DOCTEST_CONFIG_SUPER_FAST_ASSERTS
#include <doctest/doctest.h>

TEST_CASE("x")
{
  int x = 2;
  CHECK_MESSAGE(x == 0, "Boo boo");
}

Compile with clang++ without any special flags.

  • doctest version: v2.3.4
  • Operating System: Gentoo Linux amd64
  • Compiler+version: clang 8.0.1 (both with libc++ and gcc's libstdc++)
u3shit added a commit to u3shit/libshit that referenced this issue Aug 24, 2019
onqtam pushed a commit that referenced this issue Aug 25, 2019
@onqtam
Copy link
Member

onqtam commented Aug 25, 2019

Thanks for reporting this regression!

fixed in the dev branch - you can use it from there immediately. I'll release 2.3.5... at some point :)

@u3shit
Copy link
Author

u3shit commented Aug 25, 2019

I can confirm that my sample is now working with the dev branch 👍. I can't test it with my real code right now because of the two other bugs I've opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants