Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/benchmarks/runtime_assertion_benches.cpp
blob: 6a28e3fa2cd331bbf536211e94c0f7dad546981c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0

#include <catch2/catch_test_macros.hpp>

TEST_CASE("Simple REQUIRE - 10M") {
    for (size_t i = 0; i < 10'000'000; ++i) {
        REQUIRE(true);
    }
}

TEST_CASE("Simple NOTHROW - 10M") {
    for (size_t i = 0; i < 10'000'000; ++i) {
        REQUIRE_NOTHROW([](){}());
    }
}

TEST_CASE("Simple THROWS - 10M") {
    for (size_t i = 0; i < 10'000'000; ++i) {
        REQUIRE_THROWS([]() { throw 1; }());
    }
}