Suppress failure of CHECKED_IF and CHECKED_ELSE (#2187)

Resolves #1390

Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
Jozef Grajciar
2021-05-10 21:42:47 +02:00
committed by GitHub
parent 313071e8fe
commit eb911aa995
14 changed files with 246 additions and 71 deletions

View File

@@ -182,6 +182,39 @@ TEST_CASE( "checkedElse, failing", "[failing][.]" ) {
REQUIRE( testCheckedElse( false ) );
}
TEST_CASE("Testing checked-if", "[checked-if]") {
CHECKED_IF(true) {
SUCCEED();
}
CHECKED_IF(false) {
FAIL();
}
CHECKED_ELSE(true) {
FAIL();
}
CHECKED_ELSE(false) {
SUCCEED();
}
}
TEST_CASE("Testing checked-if 2", "[checked-if][!shouldfail]") {
CHECKED_IF(true) {
FAIL();
}
// If the checked if is not entered, this passes and the test
// fails, because of the [!shouldfail] tag.
SUCCEED();
}
TEST_CASE("Testing checked-if 3", "[checked-if][!shouldfail]") {
CHECKED_ELSE(false) {
FAIL();
}
// If the checked false is not entered, this passes and the test
// fails, because of the [!shouldfail] tag.
SUCCEED();
}
TEST_CASE( "xmlentitycheck" ) {
SECTION( "embedded xml: <test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" ) {
SUCCEED(); // We need this here to stop it failing due to no tests