hpx icon indicating copy to clipboard operation
hpx copied to clipboard

Add assertion macros that print their values

Open msimberg opened this issue 6 years ago • 6 comments

Having alternative assertion macros in the style of

HPX_ASSERT_EQ(x, 3);

which print the value of x when the assertion fails would be nice to have to make debugging slightly easier/faster.

msimberg avatar Apr 23 '19 10:04 msimberg

Sounds like a feature for the assert module sitting in the pipeline ;-)

hkaiser avatar Apr 23 '19 13:04 hkaiser

Sounds like a feature for the assert module sitting in the pipeline ;-)

Indeed!

msimberg avatar Apr 23 '19 15:04 msimberg

Hi folks: Can I PR or is the ticket for internal folks?

tapaswenipathak avatar Sep 04 '19 12:09 tapaswenipathak

@tapaswenipathak feel free to work on this. You might want to have a look at what's in the testing module: https://github.com/STEllAR-GROUP/hpx/blob/master/libs/testing/include/hpx/testing.hpp. We should try to avoid duplicating functionality in both modules.

msimberg avatar Sep 04 '19 12:09 msimberg

feel free to work on this. You might want to have a look at what's in the testing module: https://github.com/STEllAR-GROUP/hpx/blob/master/libs/testing/include/hpx/testing.hpp. We should try to avoid duplicating functionality in both modules.

We should keep in mind that testing is different from using assertions. If those can share functionalities - fine. I think this is not a requirement, though.

hkaiser avatar Sep 04 '19 12:09 hkaiser

Thanks for the brain dump folks, I didn't read much, I think I can PR that macro out. I will ask if I have any questions, thanks.

tapaswenipathak avatar Sep 04 '19 12:09 tapaswenipathak