-
REQUIRE( expression ) -
CHECK( expression ) -
REQUIRE_FALSE( expression ) -
CHECK_FALSE( expression ) -
REQUIRE_NOTHROW( expression ) -
CHECK_NOTHROW( expression ) -
REQUIRE_THROWS_AS( expression, exception type ) -
CHECK_THROWS_AS( expression, exception type ) -
REQUIRE_THAT( lhs, matcher expression ) -
CHECK_THAT( lhs, matcher expression )
-
String matchers
-
StartsWith -
EndsWith -
Contains -
Equals -
Matches
-
-
Vector matchers
-
Containswhich checks whether a specified vector is present in the result -
VectorContainswhich checks whether a specified element is present in the result -
Equalswhich checks whether the result is exactly equal (order matters) to a specific vector -
UnorderedEqualswhich checks whether the result is equal to a specific vector under a permutation
-
Przetestuj algorytm std::sort().
W tym zadaniu ważne jest pokrycie jak największej liczby scenariuszy tego algorytmu.
-
TEST_CASE( test name [, tags ] ) -
SECTION( section name )
Lub
-
SCENARIO( scenario name [, tags ] ) -
GIVEN( something ) -
WHEN( something ) -
THEN( something )
Gdzie SCENARIO mapuje się na TEST_CASE, natomiast GIVEN, WHEN i THEN na SECTION.
Dzięki generatorom danych jeden scenariusz testowy może zostać uruchomiony na różnych danych testowych.