Hello, I would like to have a test structure that looks like the following:
//Test setup
SECTION("1")
{
// Do something
// Check some values
}
SECTION("2")
{
// Do something else, that should be equivalent
// Perform exactly the same checks as before
}
My issue is that I would like not to repeat the checking code.
I tried to put it in a helper function, but apparently, REQUIRE does not work in helper functions. I moved the checking test after the two SECTIONs, but then, when a test fails, I don't know which path led to the error.
Do you have any idea of how to solve this cleanly?
---
Loïc