123456789101112131415161718192021222324252627282930313233343536373839 |
- #include <catch2/catch_test_macros.hpp>
- #include <catch2/benchmark/catch_benchmark.hpp>
- #include <catch2/matchers/catch_matchers.hpp>
- #include <catch2/matchers/catch_matchers_predicate.hpp>
- TEST_CASE("Tests that run") {
-
- CHECK(1 == 2);
- CHECK(1 == 1);
- CHECK(1 != 3);
- CHECK(1 == 4);
- }
- TEST_CASE("Tests that abort") {
-
-
- std::set_terminate([](){exit(1);});
- REQUIRE(1 == 1);
- REQUIRE(1 != 2);
- REQUIRE(1 == 3);
-
- REQUIRE(1 != 4);
- }
- TEST_CASE( "Misc. macros to check that they compile without exceptions" ) {
- BENCHMARK( "simple benchmark" ) { return 1 * 2 + 3; };
- REQUIRE_THAT( 1,
- Catch::Matchers::Predicate<int>( []( int i ) { return i == 1; } ) );
- }
|