Upgrade to C++17

This commit is contained in:
Chris Thrasher
2025-09-21 13:23:25 -06:00
parent c6cefc6596
commit db46dc4cb2
93 changed files with 431 additions and 917 deletions

View File

@@ -1,6 +1,6 @@
---
Language: Cpp
Standard: c++14
Standard: c++17
# Note that we cannot use IncludeIsMainRegex functionality, because it
# does not support includes in angle brackets (<>)

View File

@@ -28,13 +28,12 @@ Checks: >-
-modernize-concat-nested-namespaces,
-modernize-use-nodiscard,
-modernize-use-default-member-init,
-modernize-type-traits,# we need to support C++14,
-modernize-deprecated-headers,
,# There's a lot of these and most of them are probably not useful,
-modernize-pass-by-value,
performance-*,
performance-enum-size,
-performance-enum-size,
portability-*,

View File

@@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
build:
name: meson ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
name: meson ${{matrix.cxx}}, ${{matrix.build_type}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
@@ -13,7 +13,6 @@ jobs:
- g++-11
- clang++-11
build_type: [debug, release]
std: [14, 17]
include:
- cxx: clang++-11
other_pkgs: clang-11
@@ -29,7 +28,7 @@ jobs:
- name: Configure
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: -std=c++${{matrix.std}} ${{matrix.cxxflags}}
CXXFLAGS: -std=c++17 ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |

View File

@@ -7,7 +7,7 @@ on: [push, pull_request]
jobs:
build:
name: ${{matrix.build_description}}, ${{matrix.cxx}}, C++${{matrix.std}} ${{matrix.build_type}}
name: ${{matrix.build_description}}, ${{matrix.cxx}}, ${{matrix.build_type}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
@@ -20,7 +20,6 @@ jobs:
- cxx: clang++-14
build_description: Surrogates build
build_type: Debug
std: 14
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_SURROGATES=ON
@@ -28,13 +27,11 @@ jobs:
- cxx: g++-11
build_description: Extras + Examples
build_type: Debug
std: 14
other_pkgs: g++-11
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: g++-11
build_description: Extras + Examples
build_type: Release
std: 14
other_pkgs: g++-11
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
@@ -42,29 +39,18 @@ jobs:
- cxx: clang++-14
build_description: Extras + Examples
build_type: Debug
std: 17
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- cxx: clang++-14
build_description: Extras + Examples
build_type: Release
std: 17
other_pkgs: clang-14
cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
# Configure tests with Clang-14
- cxx: clang++-14
build_description: CMake configuration tests
build_type: Debug
std: 14
other_pkgs: clang-14
cmake_configurations: -DCATCH_ENABLE_CONFIGURE_TESTS=ON
# Valgrind test Clang-14
# - cxx: clang++-14
# build_description: Valgrind tests
# build_type: Debug
# std: 14
# other_pkgs: clang-14 valgrind
# cmake_configurations: -DMEMORYCHECK_COMMAND=`which valgrind` -DMEMORYCHECK_COMMAND_OPTIONS="-q --track-origins=yes --leak-check=full --num-callers=50 --show-leak-kinds=definite --error-exitcode=1"
# other_ctest_args: -T memcheck -LE uses-python
@@ -83,7 +69,6 @@ jobs:
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
${{matrix.cmake_configurations}}
- name: Build
@@ -116,7 +101,6 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/true \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_RANLIB=/usr/bin/true \
-DCATCH_BUILD_EXAMPLES=ON \
-DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON

View File

@@ -14,7 +14,6 @@ jobs:
- g++-10
- g++-11
- g++-12
- clang++-6.0
- clang++-7
- clang++-8
- clang++-9
@@ -24,7 +23,7 @@ jobs:
- clang++-13
- clang++-14
build_type: [Debug, Release]
std: [14]
std: [17]
include:
- cxx: g++-9
other_pkgs: g++-9
@@ -34,8 +33,6 @@ jobs:
other_pkgs: g++-11
- cxx: g++-12
other_pkgs: g++-12
- cxx: clang++-6.0
other_pkgs: clang-6.0
- cxx: clang++-7
other_pkgs: clang-7
- cxx: clang++-8
@@ -52,15 +49,6 @@ jobs:
other_pkgs: clang-13
- cxx: clang++-14
other_pkgs: clang-14
# Clang 14 + C++17
- cxx: clang++-14
build_type: Debug
std: 17
other_pkgs: clang-14
- cxx: clang++-14
build_type: Release
std: 17
other_pkgs: clang-14
- cxx: clang++-14
build_type: Debug
std: 20

View File

@@ -12,7 +12,6 @@ jobs:
matrix:
image: [macos-13, macos-14, macos-15]
build_type: [Debug, Release]
std: [14, 17]
steps:
- uses: actions/checkout@v4
@@ -21,7 +20,6 @@ jobs:
run: |
cmake --preset basic-tests -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCATCH_BUILD_EXAMPLES=ON \
-DCATCH_BUILD_EXTRA_TESTS=ON

View File

@@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
build:
name: ${{matrix.os}}, ${{matrix.std}}, ${{matrix.build_type}}, ${{matrix.platform}}
name: ${{matrix.os}}, ${{matrix.build_type}}, ${{matrix.platform}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
@@ -12,7 +12,6 @@ jobs:
os: [windows-2022, windows-2025]
platform: [Win32, x64]
build_type: [Debug, Release]
std: [14, 17]
steps:
- uses: actions/checkout@v4
@@ -20,7 +19,6 @@ jobs:
run: |
cmake --preset all-tests `
-A ${{matrix.platform}} `
-DCMAKE_CXX_STANDARD=${{matrix.std}} `
- name: Build tests
run: cmake --build build --config ${{matrix.build_type}} --parallel %NUMBER_OF_PROCESSORS%

View File

@@ -27,11 +27,6 @@ expand_template(
"#cmakedefine CATCH_CONFIG_COLOUR_WIN32": "",
"#cmakedefine CATCH_CONFIG_COUNTER": "",
"#cmakedefine CATCH_CONFIG_CPP11_TO_STRING": "",
"#cmakedefine CATCH_CONFIG_CPP17_BYTE": "",
"#cmakedefine CATCH_CONFIG_CPP17_OPTIONAL": "",
"#cmakedefine CATCH_CONFIG_CPP17_STRING_VIEW": "",
"#cmakedefine CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS": "",
"#cmakedefine CATCH_CONFIG_CPP17_VARIANT": "",
"#cmakedefine CATCH_CONFIG_DEPRECATION_ANNOTATIONS": "",
"#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER": "",
"#cmakedefine CATCH_CONFIG_DISABLE_EXCEPTIONS": "",
@@ -51,11 +46,6 @@ expand_template(
"#cmakedefine CATCH_CONFIG_NO_COLOUR_WIN32": "",
"#cmakedefine CATCH_CONFIG_NO_COUNTER": "",
"#cmakedefine CATCH_CONFIG_NO_CPP11_TO_STRING": "",
"#cmakedefine CATCH_CONFIG_NO_CPP17_BYTE": "",
"#cmakedefine CATCH_CONFIG_NO_CPP17_OPTIONAL": "",
"#cmakedefine CATCH_CONFIG_NO_CPP17_STRING_VIEW": "",
"#cmakedefine CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS": "",
"#cmakedefine CATCH_CONFIG_NO_CPP17_VARIANT": "",
"#cmakedefine CATCH_CONFIG_NO_DEPRECATION_ANNOTATIONS": "",
"#cmakedefine CATCH_CONFIG_NO_GETENV": "",
"#cmakedefine CATCH_CONFIG_NO_GLOBAL_NEXTAFTER": "",

View File

@@ -31,11 +31,6 @@ set(_OverridableOptions
"COLOUR_WIN32"
"COUNTER"
"CPP11_TO_STRING"
"CPP17_BYTE"
"CPP17_OPTIONAL"
"CPP17_STRING_VIEW"
"CPP17_UNCAUGHT_EXCEPTIONS"
"CPP17_VARIANT"
"GLOBAL_NEXTAFTER"
"POSIX_SIGNALS"
"USE_ASYNC"

View File

@@ -3,7 +3,7 @@ libdir=${prefix}/@lib_dir@
pkg_version=@Catch2_VERSION@
Name: Catch2 with main function
Description: A modern, C++-native test framework for C++14 and above (links in default main)
Description: A modern, C++-native test framework for C++17 and above (links in default main)
URL: https://github.com/catchorg/Catch2
Version: ${pkg_version}
Requires: catch2 = ${pkg_version}

View File

@@ -4,7 +4,7 @@ includedir=${prefix}/@include_dir@
libdir=${prefix}/@lib_dir@
Name: Catch2
Description: A modern, C++-native, test framework for C++14 and above
Description: A modern, C++-native, test framework for C++17 and above
URL: https://github.com/catchorg/Catch2
Version: @Catch2_VERSION@
Cflags: -I${includedir}

View File

@@ -10,7 +10,6 @@
[Default reporter](#default-reporter)<br>
[Bazel support](#bazel-support)<br>
[C++11 toggles](#c11-toggles)<br>
[C++17 toggles](#c17-toggles)<br>
[Other toggles](#other-toggles)<br>
[Enabling stringification](#enabling-stringification)<br>
[Disabling exceptions](#disabling-exceptions)<br>
@@ -128,23 +127,6 @@ Catch's selection, by defining either `CATCH_CONFIG_CPP11_TO_STRING` or
`CATCH_CONFIG_NO_CPP11_TO_STRING`.
## C++17 toggles
CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS // Override std::uncaught_exceptions (instead of std::uncaught_exception) support detection
CATCH_CONFIG_CPP17_STRING_VIEW // Override std::string_view support detection (Catch provides a StringMaker specialization by default)
CATCH_CONFIG_CPP17_VARIANT // Override std::variant support detection (checked by CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER)
CATCH_CONFIG_CPP17_OPTIONAL // Override std::optional support detection (checked by CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER)
CATCH_CONFIG_CPP17_BYTE // Override std::byte support detection (Catch provides a StringMaker specialization by default)
> `CATCH_CONFIG_CPP17_STRING_VIEW` was [introduced](https://github.com/catchorg/Catch2/issues/1376) in Catch2 2.4.1.
Catch contains basic compiler/standard detection and attempts to use
some C++17 features whenever appropriate. This automatic detection
can be manually overridden in both directions, that is, a feature
can be enabled by defining the macro in the table above, and disabled
by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`.
## Other toggles
CATCH_CONFIG_COUNTER // Use __COUNTER__ to generate unique names for test cases
@@ -221,8 +203,8 @@ By default, Catch does not stringify some types from the standard library. This
CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER // Provide StringMaker specialization for std::pair
CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER // Provide StringMaker specialization for std::tuple
CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER // Provide StringMaker specialization for std::variant, std::monostate (on C++17)
CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17)
CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER // Provide StringMaker specialization for std::variant, std::monostate
CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional
CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS // Defines all of the above
> `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1380) in Catch2 2.4.1.

View File

@@ -211,16 +211,10 @@ and so on.
### C++ standard version
Catch2 currently targets C++14 as the minimum supported C++ version.
Catch2 currently targets C++17 as the minimum supported C++ version.
Features from higher language versions should be used only sparingly,
when the benefits from using them outweigh the maintenance overhead.
Example of good use of polyfilling features is our use of `conjunction`,
where if available we use `std::conjunction` and otherwise provide our
own implementation. The reason it is good is that the surface area for
maintenance is quite small, and `std::conjunction` can directly use
compiler built-ins, thus providing significant compilation benefits.
Example of bad use of polyfilling features would be to keep around two
sets of metaprogramming in the stringification implementation, once
using C++14 compliant TMP and once using C++17's `if constexpr`. While

View File

@@ -72,8 +72,8 @@ including the Catch2 header.
Example:
```cpp
TEST_CASE("STATIC_REQUIRE showcase", "[traits]") {
STATIC_REQUIRE( std::is_void<void>::value );
STATIC_REQUIRE_FALSE( std::is_void<int>::value );
STATIC_REQUIRE( std::is_void_v<void> );
STATIC_REQUIRE_FALSE( std::is_void_v<int> );
}
```
@@ -86,8 +86,8 @@ becomes equivalent to `CHECK` instead of `REQUIRE`.
Example:
```cpp
TEST_CASE("STATIC_CHECK showcase", "[traits]") {
STATIC_CHECK( std::is_void<void>::value );
STATIC_CHECK_FALSE( std::is_void<int>::value );
STATIC_CHECK( std::is_void_v<void> );
STATIC_CHECK_FALSE( std::is_void_v<int> );
}
```

View File

@@ -264,7 +264,7 @@ You can also have different arities in the _template-arg_ packs:
```cpp
TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
TestType x;
REQUIRE(std::tuple_size<TestType>::value >= 1);
REQUIRE(std::tuple_size_v<TestType> >= 1);
}
```

View File

@@ -15,7 +15,7 @@ So what does Catch2 bring to the party that differentiates it from these? Apart
## Key Features
* Quick and easy to get started. Just download two files, add them into your project and you're away.
* No external dependencies. As long as you can compile C++14 and have the C++ standard library available.
* No external dependencies. As long as you can compile C++17 and have the C++ standard library available.
* Write test cases as, self-registering, functions (or methods, if you prefer).
* Divide test cases into sections, each of which is run in isolation (eliminates the need for fixtures).
* Use BDD-style Given-When-Then sections as well as traditional unit test cases.

View File

@@ -27,7 +27,7 @@ TEST_CASE( "Factorials of 1 and higher are computed (pass)", "[single-file]" ) {
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 010-TestCase 010-TestCase.cpp && 010-TestCase --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 010-TestCase 010-TestCase.cpp && 010-TestCase --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 010-TestCase.cpp && 010-TestCase --success
// Expected compact output (all assertions):

View File

@@ -18,8 +18,8 @@ TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-file:
// Here just to show there are two source files via option --list-tests.
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 020-TestCase-1.cpp
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 020-TestCase TestCase-1.o 020-TestCase-2.cpp && 020-TestCase --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -c 020-TestCase-1.cpp
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 020-TestCase TestCase-1.o 020-TestCase-2.cpp && 020-TestCase --success
//
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -c 020-TestCase-1.cpp
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% -Fe020-TestCase.exe 020-TestCase-1.obj 020-TestCase-2.cpp && 020-TestCase --success

View File

@@ -61,7 +61,7 @@ TEST_CASE( "Assert that something is false (continue after failure)", "[check-fa
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 030-Asn-Require-Check 030-Asn-Require-Check.cpp && 030-Asn-Require-Check --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 030-Asn-Require-Check 030-Asn-Require-Check.cpp && 030-Asn-Require-Check --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 030-Asn-Require-Check.cpp && 030-Asn-Require-Check --success
// Expected compact output (all assertions):

View File

@@ -53,7 +53,7 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 100-Fix-Section 100-Fix-Section.cpp && 100-Fix-Section --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 100-Fix-Section 100-Fix-Section.cpp && 100-Fix-Section --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 100-Fix-Section.cpp && 100-Fix-Section --success
// Expected compact output (all assertions):

View File

@@ -60,11 +60,11 @@ TEST_CASE_METHOD( UniqueTestsFixture, "Create Employee/Normal", "[create]" ) {
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp && 110-Fix-ClassFixture --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp && 110-Fix-ClassFixture --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 110-Fix-ClassFixture.cpp && 110-Fix-ClassFixture --success
//
// Compile with pkg-config:
// - g++ -std=c++14 -Wall $(pkg-config catch2-with-main --cflags) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp $(pkg-config catch2-with-main --libs)
// - g++ -std=c++17 -Wall $(pkg-config catch2-with-main --cflags) -o 110-Fix-ClassFixture 110-Fix-ClassFixture.cpp $(pkg-config catch2-with-main --libs)
// Expected compact output (all assertions):
//

View File

@@ -56,7 +56,7 @@ SCENARIO( "vectors can be sized and resized", "[vector]" ) {
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 120-Bdd-ScenarioGivenWhenThen 120-Bdd-ScenarioGivenWhenThen.cpp && 120-Bdd-ScenarioGivenWhenThen --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 120-Bdd-ScenarioGivenWhenThen 120-Bdd-ScenarioGivenWhenThen.cpp && 120-Bdd-ScenarioGivenWhenThen --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 120-Bdd-ScenarioGivenWhenThen.cpp && 120-Bdd-ScenarioGivenWhenThen --success
// Expected compact output (all assertions):

View File

@@ -427,7 +427,7 @@ TEST_CASE_METHOD( Fixture, "3: Testcase with class-based fixture", "[tag-C][tag-
}
// Compile & run:
// - g++ -std=c++14 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 210-Evt-EventListeners 210-Evt-EventListeners.cpp && 210-Evt-EventListeners --success
// - g++ -std=c++17 -Wall -I$(CATCH_SINGLE_INCLUDE) -o 210-Evt-EventListeners 210-Evt-EventListeners.cpp && 210-Evt-EventListeners --success
// - cl -EHsc -I%CATCH_SINGLE_INCLUDE% 210-Evt-EventListeners.cpp && 210-Evt-EventListeners --success
// Expected compact output (all assertions):

View File

@@ -22,24 +22,21 @@ struct TestSubject {
TEST_CASE("Table allows pre-computed test inputs and outputs", "[example][generator]") {
using std::make_tuple;
// do setup here as normal
TestSubject subj;
SECTION("This section is run for each row in the table") {
std::string test_input;
size_t expected_output;
std::tie( test_input, expected_output ) =
const auto [test_input, expected_output] =
GENERATE( table<std::string, size_t>(
{ /* In this case one of the parameters to our test case is the
* expected output, but this is not required. There could be
* multiple expected values in the table, which can have any
* (fixed) number of columns.
*/
make_tuple( "one", 3 ),
make_tuple( "two", 3 ),
make_tuple( "three", 5 ),
make_tuple( "four", 4 ) } ) );
{ "one", 3 },
{ "two", 3 },
{ "three", 5 },
{ "four", 4 } } ) );
// run the test
auto result = subj.GetLength(test_input);
@@ -50,14 +47,4 @@ TEST_CASE("Table allows pre-computed test inputs and outputs", "[example][genera
} // end section
}
/* Possible simplifications where less legacy toolchain support is needed:
*
* - With libstdc++6 or newer, the make_tuple() calls can be omitted
* (technically C++17 but does not require -std in GCC/Clang). See
* https://stackoverflow.com/questions/12436586/tuple-vector-and-initializer-list
*
* - In C++17 mode std::tie() and the preceding variable declarations can be
* replaced by structured bindings: auto [test_input, expected] = GENERATE(
* table<std::string, size_t>({ ...
*/
// Compiling and running this file will result in 4 successful assertions

View File

@@ -84,7 +84,7 @@ namespace Catch {
std::vector<FDuration> samples2;
samples2.reserve(samples.size());
for (auto s : samples) {
samples2.push_back( FDuration( s ) );
samples2.emplace_back( s );
}
return {

View File

@@ -76,11 +76,9 @@ set(IMPL_HEADERS
${SOURCES_DIR}/internal/catch_config_counter.hpp
${SOURCES_DIR}/internal/catch_config_prefix_messages.hpp
${SOURCES_DIR}/internal/catch_config_static_analysis_support.hpp
${SOURCES_DIR}/internal/catch_config_uncaught_exceptions.hpp
${SOURCES_DIR}/internal/catch_config_wchar.hpp
${SOURCES_DIR}/internal/catch_console_colour.hpp
${SOURCES_DIR}/internal/catch_console_width.hpp
${SOURCES_DIR}/internal/catch_container_nonmembers.hpp
${SOURCES_DIR}/internal/catch_context.hpp
${SOURCES_DIR}/internal/catch_debug_console.hpp
${SOURCES_DIR}/internal/catch_debugger.hpp
@@ -99,7 +97,6 @@ set(IMPL_HEADERS
${SOURCES_DIR}/internal/catch_lazy_expr.hpp
${SOURCES_DIR}/internal/catch_leak_detector.hpp
${SOURCES_DIR}/internal/catch_list.hpp
${SOURCES_DIR}/internal/catch_logical_traits.hpp
${SOURCES_DIR}/internal/catch_message_info.hpp
${SOURCES_DIR}/internal/catch_meta.hpp
${SOURCES_DIR}/internal/catch_move_and_forward.hpp
@@ -365,8 +362,8 @@ set_target_properties(Catch2 PROPERTIES
SOVERSION ${PROJECT_VERSION}
)
# require C++14
target_compile_features(Catch2 PUBLIC cxx_std_14)
# require C++17
target_compile_features(Catch2 PUBLIC cxx_std_17)
configure_file(
"${SOURCES_DIR}/catch_user_config.hpp.in"
@@ -450,7 +447,7 @@ if(CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(Catch2_buildall_interface INTERFACE CATCH_CONFIG_STATIC)
target_compile_features(Catch2_buildall_interface INTERFACE cxx_std_14)
target_compile_features(Catch2_buildall_interface INTERFACE cxx_std_17)
endif()
list(APPEND CATCH_IMPL_TARGETS Catch2 Catch2WithMain)

View File

@@ -64,12 +64,12 @@ namespace Catch {
}
template <typename Fn, typename... Args>
inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same<void, decltype(fn(args...))>::value> {
inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same_v<void, decltype(fn(args...))>> {
deoptimize_value(CATCH_FORWARD(fn) (CATCH_FORWARD(args)...));
}
template <typename Fn, typename... Args>
inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same<void, decltype(fn(args...))>::value> {
inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same_v<void, decltype(fn(args...))>> {
CATCH_FORWARD((fn)) (CATCH_FORWARD(args)...);
}
} // namespace Benchmark

View File

@@ -46,7 +46,7 @@ namespace Catch {
std::vector<FDuration> samples2;
samples2.reserve(samples.size());
for (auto s : samples) {
samples2.push_back( FDuration( s ) );
samples2.emplace_back( s );
}
return {

View File

@@ -21,7 +21,7 @@ namespace Catch {
namespace Benchmark {
namespace Detail {
template <typename T, typename U>
static constexpr bool is_related_v = std::is_same<std::decay_t<T>, std::decay_t<U>>::value;
static constexpr bool is_related_v = std::is_same_v<std::decay_t<T>, std::decay_t<U>>;
/// We need to reinvent std::function because every piece of code that might add overhead
/// in a measurement context needs to have consistent performance characteristics so that we

View File

@@ -57,11 +57,9 @@
#include <catch2/internal/catch_config_counter.hpp>
#include <catch2/internal/catch_config_prefix_messages.hpp>
#include <catch2/internal/catch_config_static_analysis_support.hpp>
#include <catch2/internal/catch_config_uncaught_exceptions.hpp>
#include <catch2/internal/catch_config_wchar.hpp>
#include <catch2/internal/catch_console_colour.hpp>
#include <catch2/internal/catch_console_width.hpp>
#include <catch2/internal/catch_container_nonmembers.hpp>
#include <catch2/internal/catch_context.hpp>
#include <catch2/internal/catch_debug_console.hpp>
#include <catch2/internal/catch_debugger.hpp>
@@ -80,7 +78,6 @@
#include <catch2/internal/catch_lazy_expr.hpp>
#include <catch2/internal/catch_leak_detector.hpp>
#include <catch2/internal/catch_list.hpp>
#include <catch2/internal/catch_logical_traits.hpp>
#include <catch2/internal/catch_message_info.hpp>
#include <catch2/internal/catch_meta.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>

View File

@@ -29,7 +29,7 @@ namespace Catch {
Approx operator-() const;
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
Approx operator()( T const& value ) const {
Approx approx( static_cast<double>(value) );
approx.m_epsilon = m_epsilon;
@@ -38,67 +38,67 @@ namespace Catch {
return approx;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
explicit Approx( T const& value ): Approx(static_cast<double>(value))
{}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator == ( const T& lhs, Approx const& rhs ) {
auto lhs_v = static_cast<double>(lhs);
return rhs.equalityComparisonImpl(lhs_v);
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator == ( Approx const& lhs, const T& rhs ) {
return operator==( rhs, lhs );
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator != ( T const& lhs, Approx const& rhs ) {
return !operator==( lhs, rhs );
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator != ( Approx const& lhs, T const& rhs ) {
return !operator==( rhs, lhs );
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator <= ( T const& lhs, Approx const& rhs ) {
return static_cast<double>(lhs) < rhs.m_value || lhs == rhs;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator <= ( Approx const& lhs, T const& rhs ) {
return lhs.m_value < static_cast<double>(rhs) || lhs == rhs;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator >= ( T const& lhs, Approx const& rhs ) {
return static_cast<double>(lhs) > rhs.m_value || lhs == rhs;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
friend bool operator >= ( Approx const& lhs, T const& rhs ) {
return lhs.m_value > static_cast<double>(rhs) || lhs == rhs;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
Approx& epsilon( T const& newEpsilon ) {
const auto epsilonAsDouble = static_cast<double>(newEpsilon);
setEpsilon(epsilonAsDouble);
return *this;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
Approx& margin( T const& newMargin ) {
const auto marginAsDouble = static_cast<double>(newMargin);
setMargin(marginAsDouble);
return *this;
}
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename T, typename = std::enable_if_t<std::is_constructible_v<double, T>>>
Approx& scale( T const& newScale ) {
m_scale = static_cast<double>(newScale);
return *this;

View File

@@ -16,7 +16,6 @@
namespace Catch {
// TODO: Use C++17 `inline` variables
constexpr int UnspecifiedErrorExitCode = 1;
constexpr int NoTestsRunExitCode = 2;
constexpr int UnmatchedTestSpecExitCode = 3;

View File

@@ -13,6 +13,7 @@
#include <catch2/internal/catch_polyfills.hpp>
#include <iomanip>
#include <cstddef>
namespace Catch {
@@ -135,11 +136,9 @@ std::string StringMaker<std::string>::convert(const std::string& str) {
return Detail::convertIntoString( str );
}
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
std::string StringMaker<std::string_view>::convert(std::string_view str) {
return Detail::convertIntoString( StringRef( str.data(), str.size() ) );
}
#endif
std::string StringMaker<char const*>::convert(char const* str) {
if (str) {
@@ -166,11 +165,9 @@ std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
return ::Catch::Detail::stringify(s);
}
# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
return StringMaker<std::wstring>::convert(std::wstring(str));
}
# endif
std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
if (str) {
@@ -188,12 +185,9 @@ std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
}
#endif
#if defined(CATCH_CONFIG_CPP17_BYTE)
#include <cstddef>
std::string StringMaker<std::byte>::convert(std::byte value) {
return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
}
#endif // defined(CATCH_CONFIG_CPP17_BYTE)
std::string StringMaker<int>::convert(int value) {
return ::Catch::Detail::stringify(static_cast<long long>(value));

View File

@@ -20,9 +20,7 @@
#include <catch2/internal/catch_void_type.hpp>
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
#include <string_view>
#endif
#ifdef _MSC_VER
#pragma warning(push)
@@ -78,13 +76,13 @@ namespace Catch {
template<typename T>
std::enable_if_t<
!std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
!std::is_enum_v<T> && !std::is_base_of_v<std::exception, T>,
std::string> convertUnstreamable( T const& ) {
return std::string(Detail::unprintableString);
}
template<typename T>
std::enable_if_t<
!std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
!std::is_enum_v<T> && std::is_base_of_v<std::exception, T>,
std::string> convertUnstreamable(T const& ex) {
return ex.what();
}
@@ -92,7 +90,7 @@ namespace Catch {
template<typename T>
std::enable_if_t<
std::is_enum<T>::value,
std::is_enum_v<T>,
std::string> convertUnstreamable( T const& value ) {
return convertUnknownEnumToString( value );
}
@@ -173,12 +171,10 @@ namespace Catch {
static std::string convert(const std::string& str);
};
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
template<>
struct StringMaker<std::string_view> {
static std::string convert(std::string_view str);
};
#endif
template<>
struct StringMaker<char const *> {
@@ -195,12 +191,10 @@ namespace Catch {
static std::string convert(const std::wstring& wstr);
};
# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
template<>
struct StringMaker<std::wstring_view> {
static std::string convert(std::wstring_view str);
};
# endif
template<>
struct StringMaker<wchar_t const *> {
@@ -236,12 +230,10 @@ namespace Catch {
}
};
#if defined(CATCH_CONFIG_CPP17_BYTE)
template<>
struct StringMaker<std::byte> {
static std::string convert(std::byte value);
};
#endif // defined(CATCH_CONFIG_CPP17_BYTE)
template<>
struct StringMaker<int> {
static std::string convert(int value);
@@ -387,7 +379,7 @@ namespace Catch {
}
#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER)
#include <optional>
namespace Catch {
template<typename T>
@@ -417,7 +409,7 @@ namespace Catch {
template<
typename Tuple,
std::size_t N = 0,
bool = (N < std::tuple_size<Tuple>::value)
bool = (N < std::tuple_size_v<Tuple>)
>
struct TupleElementPrinter {
static void print(const Tuple& tuple, std::ostream& os) {
@@ -451,7 +443,7 @@ namespace Catch {
}
#endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER)
#include <variant>
namespace Catch {
template<>

View File

@@ -60,56 +60,6 @@
#cmakedefine CATCH_CONFIG_CPP17_BYTE
#cmakedefine CATCH_CONFIG_NO_CPP17_BYTE
#if defined( CATCH_CONFIG_CPP17_BYTE ) && \
defined( CATCH_CONFIG_NO_CPP17_BYTE )
# error Cannot force CPP17_BYTE to both ON and OFF
#endif
#cmakedefine CATCH_CONFIG_CPP17_OPTIONAL
#cmakedefine CATCH_CONFIG_NO_CPP17_OPTIONAL
#if defined( CATCH_CONFIG_CPP17_OPTIONAL ) && \
defined( CATCH_CONFIG_NO_CPP17_OPTIONAL )
# error Cannot force CPP17_OPTIONAL to both ON and OFF
#endif
#cmakedefine CATCH_CONFIG_CPP17_STRING_VIEW
#cmakedefine CATCH_CONFIG_NO_CPP17_STRING_VIEW
#if defined( CATCH_CONFIG_CPP17_STRING_VIEW ) && \
defined( CATCH_CONFIG_NO_CPP17_STRING_VIEW )
# error Cannot force CPP17_STRING_VIEW to both ON and OFF
#endif
#cmakedefine CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
#cmakedefine CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS
#if defined( CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS ) && \
defined( CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS )
# error Cannot force CPP17_UNCAUGHT_EXCEPTIONS to both ON and OFF
#endif
#cmakedefine CATCH_CONFIG_CPP17_VARIANT
#cmakedefine CATCH_CONFIG_NO_CPP17_VARIANT
#if defined( CATCH_CONFIG_CPP17_VARIANT ) && \
defined( CATCH_CONFIG_NO_CPP17_VARIANT )
# error Cannot force CPP17_VARIANT to both ON and OFF
#endif
#cmakedefine CATCH_CONFIG_GLOBAL_NEXTAFTER
#cmakedefine CATCH_CONFIG_NO_GLOBAL_NEXTAFTER

View File

@@ -88,7 +88,7 @@ namespace Detail {
template<typename T>
class FixedValuesGenerator final : public IGenerator<T> {
static_assert(!std::is_same<T, bool>::value,
static_assert(!std::is_same_v<T, bool>,
"FixedValuesGenerator does not support bools because of std::vector<bool>"
"specialization, use SingleValue Generator instead.");
std::vector<T> m_values;
@@ -131,7 +131,7 @@ namespace Detail {
m_generators.emplace_back( value( CATCH_MOVE( val ) ) );
}
template <typename U>
std::enable_if_t<!std::is_same<std::decay_t<U>, T>::value>
std::enable_if_t<!std::is_same_v<std::decay_t<U>, T>>
add_generator( U&& val ) {
add_generator( T( CATCH_FORWARD( val ) ) );
}

View File

@@ -58,7 +58,7 @@ namespace Generators {
class FilterGenerator final : public IGenerator<T> {
GeneratorWrapper<T> m_generator;
Predicate m_predicate;
static_assert(!std::is_reference<Predicate>::value, "This would most likely result in a dangling reference");
static_assert(!std::is_reference_v<Predicate>, "This would most likely result in a dangling reference");
public:
template <typename P>
FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
@@ -97,7 +97,7 @@ namespace Generators {
template <typename T>
class RepeatGenerator final : public IGenerator<T> {
static_assert(!std::is_same<T, bool>::value,
static_assert(!std::is_same_v<T, bool>,
"RepeatGenerator currently does not support bools"
"because of std::vector<bool> specialization");
GeneratorWrapper<T> m_generator;

View File

@@ -83,7 +83,7 @@ public:
};
template <typename T>
std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>>
std::enable_if_t<std::is_integral_v<T>, GeneratorWrapper<T>>
random(T a, T b) {
return GeneratorWrapper<T>(
Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b, Detail::getSeed())
@@ -91,7 +91,7 @@ random(T a, T b) {
}
template <typename T>
std::enable_if_t<std::is_floating_point<T>::value,
std::enable_if_t<std::is_floating_point_v<T>,
GeneratorWrapper<T>>
random(T a, T b) {
return GeneratorWrapper<T>(

View File

@@ -52,20 +52,20 @@ public:
template <typename T>
GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
static_assert(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>, "Type must be numeric");
return GeneratorWrapper<T>(Catch::Detail::make_unique<RangeGenerator<T>>(start, end, step));
}
template <typename T>
GeneratorWrapper<T> range(T const& start, T const& end) {
static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
static_assert(std::is_integral_v<T> && !std::is_same_v<T, bool>, "Type must be an integer");
return GeneratorWrapper<T>(Catch::Detail::make_unique<RangeGenerator<T>>(start, end));
}
template <typename T>
class IteratorGenerator final : public IGenerator<T> {
static_assert(!std::is_same<T, bool>::value,
static_assert(!std::is_same_v<T, bool>,
"IteratorGenerator currently does not support bools"
"because of std::vector<bool> specialization");

View File

@@ -20,14 +20,7 @@
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
# ifdef __has_include
# if __has_include( <optional>) && __cplusplus >= 201703L
#include <optional>
# define CLARA_CONFIG_OPTIONAL_TYPE std::optional
# endif
# endif
#endif
#include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
@@ -328,10 +321,9 @@ namespace Catch {
std::string& target );
ParserResult convertInto( std::string const& source, bool& target );
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
template <typename T>
auto convertInto( std::string const& source,
CLARA_CONFIG_OPTIONAL_TYPE<T>& target )
std::optional<T>& target )
-> ParserResult {
T temp;
auto result = convertInto( source, temp );
@@ -339,7 +331,6 @@ namespace Catch {
target = CATCH_MOVE( temp );
return result;
}
#endif // CLARA_CONFIG_OPTIONAL_TYPE
struct BoundRef : Catch::Detail::NonCopyable {
virtual ~BoundRef() = default;
@@ -393,7 +384,7 @@ namespace Catch {
template <typename ReturnType> struct LambdaInvoker {
static_assert(
std::is_same<ReturnType, ParserResult>::value,
std::is_same_v<ReturnType, ParserResult>,
"Lambda must return void or clara::ParserResult" );
template <typename L, typename ArgType>
@@ -449,8 +440,8 @@ namespace Catch {
UnaryLambdaTraits<L>::isValid,
"Supplied lambda must take exactly one argument" );
static_assert(
std::is_same<typename UnaryLambdaTraits<L>::ArgType,
bool>::value,
std::is_same_v<typename UnaryLambdaTraits<L>::ArgType,
bool>,
"flags must be boolean" );
explicit BoundFlagLambda( L const& lambda ):

View File

@@ -29,10 +29,6 @@
#ifdef __cplusplus
# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# define CATCH_CPP17_OR_GREATER
# endif
# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
# define CATCH_CPP20_OR_GREATER
# endif
@@ -198,8 +194,7 @@
# define _BSD_SOURCE
// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
&& !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
# if !(defined(_GLIBCXX_USE_C99) && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
@@ -275,43 +270,6 @@
#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
#endif
// Various stdlib support checks that require __has_include
#if defined(__has_include)
// Check if string_view is available and usable
#if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
# define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
#endif
// Check if optional is available and usable
# if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
# define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
# endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
// Check if byte is available and usable
# if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
# include <cstddef>
# if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0)
# define CATCH_INTERNAL_CONFIG_CPP17_BYTE
# endif
# endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
// Check if variant is available and usable
# if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
# if defined(__clang__) && (__clang_major__ < 8)
// work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
// fix should be in clang 8, workaround in libstdc++ 8.2
# include <ciso646>
# if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
# define CATCH_CONFIG_NO_CPP17_VARIANT
# else
# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
# endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
# else
# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
# endif // defined(__clang__) && (__clang_major__ < 8)
# endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
#endif // defined(__has_include)
#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
# define CATCH_CONFIG_WINDOWS_SEH
@@ -329,22 +287,6 @@
# define CATCH_CONFIG_CPP11_TO_STRING
#endif
#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
# define CATCH_CONFIG_CPP17_OPTIONAL
#endif
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
# define CATCH_CONFIG_CPP17_STRING_VIEW
#endif
#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
# define CATCH_CONFIG_CPP17_VARIANT
#endif
#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
# define CATCH_CONFIG_CPP17_BYTE
#endif
#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE

View File

@@ -1,46 +0,0 @@
// 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
/** \file
* Wrapper for UNCAUGHT_EXCEPTIONS configuration option
*
* For some functionality, Catch2 requires to know whether there is
* an active exception. Because `std::uncaught_exception` is deprecated
* in C++17, we want to use `std::uncaught_exceptions` if possible.
*/
#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
#include <catch2/catch_user_config.hpp>
#if defined(_MSC_VER)
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
# endif
#endif
#include <exception>
#if defined(__cpp_lib_uncaught_exceptions) \
&& !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
#endif // __cpp_lib_uncaught_exceptions
#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
&& !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
&& !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
#endif
#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED

View File

@@ -1,73 +0,0 @@
// 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
#ifndef CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
#define CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <cstddef>
#include <initializer_list>
// We want a simple polyfill over `std::empty`, `std::size` and so on
// for C++14 or C++ libraries with incomplete support.
// We also have to handle that MSVC std lib will happily provide these
// under older standards.
#if defined(CATCH_CPP17_OR_GREATER) || defined(_MSC_VER)
// We are already using this header either way, so there shouldn't
// be much additional overhead in including it to get the feature
// test macros
#include <string>
# if !defined(__cpp_lib_nonmember_container_access)
# define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
# endif
#else
#define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
#endif
namespace Catch {
namespace Detail {
#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
template <typename Container>
constexpr auto empty(Container const& cont) -> decltype(cont.empty()) {
return cont.empty();
}
template <typename T, std::size_t N>
constexpr bool empty(const T (&)[N]) noexcept {
// GCC < 7 does not support the const T(&)[] parameter syntax
// so we have to ignore the length explicitly
(void)N;
return false;
}
template <typename T>
constexpr bool empty(std::initializer_list<T> list) noexcept {
return list.size() > 0;
}
template <typename Container>
constexpr auto size(Container const& cont) -> decltype(cont.size()) {
return cont.size();
}
template <typename T, std::size_t N>
constexpr std::size_t size(const T(&)[N]) noexcept {
return N;
}
#endif // CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
} // end namespace Detail
} // end namespace Catch
#endif // CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED

View File

@@ -12,7 +12,6 @@
#include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_compare_traits.hpp>
#include <catch2/internal/catch_test_failure_exception.hpp>
#include <catch2/internal/catch_logical_traits.hpp>
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <type_traits>
@@ -129,7 +128,7 @@
namespace Catch {
namespace Detail {
// This was added in C++20, but we require only C++14 for now.
// This was added in C++20, but we require only C++17 for now.
template <typename T>
using RemoveCVRef_t = std::remove_cv_t<std::remove_reference_t<T>>;
}
@@ -148,8 +147,8 @@ namespace Catch {
template <typename T>
struct capture_by_value
: std::integral_constant<bool,
std::is_arithmetic<T>::value ||
std::is_enum<T>::value> {};
std::is_arithmetic_v<T> ||
std::is_enum_v<T>> {};
#if defined( CATCH_CONFIG_CPP20_COMPARE_OVERLOADS )
template <>
@@ -294,9 +293,9 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \
-> std::enable_if_t< \
Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
Detail::negation<capture_by_value< \
Detail::RemoveCVRef_t<RhsT>>>>::value, \
std::conjunction_v<Detail::is_##id##_comparable<LhsT, RhsT>, \
std::negation<capture_by_value< \
Detail::RemoveCVRef_t<RhsT>>>>, \
BinaryExpr<LhsT, RhsT const&>> { \
return { \
static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
@@ -304,8 +303,8 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
capture_by_value<RhsT>>::value, \
std::conjunction_v<Detail::is_##id##_comparable<LhsT, RhsT>, \
capture_by_value<RhsT>>, \
BinaryExpr<LhsT, RhsT>> { \
return { \
static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
@@ -313,12 +312,12 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction< \
Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
std::conjunction_v< \
std::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
Detail::is_eq_0_comparable<LhsT>, \
/* We allow long because we want `ptr op NULL` to be accepted */ \
Detail::disjunction<std::is_same<RhsT, int>, \
std::is_same<RhsT, long>>>::value, \
std::disjunction<std::is_same<RhsT, int>, \
std::is_same<RhsT, long>>>, \
BinaryExpr<LhsT, RhsT>> { \
if ( rhs != 0 ) { throw_test_failure_exception(); } \
return { \
@@ -327,12 +326,12 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction< \
Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
std::conjunction_v< \
std::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
Detail::is_eq_0_comparable<RhsT>, \
/* We allow long because we want `ptr op NULL` to be accepted */ \
Detail::disjunction<std::is_same<LhsT, int>, \
std::is_same<LhsT, long>>>::value, \
std::disjunction<std::is_same<LhsT, int>, \
std::is_same<LhsT, long>>>, \
BinaryExpr<LhsT, RhsT>> { \
if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \
return { static_cast<bool>( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
@@ -348,9 +347,9 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT&& rhs ) \
-> std::enable_if_t< \
Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
Detail::negation<capture_by_value< \
Detail::RemoveCVRef_t<RhsT>>>>::value, \
std::conjunction_v<Detail::is_##id##_comparable<LhsT, RhsT>, \
std::negation<capture_by_value< \
Detail::RemoveCVRef_t<RhsT>>>>, \
BinaryExpr<LhsT, RhsT const&>> { \
return { \
static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
@@ -358,8 +357,8 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction<Detail::is_##id##_comparable<LhsT, RhsT>, \
capture_by_value<RhsT>>::value, \
std::conjunction_v<Detail::is_##id##_comparable<LhsT, RhsT>, \
capture_by_value<RhsT>> , \
BinaryExpr<LhsT, RhsT>> { \
return { \
static_cast<bool>( lhs.m_lhs op rhs ), lhs.m_lhs, #op##_sr, rhs }; \
@@ -367,10 +366,10 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction< \
Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
std::conjunction_v< \
std::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
Detail::is_##id##_0_comparable<LhsT>, \
std::is_same<RhsT, int>>::value, \
std::is_same<RhsT, int>>, \
BinaryExpr<LhsT, RhsT>> { \
if ( rhs != 0 ) { throw_test_failure_exception(); } \
return { \
@@ -379,10 +378,10 @@ namespace Catch {
template <typename RhsT> \
constexpr friend auto operator op( ExprLhs&& lhs, RhsT rhs ) \
-> std::enable_if_t< \
Detail::conjunction< \
Detail::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
std::conjunction_v< \
std::negation<Detail::is_##id##_comparable<LhsT, RhsT>>, \
Detail::is_##id##_0_comparable<RhsT>, \
std::is_same<LhsT, int>>::value, \
std::is_same<LhsT, int>>, \
BinaryExpr<LhsT, RhsT>> { \
if ( lhs.m_lhs != 0 ) { throw_test_failure_exception(); } \
return { static_cast<bool>( 0 op rhs ), lhs.m_lhs, #op##_sr, rhs }; \

View File

@@ -49,7 +49,7 @@ namespace Catch {
template <typename ForwardIter, typename Sentinel>
constexpr
std::enable_if_t<!std::is_same<ForwardIter, Sentinel>::value,
std::enable_if_t<!std::is_same_v<ForwardIter, Sentinel>,
std::ptrdiff_t>
sentinel_distance( ForwardIter iter, const Sentinel sentinel ) {
std::ptrdiff_t dist = 0;

View File

@@ -35,7 +35,7 @@ namespace Catch {
template <typename T>
void write( T const& value ) && {
writeImpl( value, !std::is_arithmetic<T>::value );
writeImpl( value, !std::is_arithmetic_v<T> );
}
void write( StringRef value ) &&;
void write( bool value ) &&;
@@ -49,7 +49,7 @@ namespace Catch {
// and multiple iteration over the strings
template <typename T,
typename = typename std::enable_if_t<
!std::is_convertible<T, StringRef>::value>>
!std::is_convertible_v<T, StringRef>>>
void writeImpl( T const& value, bool quote_value ) {
m_sstream << value;
writeImpl( m_sstream.str(), quote_value );

View File

@@ -1,44 +0,0 @@
// 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
#ifndef CATCH_LOGICAL_TRAITS_HPP_INCLUDED
#define CATCH_LOGICAL_TRAITS_HPP_INCLUDED
#include <type_traits>
namespace Catch {
namespace Detail {
#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510
using std::conjunction;
using std::disjunction;
using std::negation;
#else
template <class...> struct conjunction : std::true_type {};
template <class B1> struct conjunction<B1> : B1 {};
template <class B1, class... Bn>
struct conjunction<B1, Bn...>
: std::conditional_t<bool( B1::value ), conjunction<Bn...>, B1> {};
template <class...> struct disjunction : std::false_type {};
template <class B1> struct disjunction<B1> : B1 {};
template <class B1, class... Bn>
struct disjunction<B1, Bn...>
: std::conditional_t<bool( B1::value ), B1, disjunction<Bn...>> {};
template <class B>
struct negation : std::integral_constant<bool, !bool(B::value)> {};
#endif
} // namespace Detail
} // namespace Catch
#endif // CATCH_LOGICAL_TRAITS_HPP_INCLUDED

View File

@@ -27,16 +27,8 @@ namespace Catch {
template <typename Fun, typename... Args>
struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
// std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
// replaced with std::invoke_result here.
template <typename Func, typename... U>
using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U...>>>;
#else
template <typename Func, typename... U>
using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::result_of_t<Func(U...)>>>;
#endif
} // namespace Catch

View File

@@ -311,23 +311,6 @@ namespace Catch {
}
}
RedirectGuard::RedirectGuard( RedirectGuard&& rhs ) noexcept:
m_redirect( rhs.m_redirect ),
m_activate( rhs.m_activate ),
m_previouslyActive( rhs.m_previouslyActive ),
m_moved( false ) {
rhs.m_moved = true;
}
RedirectGuard& RedirectGuard::operator=( RedirectGuard&& rhs ) noexcept {
m_redirect = rhs.m_redirect;
m_activate = rhs.m_activate;
m_previouslyActive = rhs.m_previouslyActive;
m_moved = false;
rhs.m_moved = true;
return *this;
}
} // namespace Catch
#if defined( CATCH_CONFIG_NEW_CAPTURE )

View File

@@ -63,10 +63,6 @@ namespace Catch {
RedirectGuard( RedirectGuard const& ) = delete;
RedirectGuard& operator=( RedirectGuard const& ) = delete;
// C++14 needs move-able guards to return them from functions
RedirectGuard( RedirectGuard&& rhs ) noexcept;
RedirectGuard& operator=( RedirectGuard&& rhs ) noexcept;
};
RedirectGuard scopedActivate( OutputRedirect& redirectImpl );

View File

@@ -27,7 +27,7 @@ namespace Catch {
*/
template <typename FloatType>
FloatType gamma(FloatType a, FloatType b) {
static_assert( std::is_floating_point<FloatType>::value,
static_assert( std::is_floating_point_v<FloatType>,
"gamma returns the largest ULP magnitude within "
"floating point range [a, b]. This only makes sense "
"for floating point types" );

View File

@@ -122,7 +122,7 @@ namespace Catch {
template <typename UInt>
constexpr ExtendedMultResult<UInt> extendedMult( UInt lhs, UInt rhs ) {
static_assert( std::is_unsigned<UInt>::value,
static_assert( std::is_unsigned_v<UInt>,
"extendedMult can only handle unsigned integers" );
static_assert( sizeof( UInt ) < sizeof( std::uint64_t ),
"Generic extendedMult can only handle types smaller "
@@ -141,7 +141,7 @@ namespace Catch {
std::enable_if_t<sizeof(typename Generator::result_type) >= sizeof(TargetType),
TargetType> fillBitsFrom(Generator& gen) {
using gresult_type = typename Generator::result_type;
static_assert( std::is_unsigned<TargetType>::value, "Only unsigned integers are supported" );
static_assert( std::is_unsigned_v<TargetType>, "Only unsigned integers are supported" );
static_assert( Generator::min() == 0 &&
Generator::max() == static_cast<gresult_type>( -1 ),
"Generator must be able to output all numbers in its result type (effectively it must be a random bit generator)" );
@@ -160,7 +160,7 @@ namespace Catch {
std::enable_if_t<sizeof(typename Generator::result_type) < sizeof(TargetType),
TargetType> fillBitsFrom(Generator& gen) {
using gresult_type = typename Generator::result_type;
static_assert( std::is_unsigned<TargetType>::value,
static_assert( std::is_unsigned_v<TargetType>,
"Only unsigned integers are supported" );
static_assert( Generator::min() == 0 &&
Generator::max() == static_cast<gresult_type>( -1 ),
@@ -188,12 +188,12 @@ namespace Catch {
*/
template <typename OriginalType, typename UnsignedType>
constexpr
std::enable_if_t<std::is_signed<OriginalType>::value, UnsignedType>
std::enable_if_t<std::is_signed_v<OriginalType>, UnsignedType>
transposeToNaturalOrder( UnsignedType in ) {
static_assert(
sizeof( OriginalType ) == sizeof( UnsignedType ),
"reordering requires the same sized types on both sides" );
static_assert( std::is_unsigned<UnsignedType>::value,
static_assert( std::is_unsigned_v<UnsignedType>,
"Input type must be unsigned" );
// Assuming 2s complement (standardized in current C++), the
// positive and negative numbers are already internally ordered,
@@ -209,12 +209,12 @@ namespace Catch {
template <typename OriginalType,
typename UnsignedType>
constexpr
std::enable_if_t<std::is_unsigned<OriginalType>::value, UnsignedType>
std::enable_if_t<std::is_unsigned_v<OriginalType>, UnsignedType>
transposeToNaturalOrder(UnsignedType in) {
static_assert(
sizeof( OriginalType ) == sizeof( UnsignedType ),
"reordering requires the same sized types on both sides" );
static_assert( std::is_unsigned<UnsignedType>::value, "Input type must be unsigned" );
static_assert( std::is_unsigned_v<UnsignedType>, "Input type must be unsigned" );
// No reordering is needed for unsigned -> unsigned
return in;
}

View File

@@ -114,8 +114,7 @@ namespace Catch {
// First part is always reporter name, so we skip it
for ( size_t i = 1; i < parts.size(); ++i ) {
auto kv = splitKVPair( parts[i] );
auto key = kv.key, value = kv.value;
const auto [key, value] = splitKVPair( parts[i] );
if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone)
return {};
@@ -126,7 +125,7 @@ namespace Catch {
return {};
}
auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) );
auto ret = kvPairs.emplace( std::string(key), std::string(value) );
if ( !ret.second ) {
// Duplicated key. We might want to handle this differently,
// e.g. by overwriting the existing value?
@@ -137,7 +136,7 @@ namespace Catch {
if ( outputFileName ) {
return {};
}
outputFileName = static_cast<std::string>( value );
outputFileName = std::string( value );
} else if ( key == "colour-mode" ) {
// Duplicated key
if ( colourMode ) {

View File

@@ -7,7 +7,6 @@
// SPDX-License-Identifier: BSL-1.0
#include <catch2/internal/catch_uncaught_exceptions.hpp>
#include <catch2/internal/catch_config_uncaught_exceptions.hpp>
#include <catch2/catch_user_config.hpp>
#include <exception>
@@ -16,10 +15,8 @@ namespace Catch {
bool uncaught_exceptions() {
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
return false;
#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
return std::uncaught_exceptions() > 0;
#else
return std::uncaught_exception();
return std::uncaught_exceptions() > 0;
#endif
}
} // end namespace Catch

View File

@@ -67,8 +67,8 @@ namespace Catch {
*/
template <typename FloatType>
class uniform_floating_point_distribution {
static_assert(std::is_floating_point<FloatType>::value, "...");
static_assert(!std::is_same<FloatType, long double>::value,
static_assert(std::is_floating_point_v<FloatType>, "...");
static_assert(!std::is_same_v<FloatType, long double>,
"We do not support long double due to inconsistent behaviour between platforms");
using WidthType = Detail::DistanceType<FloatType>;

View File

@@ -26,7 +26,7 @@ namespace Catch {
*/
template <typename IntegerType>
class uniform_integer_distribution {
static_assert(std::is_integral<IntegerType>::value, "...");
static_assert(std::is_integral_v<IntegerType>, "...");
using UnsignedIntegerType = Detail::SizedUnsignedType_t<sizeof(IntegerType)>;

View File

@@ -31,12 +31,12 @@ namespace Detail {
m_ptr(ptr)
{}
template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
template <typename U, typename = std::enable_if_t<std::is_base_of_v<T, U>>>
unique_ptr(unique_ptr<U>&& from):
m_ptr(from.release())
{}
template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
template <typename U, typename = std::enable_if_t<std::is_base_of_v<T, U>>>
unique_ptr& operator=(unique_ptr<U>&& from) {
reset(from.release());

View File

@@ -81,7 +81,7 @@ namespace Catch {
// While it would still work, it would cause code bloat
// and multiple iteration over the strings
typename = typename std::enable_if_t<
!std::is_convertible<T, StringRef>::value>>
!std::is_convertible_v<T, StringRef>>>
ScopedElement& writeAttribute( StringRef name,
T const& attribute ) {
m_writer->writeAttribute( name, attribute );
@@ -122,7 +122,7 @@ namespace Catch {
// While it would still work, it would cause code bloat
// and multiple iteration over the strings
typename = typename std::enable_if_t<
!std::is_convertible<T, StringRef>::value>>
!std::is_convertible_v<T, StringRef>>>
XmlWriter& writeAttribute( StringRef name, T const& attribute ) {
ReusableStringStream rss;
rss << attribute;

View File

@@ -9,7 +9,6 @@
#define CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
#include <catch2/matchers/catch_matchers_templated.hpp>
#include <catch2/internal/catch_container_nonmembers.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
namespace Catch {

View File

@@ -49,7 +49,7 @@ public:
template<typename T, typename Pred>
PredicateMatcher<T, Pred> Predicate(Pred&& predicate, std::string const& description = "") {
static_assert(is_callable<Pred(T)>::value, "Predicate not callable with argument T");
static_assert(std::is_same<bool, FunctionReturnType<Pred, T>>::value, "Predicate does not return bool");
static_assert(std::is_same_v<bool, FunctionReturnType<Pred, T>>, "Predicate does not return bool");
return PredicateMatcher<T, Pred>(CATCH_FORWARD(predicate), description);
}

View File

@@ -11,7 +11,6 @@
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
#include <catch2/internal/catch_logical_traits.hpp>
#include <array>
#include <algorithm>
@@ -58,19 +57,19 @@ namespace Matchers {
}
template<typename T>
static constexpr bool is_generic_matcher_v = std::is_base_of<
static constexpr bool is_generic_matcher_v = std::is_base_of_v<
Catch::Matchers::MatcherGenericBase,
std::remove_cv_t<std::remove_reference_t<T>>
>::value;
>;
template<typename... Ts>
static constexpr bool are_generic_matchers_v = Catch::Detail::conjunction<std::integral_constant<bool,is_generic_matcher_v<Ts>>...>::value;
static constexpr bool are_generic_matchers_v = std::conjunction_v<std::integral_constant<bool,is_generic_matcher_v<Ts>>...>;
template<typename T>
static constexpr bool is_matcher_v = std::is_base_of<
static constexpr bool is_matcher_v = std::is_base_of_v<
Catch::Matchers::MatcherUntypedBase,
std::remove_cv_t<std::remove_reference_t<T>>
>::value;
>;
template<std::size_t N, typename Arg>

View File

@@ -117,17 +117,17 @@ namespace Matchers {
std::string describe() const override {
return "is approx: " + ::Catch::Detail::stringify( m_comparator );
}
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename = std::enable_if_t<std::is_constructible_v<double, T>>>
ApproxMatcher& epsilon( T const& newEpsilon ) {
approx.epsilon(static_cast<double>(newEpsilon));
return *this;
}
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename = std::enable_if_t<std::is_constructible_v<double, T>>>
ApproxMatcher& margin( T const& newMargin ) {
approx.margin(static_cast<double>(newMargin));
return *this;
}
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
template <typename = std::enable_if_t<std::is_constructible_v<double, T>>>
ApproxMatcher& scale( T const& newScale ) {
approx.scale(static_cast<double>(newScale));
return *this;

View File

@@ -83,11 +83,9 @@ internal_headers = [
'internal/catch_config_counter.hpp',
'internal/catch_config_prefix_messages.hpp',
'internal/catch_config_static_analysis_support.hpp',
'internal/catch_config_uncaught_exceptions.hpp',
'internal/catch_config_wchar.hpp',
'internal/catch_console_colour.hpp',
'internal/catch_console_width.hpp',
'internal/catch_container_nonmembers.hpp',
'internal/catch_context.hpp',
'internal/catch_debug_console.hpp',
'internal/catch_debugger.hpp',
@@ -106,7 +104,6 @@ internal_headers = [
'internal/catch_lazy_expr.hpp',
'internal/catch_leak_detector.hpp',
'internal/catch_list.hpp',
'internal/catch_logical_traits.hpp',
'internal/catch_message_info.hpp',
'internal/catch_meta.hpp',
'internal/catch_move_and_forward.hpp',
@@ -374,7 +371,7 @@ if get_option('install')
pkg.generate(
catch2,
filebase: 'catch2',
description: 'A modern, C++-native, test framework for C++14 and above',
description: 'A modern, C++-native, test framework for C++17 and above',
url: 'https://github.com/catchorg/Catch2',
)
endif
@@ -396,7 +393,7 @@ if get_option('install')
pkg.generate(
catch2_with_main,
filebase: 'catch2-with-main',
description: 'A modern, C++-native, test framework for C++14 and above (links in default main)',
description: 'A modern, C++-native, test framework for C++17 and above (links in default main)',
requires: 'catch2 = ' + meson.project_version(),
)
endif

View File

@@ -514,7 +514,7 @@ add_executable(AmalgamatedTestCompilation
${CATCH_DIR}/extras/catch_amalgamated.cpp
)
target_include_directories(AmalgamatedTestCompilation PRIVATE ${CATCH_DIR}/extras)
target_compile_features(AmalgamatedTestCompilation PRIVATE cxx_std_14)
target_compile_features(AmalgamatedTestCompilation PRIVATE cxx_std_17)
add_test(NAME AmalgamatedFileTest COMMAND AmalgamatedTestCompilation)
set_tests_properties(AmalgamatedFileTest

View File

@@ -72,10 +72,10 @@ CATCH_TEST_CASE("PrefixedMacros") {
}
}
CATCH_STATIC_REQUIRE( std::is_void<void>::value );
CATCH_STATIC_REQUIRE_FALSE( std::is_void<int>::value );
CATCH_STATIC_CHECK( std::is_void<void>::value );
CATCH_STATIC_CHECK_FALSE( std::is_void<int>::value );
CATCH_STATIC_REQUIRE( std::is_void_v<void> );
CATCH_STATIC_REQUIRE_FALSE( std::is_void_v<int> );
CATCH_STATIC_CHECK( std::is_void_v<void> );
CATCH_STATIC_CHECK_FALSE( std::is_void_v<int> );
CATCH_FAIL("");
}

View File

@@ -21,7 +21,7 @@ This warning message starts with a linebreak'
This would not be caught previously
Nor would this
Tricky.tests.cpp:<line number>: failed: explicitly with 1 message: '1514'
Compilation.tests.cpp:<line number>: passed: std::is_same<TypeList<int>, TypeList<int>>::value for: true
Compilation.tests.cpp:<line number>: passed: std::is_same_v<TypeList<int>, TypeList<int>> for: true
TestSpec.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec . char")) for: true
TestSpec.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec , char")) for: true
TestSpec.tests.cpp:<line number>: passed: !(spec.matches(*fakeTestCase(R"(spec \, char)"))) for: !false
@@ -436,32 +436,32 @@ B
Using code: 0
C
"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>'
Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>'
Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } )
Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" )
@@ -1273,10 +1273,10 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'c
Tricky.tests.cpp:<line number>: passed: True for: {?}
Tricky.tests.cpp:<line number>: passed: !False for: true
Tricky.tests.cpp:<line number>: passed: !(False) for: !{?}
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void_v<void>'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void_v<int>)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void_v<void>'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void_v<int>)'
Condition.tests.cpp:<line number>: failed: data.int_seven > 7 for: 7 > 7
Condition.tests.cpp:<line number>: failed: data.int_seven < 7 for: 7 < 7
Condition.tests.cpp:<line number>: failed: data.int_seven > 8 for: 7 > 8
@@ -1511,9 +1511,9 @@ CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-no-ana
CmdLine.tests.cpp:<line number>: passed: config.benchmarkNoAnalysis for: true
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 10 == 10
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 3 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 2 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 1 >= 1
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
@@ -1906,13 +1906,13 @@ Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag wi
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10

View File

@@ -19,7 +19,7 @@ Message.tests.cpp:<line number>: warning: '
This info message starts with a linebreak' with 1 message: '
This warning message starts with a linebreak'
Tricky.tests.cpp:<line number>: failed: explicitly with 1 message: '1514'
Compilation.tests.cpp:<line number>: passed: std::is_same<TypeList<int>, TypeList<int>>::value for: true
Compilation.tests.cpp:<line number>: passed: std::is_same_v<TypeList<int>, TypeList<int>> for: true
TestSpec.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec . char")) for: true
TestSpec.tests.cpp:<line number>: passed: spec.matches(*fakeTestCase("spec , char")) for: true
TestSpec.tests.cpp:<line number>: passed: !(spec.matches(*fakeTestCase(R"(spec \, char)"))) for: !false
@@ -434,32 +434,32 @@ B
Using code: 0
C
"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
Matchers.tests.cpp:<line number>: passed: 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>'
Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>'
Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1"
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value'
Matchers.tests.cpp:<line number>: passed: with 1 message: 'std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>'
Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 )
Matchers.tests.cpp:<line number>: passed: vec, Predicate<std::vector<int>>( []( auto const& v ) { return std::all_of( v.begin(), v.end(), []( int elem ) { return elem % 2 == 1; } ); }, "All elements are odd" ) && !EqualsRange( a ) for: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } )
Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" )
@@ -1271,10 +1271,10 @@ Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'c
Tricky.tests.cpp:<line number>: passed: True for: {?}
Tricky.tests.cpp:<line number>: passed: !False for: true
Tricky.tests.cpp:<line number>: passed: !(False) for: !{?}
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void<void>::value'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void<int>::value)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void_v<void>'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void_v<int>)'
Compilation.tests.cpp:<line number>: passed: with 1 message: 'std::is_void_v<void>'
Compilation.tests.cpp:<line number>: passed: with 1 message: '!(std::is_void_v<int>)'
Condition.tests.cpp:<line number>: failed: data.int_seven > 7 for: 7 > 7
Condition.tests.cpp:<line number>: failed: data.int_seven < 7 for: 7 < 7
Condition.tests.cpp:<line number>: failed: data.int_seven > 8 for: 7 > 8
@@ -1509,9 +1509,9 @@ CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-no-ana
CmdLine.tests.cpp:<line number>: passed: config.benchmarkNoAnalysis for: true
CmdLine.tests.cpp:<line number>: passed: cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?}
CmdLine.tests.cpp:<line number>: passed: config.benchmarkWarmupTime == 10 for: 10 == 10
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 3 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 2 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 3 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 2 >= 1
Misc.tests.cpp:<line number>: passed: std::tuple_size_v<TestType> >= 1 for: 1 >= 1
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
@@ -1899,13 +1899,13 @@ Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag wi
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic<TestType>::value for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_default_constructible_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_trivially_copyable_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: std::is_arithmetic_v<TestType> for: true
Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5
Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5
Misc.tests.cpp:<line number>: passed: v.size() == 10 for: 10 == 10

View File

@@ -159,7 +159,7 @@ Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value )
REQUIRE( std::is_same_v<TypeList<int>, TypeList<int>> )
with expansion:
true
@@ -3274,8 +3274,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::
Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ),
Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() )
@@ -3285,8 +3285,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::
Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ),
Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) )
@@ -3296,9 +3296,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() &&
std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() &&
MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA,
MatcherB, MatcherC, MatcherD>>:: value
MatcherB, MatcherC, MatcherD>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) )
@@ -3314,8 +3314,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::
Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ),
Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() )
@@ -3325,8 +3325,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::
Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ),
Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) )
@@ -3336,9 +3336,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() ||
std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() ||
MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA,
MatcherB, MatcherC, MatcherD>>:: value
MatcherB, MatcherC, MatcherD>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) )
@@ -3354,8 +3354,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>::value
std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 0, !MatcherA() )
@@ -3364,7 +3364,7 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value
std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, !!MatcherA() )
@@ -3373,8 +3373,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>::value
std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 0, !!!MatcherA() )
@@ -3383,7 +3383,7 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value
std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, !!!!MatcherA() )
@@ -3398,9 +3398,9 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) &&
std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) &&
EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::
MatchAnyOf<std::string>>::value
MatchAnyOf<std::string>>
-------------------------------------------------------------------------------
Combining only templated matchers
@@ -3410,8 +3410,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB>>::value
std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:
: MatchAnyOfGeneric<MatcherA, MatcherB>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || MatcherB() )
@@ -3420,8 +3420,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB>>::value
std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:
: MatchAllOfGeneric<MatcherA, MatcherB>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() && MatcherB() )
@@ -3430,9 +3430,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail:
:MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric
<MatcherB>>>::value
std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::
Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherB>>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || !MatcherB() )
@@ -8475,19 +8475,19 @@ Compilation.tests.cpp:<line number>
Compilation.tests.cpp:<line number>: PASSED:
with message:
std::is_void<void>::value
std::is_void_v<void>
Compilation.tests.cpp:<line number>: PASSED:
with message:
!(std::is_void<int>::value)
!(std::is_void_v<int>)
Compilation.tests.cpp:<line number>: PASSED:
with message:
std::is_void<void>::value
std::is_void_v<void>
Compilation.tests.cpp:<line number>: PASSED:
with message:
!(std::is_void<int>::value)
!(std::is_void_v<int>)
-------------------------------------------------------------------------------
Ordering comparison checks that should fail
@@ -10052,7 +10052,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
3 >= 1
@@ -10063,7 +10063,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
2 >= 1
@@ -10074,7 +10074,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
1 >= 1
@@ -12106,7 +12106,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_default_constructible<TestType>::value )
REQUIRE( std::is_default_constructible_v<TestType> )
with expansion:
true
@@ -12118,7 +12118,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_default_constructible<TestType>::value )
REQUIRE( std::is_default_constructible_v<TestType> )
with expansion:
true
@@ -12130,7 +12130,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_trivially_copyable<TestType>::value )
REQUIRE( std::is_trivially_copyable_v<TestType> )
with expansion:
true
@@ -12142,7 +12142,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_trivially_copyable<TestType>::value )
REQUIRE( std::is_trivially_copyable_v<TestType> )
with expansion:
true
@@ -12153,7 +12153,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true
@@ -12164,7 +12164,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true
@@ -12175,7 +12175,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true

View File

@@ -157,7 +157,7 @@ Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value )
REQUIRE( std::is_same_v<TypeList<int>, TypeList<int>> )
with expansion:
true
@@ -3272,8 +3272,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::
Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ),
Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() )
@@ -3283,8 +3283,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::
Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ),
Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) )
@@ -3294,9 +3294,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() &&
std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() &&
MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA,
MatcherB, MatcherC, MatcherD>>:: value
MatcherB, MatcherC, MatcherD>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) )
@@ -3312,8 +3312,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::
Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ),
Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() )
@@ -3323,8 +3323,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::
Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value
std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ),
Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) )
@@ -3334,9 +3334,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() ||
std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() ||
MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA,
MatcherB, MatcherC, MatcherD>>:: value
MatcherB, MatcherC, MatcherD>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) )
@@ -3352,8 +3352,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>::value
std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 0, !MatcherA() )
@@ -3362,7 +3362,7 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value
std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, !!MatcherA() )
@@ -3371,8 +3371,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>::value
std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherA>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 0, !!!MatcherA() )
@@ -3381,7 +3381,7 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value
std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, !!!!MatcherA() )
@@ -3396,9 +3396,9 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) &&
std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) &&
EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::
MatchAnyOf<std::string>>::value
MatchAnyOf<std::string>>
-------------------------------------------------------------------------------
Combining only templated matchers
@@ -3408,8 +3408,8 @@ Matchers.tests.cpp:<line number>
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB>>::value
std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:
: MatchAnyOfGeneric<MatcherA, MatcherB>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || MatcherB() )
@@ -3418,8 +3418,8 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB>>::value
std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:
: MatchAllOfGeneric<MatcherA, MatcherB>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() && MatcherB() )
@@ -3428,9 +3428,9 @@ with expansion:
Matchers.tests.cpp:<line number>: PASSED:
with message:
std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail:
:MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric
<MatcherB>>>::value
std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::
Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::
MatchNotOfGeneric<MatcherB>>>
Matchers.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( 1, MatcherA() || !MatcherB() )
@@ -8473,19 +8473,19 @@ Compilation.tests.cpp:<line number>
Compilation.tests.cpp:<line number>: PASSED:
with message:
std::is_void<void>::value
std::is_void_v<void>
Compilation.tests.cpp:<line number>: PASSED:
with message:
!(std::is_void<int>::value)
!(std::is_void_v<int>)
Compilation.tests.cpp:<line number>: PASSED:
with message:
std::is_void<void>::value
std::is_void_v<void>
Compilation.tests.cpp:<line number>: PASSED:
with message:
!(std::is_void<int>::value)
!(std::is_void_v<int>)
-------------------------------------------------------------------------------
Ordering comparison checks that should fail
@@ -10050,7 +10050,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
3 >= 1
@@ -10061,7 +10061,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
2 >= 1
@@ -10072,7 +10072,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::tuple_size<TestType>::value >= 1 )
REQUIRE( std::tuple_size_v<TestType> >= 1 )
with expansion:
1 >= 1
@@ -12099,7 +12099,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_default_constructible<TestType>::value )
REQUIRE( std::is_default_constructible_v<TestType> )
with expansion:
true
@@ -12111,7 +12111,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_default_constructible<TestType>::value )
REQUIRE( std::is_default_constructible_v<TestType> )
with expansion:
true
@@ -12123,7 +12123,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_trivially_copyable<TestType>::value )
REQUIRE( std::is_trivially_copyable_v<TestType> )
with expansion:
true
@@ -12135,7 +12135,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_trivially_copyable<TestType>::value )
REQUIRE( std::is_trivially_copyable_v<TestType> )
with expansion:
true
@@ -12146,7 +12146,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true
@@ -12157,7 +12157,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true
@@ -12168,7 +12168,7 @@ Misc.tests.cpp:<line number>
...............................................................................
Misc.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_arithmetic<TestType>::value )
REQUIRE( std::is_arithmetic_v<TestType> )
with expansion:
true

View File

@@ -159,7 +159,7 @@ Compilation.tests.cpp:<line number>
...............................................................................
Compilation.tests.cpp:<line number>: PASSED:
REQUIRE( std::is_same<TypeList<int>, TypeList<int>>::value )
REQUIRE( std::is_same_v<TypeList<int>, TypeList<int>> )
with expansion:
true

View File

@@ -39,7 +39,7 @@ Nor would this
# #1514: stderr/stdout is not captured in tests aborted by an exception
not ok {test-number} - explicitly with 1 message: '1514'
# #1548
ok {test-number} - std::is_same<TypeList<int>, TypeList<int>>::value for: true
ok {test-number} - std::is_same_v<TypeList<int>, TypeList<int>> for: true
# #1905 -- test spec parser properly clears internal state between compound tests
ok {test-number} - spec.matches(*fakeTestCase("spec . char")) for: true
# #1905 -- test spec parser properly clears internal state between compound tests
@@ -773,57 +773,57 @@ ok {test-number} - streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3
# ColourGuard behaviour
ok {test-number} - streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 A B Using code: 0 C " == "Using code: 2 A B Using code: 0 C "
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true )
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1"
# Combining concrete matchers does not use templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>'
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 )
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 )
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 )
# Combining templated and concrete matchers
@@ -2085,13 +2085,13 @@ ok {test-number} - !False for: true
# Objects that evaluated in boolean contexts can be checked
ok {test-number} - !(False) for: !{?}
# Optionally static assertions
ok {test-number} - with 1 message: 'std::is_void<void>::value'
ok {test-number} - with 1 message: 'std::is_void_v<void>'
# Optionally static assertions
ok {test-number} - with 1 message: '!(std::is_void<int>::value)'
ok {test-number} - with 1 message: '!(std::is_void_v<int>)'
# Optionally static assertions
ok {test-number} - with 1 message: 'std::is_void<void>::value'
ok {test-number} - with 1 message: 'std::is_void_v<void>'
# Optionally static assertions
ok {test-number} - with 1 message: '!(std::is_void<int>::value)'
ok {test-number} - with 1 message: '!(std::is_void_v<int>)'
# Ordering comparison checks that should fail
not ok {test-number} - data.int_seven > 7 for: 7 > 7
# Ordering comparison checks that should fail
@@ -2497,11 +2497,11 @@ ok {test-number} - cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkWarmupTime == 10 for: 10 == 10
# Product with differing arities - std::tuple<int, double, float>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 3 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 3 >= 1
# Product with differing arities - std::tuple<int, double>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 2 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 2 >= 1
# Product with differing arities - std::tuple<int>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 1 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 1 >= 1
# Random seed generation accepts known methods
ok {test-number} - Catch::generateRandomSeed(method)
# Random seed generation accepts known methods
@@ -2882,19 +2882,19 @@ ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
# Template test case method with test types specified inside std::tuple - MyTypes - 2
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0
ok {test-number} - std::is_default_constructible<TestType>::value for: true
ok {test-number} - std::is_default_constructible_v<TestType> for: true
# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1
ok {test-number} - std::is_default_constructible<TestType>::value for: true
ok {test-number} - std::is_default_constructible_v<TestType> for: true
# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0
ok {test-number} - std::is_trivially_copyable<TestType>::value for: true
ok {test-number} - std::is_trivially_copyable_v<TestType> for: true
# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1
ok {test-number} - std::is_trivially_copyable<TestType>::value for: true
ok {test-number} - std::is_trivially_copyable_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 0
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 1
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 2
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# TemplateTest: vectors can be sized and resized - float
ok {test-number} - v.size() == 5 for: 5 == 5
# TemplateTest: vectors can be sized and resized - float

View File

@@ -37,7 +37,7 @@ This warning message starts with a linebreak'
# #1514: stderr/stdout is not captured in tests aborted by an exception
not ok {test-number} - explicitly with 1 message: '1514'
# #1548
ok {test-number} - std::is_same<TypeList<int>, TypeList<int>>::value for: true
ok {test-number} - std::is_same_v<TypeList<int>, TypeList<int>> for: true
# #1905 -- test spec parser properly clears internal state between compound tests
ok {test-number} - spec.matches(*fakeTestCase("spec . char")) for: true
# #1905 -- test spec parser properly clears internal state between compound tests
@@ -771,57 +771,57 @@ ok {test-number} - streamWrapper.str() == "1\nUsing code: 2\n2\nUsing code: 0\n3
# ColourGuard behaviour
ok {test-number} - streamWrapper.str() == "Using code: 2\nA\nB\nUsing code: 0\nC\n" for: "Using code: 2 A B Using code: 0 C " == "Using code: 2 A B Using code: 0 C "
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 )
# Combining MatchAllOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
# Combining MatchAllOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 and equals: (T) 1 and equals: true )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 )
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>'
# Combining MatchAnyOfGeneric does not nest
ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 or equals: (T) 1 or equals: true )
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( !!MatcherA() ), MatcherA const&>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (string) "1"
# Combining MatchNotOfGeneric does not nest
ok {test-number} - with 1 message: 'std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&>'
# Combining MatchNotOfGeneric does not nest
ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (string) "1"
# Combining concrete matchers does not use templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>'
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or equals: (long long) 1 )
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value'
ok {test-number} - with 1 message: 'std::is_same_v<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (string) "1" and equals: (long long) 1 )
# Combining only templated matchers
ok {test-number} - with 1 message: 'std::is_same< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value'
ok {test-number} - with 1 message: 'std::is_same_v< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>'
# Combining only templated matchers
ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (string) "1" or not equals: (long long) 1 )
# Combining templated and concrete matchers
@@ -2083,13 +2083,13 @@ ok {test-number} - !False for: true
# Objects that evaluated in boolean contexts can be checked
ok {test-number} - !(False) for: !{?}
# Optionally static assertions
ok {test-number} - with 1 message: 'std::is_void<void>::value'
ok {test-number} - with 1 message: 'std::is_void_v<void>'
# Optionally static assertions
ok {test-number} - with 1 message: '!(std::is_void<int>::value)'
ok {test-number} - with 1 message: '!(std::is_void_v<int>)'
# Optionally static assertions
ok {test-number} - with 1 message: 'std::is_void<void>::value'
ok {test-number} - with 1 message: 'std::is_void_v<void>'
# Optionally static assertions
ok {test-number} - with 1 message: '!(std::is_void<int>::value)'
ok {test-number} - with 1 message: '!(std::is_void_v<int>)'
# Ordering comparison checks that should fail
not ok {test-number} - data.int_seven > 7 for: 7 > 7
# Ordering comparison checks that should fail
@@ -2495,11 +2495,11 @@ ok {test-number} - cli.parse({ "test", "--benchmark-warmup-time=10" }) for: {?}
# Process can be configured on command line
ok {test-number} - config.benchmarkWarmupTime == 10 for: 10 == 10
# Product with differing arities - std::tuple<int, double, float>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 3 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 3 >= 1
# Product with differing arities - std::tuple<int, double>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 2 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 2 >= 1
# Product with differing arities - std::tuple<int>
ok {test-number} - std::tuple_size<TestType>::value >= 1 for: 1 >= 1
ok {test-number} - std::tuple_size_v<TestType> >= 1 for: 1 >= 1
# Random seed generation accepts known methods
ok {test-number} - Catch::generateRandomSeed(method)
# Random seed generation accepts known methods
@@ -2875,19 +2875,19 @@ ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
# Template test case method with test types specified inside std::tuple - MyTypes - 2
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0
ok {test-number} - std::is_default_constructible<TestType>::value for: true
ok {test-number} - std::is_default_constructible_v<TestType> for: true
# Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1
ok {test-number} - std::is_default_constructible<TestType>::value for: true
ok {test-number} - std::is_default_constructible_v<TestType> for: true
# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0
ok {test-number} - std::is_trivially_copyable<TestType>::value for: true
ok {test-number} - std::is_trivially_copyable_v<TestType> for: true
# Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1
ok {test-number} - std::is_trivially_copyable<TestType>::value for: true
ok {test-number} - std::is_trivially_copyable_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 0
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 1
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# Template test case with test types specified inside std::tuple - MyTypes - 2
ok {test-number} - std::is_arithmetic<TestType>::value for: true
ok {test-number} - std::is_arithmetic_v<TestType> for: true
# TemplateTest: vectors can be sized and resized - float
ok {test-number} - v.size() == 5 for: 5 == 5
# TemplateTest: vectors can be sized and resized - float

View File

@@ -154,7 +154,7 @@ Nor would this
<TestCase name="#1548" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
std::is_same&lt;TypeList&lt;int>, TypeList&lt;int>>::value
std::is_same_v&lt;TypeList&lt;int>, TypeList&lt;int>>
</Original>
<Expanded>
true
@@ -12057,7 +12057,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int, double, float>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
3 >= 1
@@ -12068,7 +12068,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int, double>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
2 >= 1
@@ -12079,7 +12079,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
1 >= 1
@@ -14113,7 +14113,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_default_constructible&lt;TestType>::value
std::is_default_constructible_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14124,7 +14124,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_default_constructible&lt;TestType>::value
std::is_default_constructible_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14135,7 +14135,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_trivially_copyable&lt;TestType>::value
std::is_trivially_copyable_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14146,7 +14146,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_trivially_copyable&lt;TestType>::value
std::is_trivially_copyable_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14157,7 +14157,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14168,7 +14168,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14179,7 +14179,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true

View File

@@ -154,7 +154,7 @@ Nor would this
<TestCase name="#1548" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" >
<Original>
std::is_same&lt;TypeList&lt;int>, TypeList&lt;int>>::value
std::is_same_v&lt;TypeList&lt;int>, TypeList&lt;int>>
</Original>
<Expanded>
true
@@ -12057,7 +12057,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int, double, float>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
3 >= 1
@@ -12068,7 +12068,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int, double>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
2 >= 1
@@ -12079,7 +12079,7 @@ Approx( 0.98999999999999999 )
<TestCase name="Product with differing arities - std::tuple&lt;int>" tags="[product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::tuple_size&lt;TestType>::value >= 1
std::tuple_size_v&lt;TestType> >= 1
</Original>
<Expanded>
1 >= 1
@@ -14113,7 +14113,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_default_constructible&lt;TestType>::value
std::is_default_constructible_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14124,7 +14124,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-copyable and non-movable std::tuple - NonCopyableAndNonMovableTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_default_constructible&lt;TestType>::value
std::is_default_constructible_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14135,7 +14135,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_trivially_copyable&lt;TestType>::value
std::is_trivially_copyable_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14146,7 +14146,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside non-default-constructible std::tuple - MyNonDefaultConstructibleTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_trivially_copyable&lt;TestType>::value
std::is_trivially_copyable_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14157,7 +14157,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 0" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14168,7 +14168,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 1" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true
@@ -14179,7 +14179,7 @@ Message from section two
<TestCase name="Template test case with test types specified inside std::tuple - MyTypes - 2" tags="[list][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
<Original>
std::is_arithmetic&lt;TestType>::value
std::is_arithmetic_v&lt;TestType>
</Original>
<Expanded>
true

View File

@@ -443,13 +443,9 @@ TEST_CASE( "Parse rng seed in different formats", "[approvals][cli][rng-seed]" )
auto cli = Catch::makeCommandLineParser( config );
SECTION("well formed cases") {
char const* seed_string;
uint32_t seed_value;
// GCC-5 workaround
using gen_type = std::tuple<char const*, uint32_t>;
std::tie( seed_string, seed_value ) = GENERATE( table<char const*, uint32_t>({
gen_type{ "0xBEEF", 0xBEEF },
gen_type{ "12345678", 12345678 }
auto [seed_string, seed_value] = GENERATE( table<char const*, uint32_t>({
{ "0xBEEF", 0xBEEF },
{ "12345678", 12345678 }
} ) );
CAPTURE( seed_string );

View File

@@ -130,10 +130,10 @@ TEST_CASE( "count_equidistant_floats",
std::numeric_limits<double>::max() ) ==
18014398509481982 ); // (1 << 54) - 2 due to not including infinities
STATIC_REQUIRE( std::is_same<std::uint64_t,
STATIC_REQUIRE( std::is_same_v<std::uint64_t,
decltype( count_floats_with_scaled_ulp(
0., 1. ) )>::value );
STATIC_REQUIRE( std::is_same<std::uint32_t,
0., 1. ) )> );
STATIC_REQUIRE( std::is_same_v<std::uint32_t,
decltype( count_floats_with_scaled_ulp(
0.f, 1.f ) )>::value );
0.f, 1.f ) )> );
}

View File

@@ -427,7 +427,7 @@ TEST_CASE("GENERATE handles function (pointers)", "[generators][compilation][app
TEST_CASE("GENERATE decays arrays", "[generators][compilation][approvals]") {
auto str = GENERATE("abc", "def", "gh");
(void)str;
STATIC_REQUIRE(std::is_same<decltype(str), const char*>::value);
STATIC_REQUIRE(std::is_same_v<decltype(str), const char*>);
}
TEST_CASE("Generators count returned elements", "[generators][approvals]") {

View File

@@ -146,11 +146,11 @@ TEST_CASE( "SizedUnsignedType helpers", "[integer][approvals]" ) {
STATIC_REQUIRE( sizeof( SizedUnsignedType_t<8> ) == 8 );
STATIC_REQUIRE( sizeof( DoubleWidthUnsignedType_t<std::uint8_t> ) == 2 );
STATIC_REQUIRE( std::is_unsigned<DoubleWidthUnsignedType_t<std::uint8_t>>::value );
STATIC_REQUIRE( std::is_unsigned_v<DoubleWidthUnsignedType_t<std::uint8_t>> );
STATIC_REQUIRE( sizeof( DoubleWidthUnsignedType_t<std::uint16_t> ) == 4 );
STATIC_REQUIRE( std::is_unsigned<DoubleWidthUnsignedType_t<std::uint16_t>>::value );
STATIC_REQUIRE( std::is_unsigned_v<DoubleWidthUnsignedType_t<std::uint16_t>> );
STATIC_REQUIRE( sizeof( DoubleWidthUnsignedType_t<std::uint32_t> ) == 8 );
STATIC_REQUIRE( std::is_unsigned<DoubleWidthUnsignedType_t<std::uint32_t>>::value );
STATIC_REQUIRE( std::is_unsigned_v<DoubleWidthUnsignedType_t<std::uint32_t>> );
}
TEST_CASE( "extendedMult 32x32", "[integer][approvals]" ) {

View File

@@ -214,7 +214,7 @@ TEMPLATE_TEST_CASE( "uniform_integer_distribution can handle full width ranges",
constexpr auto lowest = std::numeric_limits<TestType>::min();
constexpr auto highest = std::numeric_limits<TestType>::max();
Catch::uniform_integer_distribution<TestType> dist( lowest, highest );
STATIC_REQUIRE( std::is_same<TestType, decltype( dist( pcg ) )>::value );
STATIC_REQUIRE( std::is_same_v<TestType, decltype( dist( pcg ) )> );
// We need to do bit operations on the results, so we will have to
// cast them to unsigned type.
@@ -451,21 +451,6 @@ namespace {
381264073 };
};
// We need these definitions for C++14 and earlier, but
// GCC will complain about them in newer C++ standards
#if __cplusplus <= 201402L
constexpr bool uniform_integer_test_params<bool>::expected[];
constexpr char uniform_integer_test_params<char>::expected[];
constexpr uint8_t uniform_integer_test_params<uint8_t>::expected[];
constexpr int8_t uniform_integer_test_params<int8_t>::expected[];
constexpr uint16_t uniform_integer_test_params<uint16_t>::expected[];
constexpr int16_t uniform_integer_test_params<int16_t>::expected[];
constexpr uint32_t uniform_integer_test_params<uint32_t>::expected[];
constexpr int32_t uniform_integer_test_params<int32_t>::expected[];
constexpr uint64_t uniform_integer_test_params<uint64_t>::expected[];
constexpr int64_t uniform_integer_test_params<int64_t>::expected[];
#endif
}
TEMPLATE_TEST_CASE( "uniform_integer_distribution is reproducible",
@@ -559,13 +544,6 @@ namespace {
60912.7615841752,
-149060.05936760217 };
};
// We need these definitions for C++14 and earlier, but
// GCC will complain about them in newer C++ standards
#if __cplusplus <= 201402L
constexpr float uniform_fp_test_params<float>::expected[];
constexpr double uniform_fp_test_params<double>::expected[];
#endif
} // namespace
TEMPLATE_TEST_CASE( "uniform_floating_point_distribution is reproducible",

View File

@@ -17,8 +17,8 @@ static const char * const whitespace_at_both_ends = " \r\n \t There is no extra
TEST_CASE("Trim strings", "[string-manip]") {
using Catch::trim; using Catch::StringRef;
static_assert(std::is_same<std::string, decltype(trim(std::string{}))>::value, "Trimming std::string should return std::string");
static_assert(std::is_same<StringRef, decltype(trim(StringRef{}))>::value, "Trimming StringRef should return StringRef");
static_assert(std::is_same_v<std::string, decltype(trim(std::string{}))>, "Trimming std::string should return std::string");
static_assert(std::is_same_v<StringRef, decltype(trim(StringRef{}))>, "Trimming StringRef should return StringRef");
REQUIRE(trim(std::string(no_whitespace)) == no_whitespace);
REQUIRE(trim(std::string(leading_whitespace)) == no_whitespace);

View File

@@ -83,12 +83,12 @@ namespace {
} // end unnamed namespace
static_assert( std::is_constructible<Catch::Detail::unique_ptr<base>,
Catch::Detail::unique_ptr<derived>>::value, "Upcasting is supported");
static_assert(!std::is_constructible<Catch::Detail::unique_ptr<derived>,
Catch::Detail::unique_ptr<base>>::value, "Downcasting is not supported");
static_assert(!std::is_constructible<Catch::Detail::unique_ptr<base>,
Catch::Detail::unique_ptr<unrelated>>::value, "Cannot just convert one ptr type to another");
static_assert( std::is_constructible_v<Catch::Detail::unique_ptr<base>,
Catch::Detail::unique_ptr<derived>>, "Upcasting is supported");
static_assert(!std::is_constructible_v<Catch::Detail::unique_ptr<derived>,
Catch::Detail::unique_ptr<base>>, "Downcasting is not supported");
static_assert(!std::is_constructible_v<Catch::Detail::unique_ptr<base>,
Catch::Detail::unique_ptr<unrelated>>, "Cannot just convert one ptr type to another");
TEST_CASE("Upcasting special member functions", "[internals][unique-ptr]") {
using Catch::Detail::unique_ptr;

View File

@@ -194,15 +194,15 @@ TEST_CASE("#1403", "[compilation]") {
}
TEST_CASE("Optionally static assertions", "[compilation]") {
STATIC_REQUIRE( std::is_void<void>::value );
STATIC_REQUIRE_FALSE( std::is_void<int>::value );
STATIC_CHECK( std::is_void<void>::value );
STATIC_CHECK_FALSE( std::is_void<int>::value );
STATIC_REQUIRE( std::is_void_v<void> );
STATIC_REQUIRE_FALSE( std::is_void_v<int> );
STATIC_CHECK( std::is_void_v<void> );
STATIC_CHECK_FALSE( std::is_void_v<int> );
}
TEST_CASE("#1548", "[compilation]") {
using namespace bar;
REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value);
REQUIRE(std::is_same_v<TypeList<int>, TypeList<int>>);
}
// #925

View File

@@ -193,13 +193,13 @@ TEST_CASE("Generators -- adapters", "[generators][generic]") {
TEST_CASE("Random generator", "[generators][approvals]") {
SECTION("Infer int from integral arguments") {
auto val = GENERATE(take(4, random(0, 1)));
STATIC_REQUIRE(std::is_same<decltype(val), int>::value);
STATIC_REQUIRE(std::is_same_v<decltype(val), int>);
REQUIRE(0 <= val);
REQUIRE(val <= 1);
}
SECTION("Infer double from double arguments") {
auto val = GENERATE(take(4, random(0., 1.)));
STATIC_REQUIRE(std::is_same<decltype(val), double>::value);
STATIC_REQUIRE(std::is_same_v<decltype(val), double>);
REQUIRE(0. <= val);
REQUIRE(val < 1);
}

View File

@@ -879,10 +879,10 @@ TEST_CASE( "Combining concrete matchers does not use templated matchers",
using Catch::Matchers::StartsWith;
STATIC_REQUIRE(
std::is_same<decltype( StartsWith( "foo" ) ||
std::is_same_v<decltype( StartsWith( "foo" ) ||
( StartsWith( "bar" ) && EndsWith( "bar" ) &&
!EndsWith( "foo" ) ) ),
Catch::Matchers::Detail::MatchAnyOf<std::string>>::value );
Catch::Matchers::Detail::MatchAnyOf<std::string>> );
}
struct MatcherA : Catch::Matchers::MatcherGenericBase {
@@ -910,25 +910,25 @@ struct MatcherD : Catch::Matchers::MatcherGenericBase {
TEST_CASE( "Combining only templated matchers", "[matchers][templated]" ) {
STATIC_REQUIRE(
std::is_same<decltype( MatcherA() || MatcherB() ),
std::is_same_v<decltype( MatcherA() || MatcherB() ),
Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB>>::value );
MatchAnyOfGeneric<MatcherA, MatcherB>> );
REQUIRE_THAT( 1, MatcherA() || MatcherB() );
STATIC_REQUIRE(
std::is_same<decltype( MatcherA() && MatcherB() ),
std::is_same_v<decltype( MatcherA() && MatcherB() ),
Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB>>::value );
MatchAllOfGeneric<MatcherA, MatcherB>> );
REQUIRE_THAT( 1, MatcherA() && MatcherB() );
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( MatcherA() || !MatcherB() ),
Catch::Matchers::Detail::MatchAnyOfGeneric<
MatcherA,
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value );
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>> );
REQUIRE_THAT( 1, MatcherA() || !MatcherB() );
}
@@ -937,30 +937,29 @@ TEST_CASE( "Combining MatchAnyOfGeneric does not nest",
"[matchers][templated]" ) {
// MatchAnyOfGeneric LHS + some matcher RHS
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( ( MatcherA() || MatcherB() ) || MatcherC() ),
Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value );
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>> );
REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() );
// some matcher LHS + MatchAnyOfGeneric RHS
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( MatcherA() || ( MatcherB() || MatcherC() ) ),
Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value );
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>> );
REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) );
// MatchAnyOfGeneric LHS + MatchAnyOfGeneric RHS
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( ( MatcherA() || MatcherB() ) ||
( MatcherC() || MatcherD() ) ),
Catch::Matchers::Detail::
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>::
value );
MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>);
REQUIRE_THAT(
1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) );
@@ -970,30 +969,29 @@ TEST_CASE( "Combining MatchAllOfGeneric does not nest",
"[matchers][templated]" ) {
// MatchAllOfGeneric lhs + some matcher RHS
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( ( MatcherA() && MatcherB() ) && MatcherC() ),
Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value );
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>> );
REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() );
// some matcher LHS + MatchAllOfGeneric RSH
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( MatcherA() && ( MatcherB() && MatcherC() ) ),
Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value );
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>> );
REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) );
// MatchAllOfGeneric LHS + MatchAllOfGeneric RHS
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( ( MatcherA() && MatcherB() ) &&
( MatcherC() && MatcherD() ) ),
Catch::Matchers::Detail::
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>::
value );
MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>);
REQUIRE_THAT(
1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) );
@@ -1002,26 +1000,26 @@ TEST_CASE( "Combining MatchAllOfGeneric does not nest",
TEST_CASE( "Combining MatchNotOfGeneric does not nest",
"[matchers][templated]" ) {
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( !MatcherA() ),
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value );
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>> );
REQUIRE_THAT( 0, !MatcherA() );
STATIC_REQUIRE(
std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value );
std::is_same_v<decltype( !!MatcherA() ), MatcherA const&> );
REQUIRE_THAT( 1, !!MatcherA() );
STATIC_REQUIRE(
std::is_same<
std::is_same_v<
decltype( !!!MatcherA() ),
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value );
Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>> );
REQUIRE_THAT( 0, !!!MatcherA() );
STATIC_REQUIRE(
std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value );
std::is_same_v<decltype( !!!!MatcherA() ), MatcherA const&> );
REQUIRE_THAT( 1, !!!!MatcherA() );
}

View File

@@ -123,7 +123,7 @@ TEST_CASE("Basic use of the Empty range matcher", "[matchers][templated][empty]"
REQUIRE_THAT(non_empty_vec, !IsEmpty());
std::list<std::list<std::list<int>>> inner_lists_are_empty;
inner_lists_are_empty.push_back({});
inner_lists_are_empty.emplace_back();
REQUIRE_THAT(inner_lists_are_empty, !IsEmpty());
REQUIRE_THAT(inner_lists_are_empty.front(), IsEmpty());
}
@@ -592,11 +592,6 @@ TEST_CASE("All/Any/None True matchers support types with ADL begin",
}
}
// Range loop iterating over range with different types for begin and end is a
// C++17 feature, and GCC refuses to compile such code unless the lang mode is
// set to C++17 or later.
#if defined(CATCH_CPP17_OR_GREATER)
TEST_CASE( "The quantifier range matchers support types with different types returned from begin and end",
"[matchers][templated][quantifiers][approvals]" ) {
using Catch::Matchers::AllMatch;
@@ -656,8 +651,6 @@ TEST_CASE( "RangeContains supports ranges with different types returned from "
REQUIRE_THAT( diff_types, Contains( LessThanMatcher( size_t( 4 ) ) ) );
}
#endif
TEST_CASE( "Usage of RangeEquals range matcher", "[matchers][templated][quantifiers]" ) {
using Catch::Matchers::RangeEquals;
@@ -849,8 +842,8 @@ static constexpr bool ContainerIsRandomAccess( const Container& ) {
using array_iter_category = typename std::iterator_traits<
typename Container::iterator>::iterator_category;
return std::is_base_of<std::random_access_iterator_tag,
array_iter_category>::value;
return std::is_base_of_v<std::random_access_iterator_tag,
array_iter_category>;
}
TEST_CASE( "Type conversions of RangeEquals and similar",

View File

@@ -389,13 +389,13 @@ TEMPLATE_PRODUCT_TEST_CASE_SIG("A Template product test case with array signatur
}
TEMPLATE_PRODUCT_TEST_CASE("Product with differing arities", "[template][product]", std::tuple, (int, (int, double), (int, double, float))) {
REQUIRE(std::tuple_size<TestType>::value >= 1);
REQUIRE(std::tuple_size_v<TestType> >= 1);
}
using MyTypes = std::tuple<int, char, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std::tuple", "[template][list]", MyTypes)
{
REQUIRE(std::is_arithmetic<TestType>::value);
REQUIRE(std::is_arithmetic_v<TestType>);
}
struct NonDefaultConstructibleType {
@@ -405,7 +405,7 @@ struct NonDefaultConstructibleType {
using MyNonDefaultConstructibleTypes = std::tuple<NonDefaultConstructibleType, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes)
{
REQUIRE(std::is_trivially_copyable<TestType>::value);
REQUIRE(std::is_trivially_copyable_v<TestType>);
}
struct NonCopyableAndNonMovableType {
@@ -420,7 +420,7 @@ struct NonCopyableAndNonMovableType {
using NonCopyableAndNonMovableTypes = std::tuple<NonCopyableAndNonMovableType, float>;
TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-copyable and non-movable std::tuple", "[template][list]", NonCopyableAndNonMovableTypes)
{
REQUIRE(std::is_default_constructible<TestType>::value);
REQUIRE(std::is_default_constructible_v<TestType>);
}
// https://github.com/philsquared/Catch/issues/166

View File

@@ -8,8 +8,6 @@
#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_BYTE)
TEST_CASE( "std::byte -> toString", "[toString][byte][approvals]" ) {
using type = std::byte;
REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
@@ -19,5 +17,3 @@ TEST_CASE( "std::vector<std::byte> -> toString", "[toString][byte][approvals]" )
using type = std::vector<std::byte>;
REQUIRE( "{ 0, 1, 2 }" == ::Catch::Detail::stringify( type{ std::byte{0}, std::byte{1}, std::byte{2} } ) );
}
#endif // CATCH_INTERNAL_CONFIG_CPP17_BYTE

View File

@@ -106,8 +106,6 @@ TEST_CASE("Static arrays are convertible to string", "[toString]") {
}
}
#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
TEST_CASE("String views are stringified like other strings", "[toString][approvals]") {
std::string_view view{"abc"};
CHECK(Catch::Detail::stringify(view) == R"("abc")");
@@ -116,8 +114,6 @@ TEST_CASE("String views are stringified like other strings", "[toString][approva
CHECK(Catch::Detail::stringify(arr) == R"({ "abc" })");
}
#endif
TEST_CASE("Precision of floating point stringification can be set", "[toString][floatingPoint]") {
SECTION("Floats") {
using sm = Catch::StringMaker<float>;

View File

@@ -9,8 +9,6 @@
#define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_OPTIONAL)
TEST_CASE( "std::optional<int> -> toString", "[toString][optional][approvals]" ) {
using type = std::optional<int>;
REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );
@@ -31,5 +29,3 @@ TEST_CASE( "std::vector<std::optional<int> > -> toString", "[toString][optional]
TEST_CASE( "std::nullopt -> toString", "[toString][optional][approvals]" ) {
REQUIRE( "{ }" == ::Catch::Detail::stringify( std::nullopt ) );
}
#endif // CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL

View File

@@ -21,7 +21,7 @@ TEST_CASE( "std::pair<int,const std::string> -> toString", "[toString][pair]" )
TEST_CASE( "std::vector<std::pair<std::string,int> > -> toString", "[toString][pair]" ) {
std::vector<std::pair<std::string,int> > pr;
pr.push_back( std::make_pair("green", 55 ) );
pr.emplace_back( "green", 55 );
REQUIRE( ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" );
}

View File

@@ -9,8 +9,6 @@
#define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
#include <catch2/catch_test_macros.hpp>
#if defined(CATCH_CONFIG_CPP17_VARIANT)
#include <string>
#include <variant>
@@ -95,5 +93,3 @@ TEST_CASE( "variant<nullptr,int,const char *>", "[toString][variant][approvals]"
CHECK( "42" == ::Catch::Detail::stringify(type{42}) );
CHECK( "\"Catch me\"" == ::Catch::Detail::stringify(type{"Catch me"}) );
}
#endif // CATCH_INTERNAL_CONFIG_CPP17_VARIANT

View File

@@ -20,7 +20,7 @@ struct ZeroLiteralAsPointer {
constexpr ZeroLiteralAsPointer( ZeroLiteralAsPointer* ) noexcept {}
template <typename T,
typename = std::enable_if_t<!std::is_same<T, int>::value>>
typename = std::enable_if_t<!std::is_same_v<T, int>>>
constexpr ZeroLiteralAsPointer( T ) = delete;
};

15
third_party/clara.hpp vendored
View File

@@ -18,14 +18,7 @@
#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
#endif
#ifndef CLARA_CONFIG_OPTIONAL_TYPE
#ifdef __has_include
#if __has_include(<optional>) && __cplusplus >= 201703L
#include <optional>
#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
#endif
#endif
#endif
// ----------- #included from clara_textflow.hpp -----------
@@ -676,16 +669,14 @@ namespace detail {
return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
return ParserResult::ok( ParseResultType::Matched );
}
#ifdef CLARA_CONFIG_OPTIONAL_TYPE
template<typename T>
inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
inline auto convertInto( std::string const &source, std::optional<T>& target ) -> ParserResult {
T temp;
auto result = convertInto( source, temp );
if( result )
target = std::move(temp);
return result;
}
#endif // CLARA_CONFIG_OPTIONAL_TYPE
struct NonCopyable {
NonCopyable() = default;
@@ -749,7 +740,7 @@ namespace detail {
template<typename ReturnType>
struct LambdaInvoker {
static_assert( std::is_same<ReturnType, ParserResult>::value, "Lambda must return void or clara::ParserResult" );
static_assert( std::is_same_v<ReturnType, ParserResult>, "Lambda must return void or clara::ParserResult" );
template<typename L, typename ArgType>
static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
@@ -793,7 +784,7 @@ namespace detail {
L m_lambda;
static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
static_assert( std::is_same<typename UnaryLambdaTraits<L>::ArgType, bool>::value, "flags must be boolean" );
static_assert( std::is_same_v<typename UnaryLambdaTraits<L>::ArgType, bool>, "flags must be boolean" );
explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {}