mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Deprecated description in SECTION (still accepts it, for now, but doesn't use it anywhere)
This commit is contained in:
@@ -67,12 +67,12 @@ TEST_CASE( "random SECTION tests", "[.][sections][failing]" ) {
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
|
||||
SECTION( "s1", "doesn't equal" ) {
|
||||
SECTION( "doesn't equal" ) {
|
||||
REQUIRE( a != b );
|
||||
REQUIRE( b != a );
|
||||
}
|
||||
|
||||
SECTION( "s2", "not equal" ) {
|
||||
SECTION( "not equal" ) {
|
||||
REQUIRE( a != b);
|
||||
}
|
||||
}
|
||||
@@ -81,11 +81,11 @@ TEST_CASE( "nested SECTION tests", "[.][sections][failing]" ) {
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
|
||||
SECTION( "s1", "doesn't equal" ) {
|
||||
SECTION( "doesn't equal" ) {
|
||||
REQUIRE( a != b );
|
||||
REQUIRE( b != a );
|
||||
|
||||
SECTION( "s2", "not equal" ) {
|
||||
SECTION( "not equal" ) {
|
||||
REQUIRE( a != b);
|
||||
}
|
||||
}
|
||||
@@ -95,15 +95,15 @@ TEST_CASE( "more nested SECTION tests", "[sections][failing][.]" ) {
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
|
||||
SECTION( "s1", "doesn't equal" ) {
|
||||
SECTION( "s2", "equal" ) {
|
||||
SECTION( "doesn't equal" ) {
|
||||
SECTION( "equal" ) {
|
||||
REQUIRE( a == b );
|
||||
}
|
||||
|
||||
SECTION( "s3", "not equal" ) {
|
||||
SECTION( "not equal" ) {
|
||||
REQUIRE( a != b );
|
||||
}
|
||||
SECTION( "s4", "less than" ) {
|
||||
SECTION( "less than" ) {
|
||||
REQUIRE( a < b );
|
||||
}
|
||||
}
|
||||
@@ -112,16 +112,16 @@ TEST_CASE( "more nested SECTION tests", "[sections][failing][.]" ) {
|
||||
TEST_CASE( "even more nested SECTION tests", "[sections]" ) {
|
||||
SECTION( "c" ) {
|
||||
SECTION( "d (leaf)" ) {
|
||||
SUCCEED(""); // avoid failing due to no tests
|
||||
SUCCEED(); // avoid failing due to no tests
|
||||
}
|
||||
|
||||
SECTION( "e (leaf)" ) {
|
||||
SUCCEED(""); // avoid failing due to no tests
|
||||
SUCCEED(); // avoid failing due to no tests
|
||||
}
|
||||
}
|
||||
|
||||
SECTION( "f (leaf)" ) {
|
||||
SUCCEED(""); // avoid failing due to no tests
|
||||
SUCCEED(); // avoid failing due to no tests
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ TEST_CASE( "looped SECTION tests", "[.][failing][sections]" ) {
|
||||
for( int b = 0; b < 10; ++b ) {
|
||||
std::ostringstream oss;
|
||||
oss << "b is currently: " << b;
|
||||
SECTION( "s1", oss.str() ) {
|
||||
SECTION( oss.str() ) {
|
||||
CHECK( b > a );
|
||||
}
|
||||
}
|
||||
@@ -174,11 +174,11 @@ TEST_CASE( "checkedElse, failing", "[failing][.]" ) {
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
}
|
||||
SECTION( "encoded chars", "these should all be encoded: &&&\"\"\"<<<&\"<<&\"" ) {
|
||||
SUCCEED(""); // We need this here to stop it failing due to no tests
|
||||
SECTION( "encoded chars: these should all be encoded: &&&\"\"\"<<<&\"<<&\"" ) {
|
||||
SUCCEED(); // We need this here to stop it failing due to no tests
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,8 +265,8 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
||||
|
||||
// https://github.com/philsquared/Catch/issues/166
|
||||
TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") {
|
||||
SECTION("Outer", "")
|
||||
SECTION("Inner", "")
|
||||
SECTION("Outer")
|
||||
SECTION("Inner")
|
||||
SUCCEED("that's not flying - that's failing in style");
|
||||
|
||||
FAIL("to infinity and beyond");
|
||||
@@ -274,7 +274,7 @@ TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") {
|
||||
|
||||
TEST_CASE("not allowed", "[!throws]") {
|
||||
// This test case should not be included if you run with -e on the command line
|
||||
SUCCEED( "" );
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
//TEST_CASE( "Is big endian" ) {
|
||||
|
@@ -232,28 +232,28 @@ struct is_true
|
||||
|
||||
TEST_CASE( "(unimplemented) static bools can be evaluated", "[Tricky]" )
|
||||
{
|
||||
SECTION("compare to true","")
|
||||
SECTION("compare to true")
|
||||
{
|
||||
REQUIRE( is_true<true>::value == true );
|
||||
REQUIRE( true == is_true<true>::value );
|
||||
}
|
||||
SECTION("compare to false","")
|
||||
SECTION("compare to false")
|
||||
{
|
||||
REQUIRE( is_true<false>::value == false );
|
||||
REQUIRE( false == is_true<false>::value );
|
||||
}
|
||||
|
||||
SECTION("negation", "")
|
||||
SECTION("negation")
|
||||
{
|
||||
REQUIRE( !is_true<false>::value );
|
||||
}
|
||||
|
||||
SECTION("double negation","")
|
||||
SECTION("double negation")
|
||||
{
|
||||
REQUIRE( !!is_true<true>::value );
|
||||
}
|
||||
|
||||
SECTION("direct","")
|
||||
SECTION("direct")
|
||||
{
|
||||
REQUIRE( is_true<true>::value );
|
||||
REQUIRE_FALSE( is_true<false>::value );
|
||||
|
Reference in New Issue
Block a user