You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, inside RapidCheck tests, it is necessary to assert using RC_ASSERT, and inside GTest tests it is necessary to use EXPECT_EQ and whatnot.
However, I would like to write utility functions that work in both contexts, to combine the power of property testing with standard corner-case testing. If I use EXPECT_EQ, then that breaks the RapidCheck tests, and if I use RC_ASSERT, then the GTest tests won't tell me the line number or the error that occurred:
unknown file: failure
Unknown c++ exception thrown in the test body.
Ideally there would be a way to know if the current scope was inside or outside a RapidCheck test. Then there could be a macro RCGT_ASSERT(), which calls RC_ASSERT if it's inside a RapidCheck test, and calls the GTest assert if it's outside of a RapidCheck test.
The text was updated successfully, but these errors were encountered:
rc::detail::ImplicitParam<CurrentPropertyContext>::value() != rc::detail::CurrentPropertyContext::defaultValue() will be true if you are in a property. I would welcome a pull request for at least a function that can be used for checking this.
@emil-e I'll take a look at it. I would want to also generate the same debugging message that RC_ASSERT does inside of a RapidCheck test. Could you point me in the right direction for how to extract that message from the exception that RC_ASSERT throws?
Right now, inside RapidCheck tests, it is necessary to assert using RC_ASSERT, and inside GTest tests it is necessary to use EXPECT_EQ and whatnot.
However, I would like to write utility functions that work in both contexts, to combine the power of property testing with standard corner-case testing. If I use EXPECT_EQ, then that breaks the RapidCheck tests, and if I use RC_ASSERT, then the GTest tests won't tell me the line number or the error that occurred:
Ideally there would be a way to know if the current scope was inside or outside a RapidCheck test. Then there could be a macro RCGT_ASSERT(), which calls RC_ASSERT if it's inside a RapidCheck test, and calls the GTest assert if it's outside of a RapidCheck test.
The text was updated successfully, but these errors were encountered: