diff --git a/packages/Catch2/.github/workflows/linux-other-builds.yml b/packages/Catch2/.github/workflows/linux-other-builds.yml new file mode 100644 index 0000000000000000000000000000000000000000..61ebf3d7e2dc542b0e96ecacce6789c3d4a1f6a4 --- /dev/null +++ b/packages/Catch2/.github/workflows/linux-other-builds.yml @@ -0,0 +1,86 @@ +# The builds in this file are more complex (e.g. they need custom CMake +# configuration) and thus are unsuitable to the simple build matrix +# approach used in simple-builds +name: Linux builds (complex) + +on: [push, pull_request] + +jobs: + build: + name: ${{matrix.build_description}}, ${{matrix.cxx}}, C++${{matrix.std}} ${{matrix.build_type}} + runs-on: ubuntu-20.04 + strategy: + matrix: + # We add builds one by one in this case, because there are no + # dimensions that are shared across the builds + include: + + # Single surrogate header build + - cxx: clang++-10 + build_description: Surrogates build + build_type: Debug + std: 14 + other_pkgs: clang-10 + cmake_configurations: -DCATCH_BUILD_SURROGATES=ON + + # Extras and examples with gcc-7 + - cxx: g++-7 + build_description: Extras + Examples + build_type: Debug + std: 14 + other_pkgs: g++-7 + cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON + - cxx: g++-7 + build_description: Extras + Examples + build_type: Release + std: 14 + other_pkgs: g++-7 + cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON + + # Extras and examples with Clang-10 + - cxx: clang++-10 + build_description: Extras + Examples + build_type: Debug + std: 17 + other_pkgs: clang-10 + cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON + - cxx: clang++-10 + build_description: Extras + Examples + build_type: Release + std: 17 + other_pkgs: clang-10 + cmake_configurations: -DCATCH_BUILD_EXTRA_TESTS=ON -DCATCH_BUILD_EXAMPLES=ON + + + steps: + - uses: actions/checkout@v2 + + - name: Prepare environment + run: sudo apt-get install -y ninja-build ${{matrix.other_pkgs}} + + - name: Configure build + working-directory: ${{runner.workspace}} + env: + CXX: ${{matrix.cxx}} + CXXFLAGS: ${{matrix.cxxflags}} + # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}. + # This is important + run: | + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCATCH_DEVELOPMENT_BUILD=ON \ + ${{matrix.cmake_configurations}} \ + -G Ninja + + - name: Build tests + lib + working-directory: ${{runner.workspace}}/build + run: ninja + + - name: Run tests + env: + CTEST_OUTPUT_ON_FAILURE: 1 + working-directory: ${{runner.workspace}}/build + # Hardcode 2 cores we know are there + run: ctest -C ${{matrix.build_type}} -j 2 diff --git a/packages/Catch2/.github/workflows/linux-builds.yml b/packages/Catch2/.github/workflows/linux-simple-builds.yml similarity index 52% rename from packages/Catch2/.github/workflows/linux-builds.yml rename to packages/Catch2/.github/workflows/linux-simple-builds.yml index 93ae21e6f7ca436246f227b17094d6148d058e99..d7d4bb07f37d249ed49c84f808e70147f1b6fb1f 100644 --- a/packages/Catch2/.github/workflows/linux-builds.yml +++ b/packages/Catch2/.github/workflows/linux-simple-builds.yml @@ -1,9 +1,10 @@ -name: Linux builds +name: Linux builds (basic) on: [push, pull_request] jobs: build: + name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}} runs-on: ubuntu-20.04 strategy: matrix: @@ -24,12 +25,44 @@ jobs: # cannot be installed on ubuntu-20.04 be default? # - cxx: g++-6 # other_pkgs: g++-6 + - cxx: g++-7 + other_pkgs: g++-7 + - cxx: g++-8 + other_pkgs: g++-8 + - cxx: g++-9 + other_pkgs: g++-9 + - cxx: g++-10 + other_pkgs: g++-10 - cxx: clang++-6.0 other_pkgs: clang-6.0 - cxx: clang++-7 other_pkgs: clang-7 + - cxx: clang++-8 + other_pkgs: clang-8 + - cxx: clang++-9 + other_pkgs: clang-9 - cxx: clang++-10 other_pkgs: clang-10 + # Clang 6 + C++17 + # does not work with the default libstdc++ version thanks + # to a disagreement on variant implementation. + # - cxx: clang++-6.0 + # build_type: Debug + # std: 17 + # other_pkgs: clang-6.0 + # - cxx: clang++-6.0 + # build_type: Release + # std: 17 + # other_pkgs: clang-6.0 + # Clang 10 + C++17 + - cxx: clang++-10 + build_type: Debug + std: 17 + other_pkgs: clang-10 + - cxx: clang++-10 + build_type: Release + std: 17 + other_pkgs: clang-10 steps: - uses: actions/checkout@v2 @@ -45,8 +78,11 @@ jobs: # Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}. # This is important run: | - cmake -Bbuild -H$GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ - -DCMAKE_CXX_STANDARD=${{matrix.std}} -DCATCH_DEVELOPMENT_BUILD=ON \ + cmake -Bbuild -H$GITHUB_WORKSPACE \ + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCATCH_DEVELOPMENT_BUILD=ON \ -G Ninja - name: Build tests + lib diff --git a/packages/Catch2/.gitrepo b/packages/Catch2/.gitrepo index ebe025859982135cd6d8d666ef0df64a3d4977fc..3bb3f7649f68e0d2962f3f6b488cdd1cdb401f31 100644 --- a/packages/Catch2/.gitrepo +++ b/packages/Catch2/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = git@github.com:catchorg/Catch2.git branch = devel - commit = 2dbe63a6ba949c3f0a2078770f7d12cfe5adc10c - parent = 2179906885aa483f8d2b2cfa127d187dff80aea2 + commit = fb4153e05e430921574d79d868ebc44dd9528629 + parent = 57867f14916a3779d2de6004b203bd636dcfee88 method = merge cmdver = 0.4.3 diff --git a/packages/Catch2/.travis.yml b/packages/Catch2/.travis.yml deleted file mode 100644 index 811b12bf7fedbf4bc297907872e808b001ab8398..0000000000000000000000000000000000000000 --- a/packages/Catch2/.travis.yml +++ /dev/null @@ -1,161 +0,0 @@ -language: cpp -dist: xenial - - -branches: - except: - - /dev-appveyor.*/ - -common_sources: &all_sources - - ubuntu-toolchain-r-test - - llvm-toolchain-xenial - - llvm-toolchain-xenial-3.8 - - llvm-toolchain-xenial-3.9 - - llvm-toolchain-xenial-4.0 - - llvm-toolchain-xenial-5.0 - - llvm-toolchain-xenial-6.0 - - llvm-toolchain-xenial-7 - - llvm-toolchain-xenial-8 - - -matrix: - include: - # Clang builds - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-3.8'] - env: COMPILER='clang++-3.8' CPP14=1 - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-3.8', 'lcov'] - env: COMPILER='clang++-3.8' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1 - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-3.9'] - env: COMPILER='clang++-3.9' CPP14=1 - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-4.0'] - env: COMPILER='clang++-4.0' CPP14=1 - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-5.0'] - env: COMPILER='clang++-5.0' CPP14=1 - - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-6.0', 'libstdc++-8-dev'] - env: COMPILER='clang++-6.0' CPP17=1 - - - - os: linux - compiler: clang - addons: - apt: - sources: *all_sources - packages: ['clang-8', 'libstdc++-8-dev'] - env: COMPILER='clang++-8' CPP17=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1 - - - # GCC builds - - os: linux - compiler: gcc - addons: - apt: - sources: *all_sources - packages: ['g++-5'] - env: COMPILER='g++-5' CPP14=1 - - - os: linux - compiler: gcc - addons: - apt: - sources: *all_sources - packages: ['g++-6'] - env: COMPILER='g++-6' CPP14=1 - - - os: linux - compiler: gcc - addons: - apt: - sources: *all_sources - packages: ['g++-7', 'lcov'] - env: COMPILER='g++-7' CPP14=1 EXAMPLES=1 COVERAGE=1 EXTRAS=1 - - - # Special builds, e.g. conan - - language: python - python: - - "3.7" - install: - - pip install conan-package-tools - env: - - CONAN_GCC_VERSIONS=8 - - CONAN_DOCKER_IMAGE=conanio/gcc8 - - CPP14=1 - script: - - python .conan/build.py - -before_script: - - export CXX=${COMPILER} - - cd ${TRAVIS_BUILD_DIR} - # We want to regenerate the amalgamated header if the extra tests - # are enabled. - - | - if [[ ${EXTRAS} -eq 1 ]]; then - python3 ./tools/scripts/generateAmalgamatedFiles.py - fi - - - | - if [[ ${CPP17} -eq 1 ]]; then - export CPP_STANDARD=17 - elif [[ ${CPP14} -eq 1 ]]; then - export CPP_STANDARD=14 - else - travis_terminate 4; - fi - - # Use Debug builds for running Valgrind and building examples - - cmake -H. -BBuild-Debug -DCMAKE_BUILD_TYPE=Debug -Wdev -DCATCH_USE_VALGRIND=${VALGRIND} -DCATCH_BUILD_EXAMPLES=${EXAMPLES} -DCATCH_ENABLE_COVERAGE=${COVERAGE} -DCATCH_BUILD_EXTRA_TESTS=${EXTRAS} -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF -DCATCH_DEVELOPMENT_BUILD=ON - # Don't bother with release build for coverage build - - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -Wdev -DCMAKE_CXX_STANDARD=${CPP_STANDARD} -DCMAKE_CXX_STANDARD_REQUIRED=On -DCMAKE_CXX_EXTENSIONS=OFF -DCATCH_DEVELOPMENT_BUILD=ON - - -script: - - cd Build-Debug - - make -j 2 - - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2 - # Coverage collection does not work for OS X atm - - | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ "${COVERAGE}" == "1" ]]; then - make gcov - make lcov - bash <(curl -s https://codecov.io/bash) -X gcov || echo "Codecov did not collect coverage reports" - fi - - # Go to release build - - cd ../Build-Release - - make -j 2 - - CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2 diff --git a/packages/Catch2/CMake/MiscFunctions.cmake b/packages/Catch2/CMake/MiscFunctions.cmake index 1f0ed865040cea32082f2b54ef02096a76eb760a..7548f287f9f14fd5a761da97693d34394d317d25 100644 --- a/packages/Catch2/CMake/MiscFunctions.cmake +++ b/packages/Catch2/CMake/MiscFunctions.cmake @@ -45,7 +45,7 @@ function(add_warnings_to_targets targets) "-Wglobal-constructors" "-Wmissing-noreturn" "-Wparentheses" - "-Wextra-semi-stmt" + "-Wextra-semi" "-Wunreachable-code" "-Wstrict-aliasing" "-Wreturn-std-move" @@ -77,3 +77,13 @@ function(add_warnings_to_targets targets) endif() endif() endfunction() + +# Adds flags required for reproducible build to the target +# Currently only supports GCC and Clang +function(add_build_reproducibility_settings target) +# Make the build reproducible on versions of g++ and clang that supports -ffile-prefix-map + if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 8) OR + ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 10)) + target_compile_options(${target} PRIVATE "-ffile-prefix-map=${CATCH_DIR}=.") + endif() +endfunction() diff --git a/packages/Catch2/CMake/catch2.pc.in b/packages/Catch2/CMake/catch2.pc.in index c37eb8ad345af246b83e40dea53e44a3c946bec2..bd1c95a1afd3238a5a856a30b50098f98c6af3e4 100644 --- a/packages/Catch2/CMake/catch2.pc.in +++ b/packages/Catch2/CMake/catch2.pc.in @@ -1,3 +1,5 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@ diff --git a/packages/Catch2/CMakeLists.txt b/packages/Catch2/CMakeLists.txt index 90d5806baeabe49d074d742d75aeb8ee1e15ddae..f1be3f59435e965a6f2007f8a9cb35dad3639f85 100644 --- a/packages/Catch2/CMakeLists.txt +++ b/packages/Catch2/CMakeLists.txt @@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.5) # disable testsuite in that case if(NOT DEFINED PROJECT_NAME) set(NOT_SUBPROJECT ON) +else() + set(NOT_SUBPROJECT OFF) endif() option(CATCH_INSTALL_DOCS "Install documentation alongside library" ON) @@ -17,6 +19,8 @@ cmake_dependent_option(CATCH_BUILD_EXTRA_TESTS "Build extra tests" OFF "CATCH_DE cmake_dependent_option(CATCH_BUILD_FUZZERS "Build fuzzers" OFF "CATCH_DEVELOPMENT_BUILD" OFF) cmake_dependent_option(CATCH_ENABLE_COVERAGE "Generate coverage for codecov.io" OFF "CATCH_DEVELOPMENT_BUILD" OFF) cmake_dependent_option(CATCH_ENABLE_WERROR "Enables Werror during build" ON "CATCH_DEVELOPMENT_BUILD" OFF) +cmake_dependent_option(CATCH_BUILD_SURROGATES "Enable generating and building surrogate TUs for the main headers" OFF "CATCH_DEVELOPMENT_BUILD" OFF) + # Catch2's build breaks if done in-tree. You probably should not build # things in tree anyway, but we can allow projects that include Catch2 @@ -37,7 +41,9 @@ project(Catch2 LANGUAGES CXX VERSION 3.0.0) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") include(GNUInstallDirs) include(CMakePackageConfigHelpers) -include(CTest) +if(CATCH_DEVELOPMENT_BUILD) + include(CTest) +endif() # This variable is used in some subdirectories, so we need it here, rather # than later in the install block diff --git a/packages/Catch2/README.md b/packages/Catch2/README.md index d8e08bb717cc4f80dbc37eabca3be574e5ee533b..31be055dbc6da5655c73eda39654f7918f1a9ccb 100644 --- a/packages/Catch2/README.md +++ b/packages/Catch2/README.md @@ -2,7 +2,9 @@  [](https://github.com/catchorg/catch2/releases) -[](https://travis-ci.org/catchorg/Catch2) +[](https://github.com/catchorg/Catch2/actions/workflows/linux-simple-builds.yml) +[](https://github.com/catchorg/Catch2/actions/workflows/linux-other-builds.yml) +[](https://github.com/catchorg/Catch2/actions/workflows/mac-builds.yml) [](https://ci.appveyor.com/project/catchorg/catch2) [](https://codecov.io/gh/catchorg/Catch2) [](https://godbolt.org/z/9x9qoM) diff --git a/packages/Catch2/appveyor.yml b/packages/Catch2/appveyor.yml index 86a1df1885e213cd678348b0c65e0d95ee616910..d84d775c934258326aa2c2d74fcb569cd8b1d07d 100644 --- a/packages/Catch2/appveyor.yml +++ b/packages/Catch2/appveyor.yml @@ -51,8 +51,9 @@ test_script: # build explicitly. environment: matrix: - - FLAVOR: VS 2019 x64 Debug + - FLAVOR: VS 2019 x64 Debug Surrogates APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + surrogates: 1 platform: x64 configuration: Debug diff --git a/packages/Catch2/docs/Readme.md b/packages/Catch2/docs/Readme.md index 821e6fca0d7625a4637c60f47a8b586ef2fc7497..262edb5cf48eae5e06c9e69d35932ec8a404c2cc 100644 --- a/packages/Catch2/docs/Readme.md +++ b/packages/Catch2/docs/Readme.md @@ -29,14 +29,13 @@ Odds and ends: * [CI and other miscellaneous pieces](ci-and-misc.md#top) FAQ: -* [Why are my tests slow to compile?](slow-compiles.md#top) * [Known limitations](limitations.md#top) Other: -* [Why Catch?](why-catch.md#top) +* [Why Catch2?](why-catch.md#top) * [Migrating from v2 to v3](migrate-v2-to-v3.md#top) -* [Open Source Projects using Catch](opensource-users.md#top) -* [Commercial Projects using Catch](commercial-users.md#top) +* [Open Source Projects using Catch2](opensource-users.md#top) +* [Commercial Projects using Catch2](commercial-users.md#top) * [Contributing](contributing.md#top) * [Release Notes](release-notes.md#top) * [Deprecations and incoming changes](deprecations.md#top) diff --git a/packages/Catch2/docs/benchmarks.md b/packages/Catch2/docs/benchmarks.md index ccc4175b6c346e2136fa379eae649c876c3da2d9..101539ddc5c82fcbec30ebe1ab7f91b3b6913f91 100644 --- a/packages/Catch2/docs/benchmarks.md +++ b/packages/Catch2/docs/benchmarks.md @@ -1,7 +1,7 @@ <a id="top"></a> # Authoring benchmarks -> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. Writing benchmarks is not easy. Catch simplifies certain aspects but you'll always need to take care about various aspects. Understanding a few things about diff --git a/packages/Catch2/docs/ci-and-misc.md b/packages/Catch2/docs/ci-and-misc.md index 40b7cec9270010cd631bc19b130a852544222a9d..0d016618cf8bf978c7e85c07c2f0d727833517f1 100644 --- a/packages/Catch2/docs/ci-and-misc.md +++ b/packages/Catch2/docs/ci-and-misc.md @@ -95,7 +95,7 @@ can use `pkg-config` to get its include path: `pkg-config --cflags catch2`. ### gdb and lldb scripts -Catch2's `contrib` folder also contains two simple debugger scripts, +Catch2's `extras` folder also contains two simple debugger scripts, `gdbinit` for `gdb` and `lldbinit` for `lldb`. If loaded into their respective debugger, these will tell it to step over Catch2's internals when stepping through code. diff --git a/packages/Catch2/docs/cmake-integration.md b/packages/Catch2/docs/cmake-integration.md index 59e06842c93a10887e6a629c18b79386952a138d..d8d08495e1bf27c69b2cc09a1e46fd69540f6c72 100644 --- a/packages/Catch2/docs/cmake-integration.md +++ b/packages/Catch2/docs/cmake-integration.md @@ -2,7 +2,7 @@ # CMake integration **Contents**<br> -[CMake target](#cmake-target)<br> +[CMake targets](#cmake-targets)<br> [Automatic test registration](#automatic-test-registration)<br> [CMake project options](#cmake-project-options)<br> [Installing Catch2 from git repository](#installing-catch2-from-git-repository)<br> @@ -15,28 +15,33 @@ integration points for our users. 2) Catch2's repository contains CMake scripts for automatic registration of `TEST_CASE`s in CTest -## CMake target +## CMake targets -Catch2's CMake build exports an interface target `Catch2::Catch2`. Linking -against it will add the proper include path and all necessary capabilities -to the resulting binary. +Catch2's CMake build exports two targets, `Catch2::Catch2`, and +`Catch2::Catch2WithMain`. If you do not need custom `main` function, +you should be using the latter (and only the latter). Linking against +it will add the proper include paths and link your target together with +2 static libraries that implement Catch2 and its main respectively. +If you need custom `main`, you should link only against `Catch2::Catch2`. -This means that if Catch2 has been installed on the system, it should be -enough to do: +This means that if Catch2 has been installed on the system, it should +be enough to do ```cmake -find_package(Catch2 REQUIRED) +find_package(Catch2 3 REQUIRED) +# These tests can use the Catch2-provided main add_executable(tests test.cpp) -target_link_libraries(tests PRIVATE Catch2::Catch2) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) + +# These tests need their own main +add_executable(custom-main-tests test.cpp test-main.cpp) +target_link_libraries(custom-main-tests PRIVATE Catch2::Catch2) ``` +These targets are also provided when Catch2 is used as a subdirectory. +Assuming Catch2 has been cloned to `lib/Catch2`, you only need to replace +the `find_package` call with `add_subdirectory(lib/Catch2)` and the snippet +above still works. -This target is also provided when Catch2 is used as a subdirectory. -Assuming that Catch2 has been cloned to `lib/Catch2`: -```cmake -add_subdirectory(lib/Catch2) -add_executable(tests test.cpp) -target_link_libraries(tests PRIVATE Catch2::Catch2) -``` Another possibility is to use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html): ```cmake @@ -45,14 +50,16 @@ Include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.1) + GIT_TAG v3.0.0-preview3 +) FetchContent_MakeAvailable(Catch2) add_executable(tests test.cpp) -target_link_libraries(tests PRIVATE Catch2::Catch2) +target_link_libraries(tests PRIVATE Catch2::Catch2WithMain) ``` + ## Automatic test registration Catch2's repository also contains two CMake scripts that help users @@ -60,7 +67,7 @@ with automatically registering their `TEST_CASE`s with CTest. They can be found in the `extras` folder, and are 1) `Catch.cmake` (and its dependency `CatchAddTests.cmake`) -2) `ParseAndAddCatchTests.cmake` +2) `ParseAndAddCatchTests.cmake` (deprecated) If Catch2 has been installed in system, both of these can be used after doing `find_package(Catch2 REQUIRED)`. Otherwise you need to add them @@ -88,6 +95,18 @@ include(Catch) catch_discover_tests(foo) ``` +When using `FetchContent`, `include(Catch)` will fail unless +`CMAKE_MODULE_PATH` is explicitly updated to include the extras +directory. + +```cmake +# ... FetchContent ... +# +list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) +include(CTest) +include(Catch) +catch_discover_tests() +``` #### Customization `catch_discover_tests` can be given several extra argumets: @@ -179,10 +198,17 @@ the output file name e.g. ".xml". ### `ParseAndAddCatchTests.cmake` +⚠ This script is [deprecated](https://github.com/catchorg/Catch2/pull/2120) +in Catch2 2.13.4 and superseded by the above approach using `catch_discover_tests`. +See [#2092](https://github.com/catchorg/Catch2/issues/2092) for details. + `ParseAndAddCatchTests` works by parsing all implementation files associated with the provided target, and registering them via CTest's `add_test`. This approach has some limitations, such as the fact that -commented-out tests will be registered anyway. +commented-out tests will be registered anyway. More serious, only a +subset of the assertion macros currently available in Catch can be +detected by this script and tests with any macros that cannot be +parsed are *silently ignored*. #### Usage @@ -233,7 +259,21 @@ ParseAndAddCatchTests(bar) ## CMake project options Catch2's CMake project also provides some options for other projects -that consume it. These are +that consume it. These are: + +* `BUILD_TESTING` -- When `ON` and the project is not used as a subproject, +Catch2's test binary will be built. Defaults to `ON`. +* `CATCH_INSTALL_DOCS` -- When `ON`, Catch2's documentation will be +included in the installation. Defaults to `ON`. +* `CATCH_INSTALL_HELPERS` -- When `ON`, Catch2's extras folder will be +included in the installation. Defaults to `ON`. +* `CATCH_DEVELOPMENT_BUILD` -- When `ON`, configures the build for development +of Catch2. This means enabling test projects, warnings and so on. +Defaults to `OFF`. + + +Enabling `CATCH_DEVELOPMENT_BUILD` also enables further configuration +customization options: * `CATCH_BUILD_TESTING` -- When `ON`, Catch2's SelfTest project will be built. Defaults to `ON`. Note that Catch2 also obeys `BUILD_TESTING` CMake @@ -241,12 +281,15 @@ variable, so _both_ of them need to be `ON` for the SelfTest to be built, and either of them can be set to `OFF` to disable building SelfTest. * `CATCH_BUILD_EXAMPLES` -- When `ON`, Catch2's usage examples will be built. Defaults to `OFF`. -* `CATCH_INSTALL_DOCS` -- When `ON`, Catch2's documentation will be -included in the installation. Defaults to `ON`. -* `CATCH_INSTALL_HELPERS` -- When `ON`, Catch2's contrib folder will be -included in the installation. Defaults to `ON`. -* `BUILD_TESTING` -- When `ON` and the project is not used as a subproject, -Catch2's test binary will be built. Defaults to `ON`. +* `CATCH_BUILD_EXTRA_TESTS` -- When `ON`, Catch2's extra tests will be +built. Defaults to `OFF`. +* `CATCH_BUILD_FUZZERS` -- When `ON`, Catch2 fuzzing entry points will +be built. Defaults to `OFF`. +* `CATCH_ENABLE_WERROR` -- When `ON`, adds `-Werror` or equivalent flag +to the compilation. Defaults to `ON`. +* `CATCH_BUILD_SURROGATES` -- When `ON`, each header in Catch2 will be +compiled separately to ensure that they are self-sufficient. +Defaults to `OFF`. ## Installing Catch2 from git repository diff --git a/packages/Catch2/docs/command-line.md b/packages/Catch2/docs/command-line.md index a14acf7f2f35866be154790b904b9678dc34dd1c..14511db98105b9bda5c89ba74fec365c5a5f8fa6 100644 --- a/packages/Catch2/docs/command-line.md +++ b/packages/Catch2/docs/command-line.md @@ -93,7 +93,8 @@ Inclusions and exclusions are evaluated in left-to-right order. Test case examples: -<pre>thisTestOnly Matches the test case called, 'thisTestOnly' +``` +thisTestOnly Matches the test case called, 'thisTestOnly' "this test only" Matches the test case called, 'this test only' these* Matches all cases starting with 'these' exclude:notThis Matches all tests except, 'notThis' @@ -101,8 +102,9 @@ exclude:notThis Matches all tests except, 'notThis' ~*private* Matches all tests except those that contain 'private' a* ~ab* abc Matches all tests that start with 'a', except those that start with 'ab', except 'abc', which is included +~[tag1] Matches all tests except those tagged with '[tag1]' -# [#somefile] Matches all tests from the file 'somefile.cpp' -</pre> +``` Names within square brackets are interpreted as tags. A series of tags form an AND expression whereas a comma-separated sequence forms an OR expression. e.g.: @@ -224,7 +226,7 @@ When set to ```yes``` Catch will report the duration of each test case, in milli <pre>-D, --min-duration <value></pre> -> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch 2.13.0 +> `--min-duration` was [introduced](https://github.com/catchorg/Catch2/pull/1910) in Catch2 2.13.0 When set, Catch will report the duration of each test case that took more than <value> seconds, in milliseconds. This option is overriden by both @@ -300,7 +302,7 @@ either before running any tests, after running all tests - or both, depending on ## Specify the number of benchmark samples to collect <pre>--benchmark-samples <# of samples></pre> -> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. When running benchmarks a number of "samples" is collected. This is the base data for later statistical analysis. Per sample a clock resolution dependent number of iterations of the user code is run, which is independent of the number of samples. Defaults to 100. @@ -309,7 +311,7 @@ Per sample a clock resolution dependent number of iterations of the user code is ## Specify the number of resamples for bootstrapping <pre>--benchmark-resamples <# of resamples></pre> -> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. After the measurements are performed, statistical [bootstrapping] is performed on the samples. The number of resamples for that bootstrapping is configurable @@ -324,7 +326,7 @@ defaults to 95%). ## Specify the confidence-interval for bootstrapping <pre>--benchmark-confidence-interval <confidence-interval></pre> -> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. The confidence-interval is used for statistical bootstrapping on the samples to calculate the upper and lower bounds of mean and standard deviation. @@ -334,7 +336,7 @@ Must be between 0 and 1 and defaults to 0.95. ## Disable statistical analysis of collected benchmark samples <pre>--benchmark-no-analysis</pre> -> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1616) in Catch2 2.9.0. When this flag is specified no bootstrapping or any other statistical analysis is performed. Instead the user code is only measured and the plain mean from the samples is reported. @@ -343,7 +345,7 @@ Instead the user code is only measured and the plain mean from the samples is re ## Specify the amount of time in milliseconds spent on warming up each test <pre>--benchmark-warmup-time</pre> -> [Introduced](https://github.com/catchorg/Catch2/pull/1844) in Catch 2.11.2. +> [Introduced](https://github.com/catchorg/Catch2/pull/1844) in Catch2 2.11.2. Configure the amount of time spent warming up each test. diff --git a/packages/Catch2/docs/commercial-users.md b/packages/Catch2/docs/commercial-users.md index 7d2e87d387b52ed7c96aab1d5d30f60d07437dfd..ca77b67dbabbf739a5b9c2eff7d01346f521a5a4 100644 --- a/packages/Catch2/docs/commercial-users.md +++ b/packages/Catch2/docs/commercial-users.md @@ -1,22 +1,22 @@ <a id="top"></a> -# Commercial users of Catch +# Commercial users of Catch2 -As well as [Open Source](opensource-users.md#top) users Catch is widely used within proprietary code bases too. -Many organisations like to keep this information internal, and that's fine, -but if you're more open it would be great if we could list the names of as -many organisations as possible that use Catch somewhere in their codebase. -Enterprise environments often tend to be far more conservative in their tool adoption - -and being aware that other companies are using Catch can ease the path in. +Catch2 is also widely used in proprietary code bases. This page contains +some of them that are willing to share this information. -So if you are aware of Catch usage in your organisation, and are fairly confident there is no issue with sharing this -fact then please let us know - either directly, via a PR or -[issue](https://github.com/philsquared/Catch/issues), or on the [forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum). +If you want to add your organisation, please check that there is no issue +with you sharing this fact. - Bloomberg - [Bloomlife](https://bloomlife.com) - - NASA - [Inscopix Inc.](https://www.inscopix.com/) + - Locksley.CZ - [Makimo](https://makimo.pl/) + - NASA - [UX3D](https://ux3d.io) - [King](https://king.com) + +--- + +[Home](Readme.md#top) diff --git a/packages/Catch2/docs/configuration.md b/packages/Catch2/docs/configuration.md index e80f695e78f22b847a436b6bf033828c1df9be9c..51f71bc763cc41ed43ab9c1bec32f8bc5334d3dc 100644 --- a/packages/Catch2/docs/configuration.md +++ b/packages/Catch2/docs/configuration.md @@ -117,7 +117,7 @@ Catch's selection, by defining either `CATCH_CONFIG_CPP11_TO_STRING` or 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 Catch 2.4.1. +> `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 @@ -141,7 +141,7 @@ by using `_NO_` in the macro, e.g. `CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS`. CATCH_CONFIG_ANDROID_LOGWRITE // Use android's logging system for debug output CATCH_CONFIG_GLOBAL_NEXTAFTER // Use nextafter{,f,l} instead of std::nextafter -> [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch 2.10.0 +> [`CATCH_CONFIG_ANDROID_LOGWRITE`](https://github.com/catchorg/Catch2/issues/1743) and [`CATCH_CONFIG_GLOBAL_NEXTAFTER`](https://github.com/catchorg/Catch2/pull/1739) were introduced in Catch2 2.10.0 Currently Catch enables `CATCH_CONFIG_WINDOWS_SEH` only when compiled with MSVC, because some versions of MinGW do not have the necessary Win32 API support. @@ -197,13 +197,13 @@ By default, Catch does not stringify some types from the standard library. This CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER // Provide StringMaker specialization for std::optional (on C++17) 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 Catch 2.4.1. +> `CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1380) in Catch2 2.4.1. -> `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1510) in Catch 2.6.0. +> `CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER` was [introduced](https://github.com/catchorg/Catch2/issues/1510) in Catch2 2.6.0. ## Disabling exceptions -> Introduced in Catch 2.4.0. +> Introduced in Catch2 2.4.0. By default, Catch2 uses exceptions to signal errors and to abort tests when an assertion from the `REQUIRE` family of assertions fails. We also @@ -239,7 +239,7 @@ namespace Catch { ## Overriding Catch's debug break (`-b`) -> [Introduced](https://github.com/catchorg/Catch2/pull/1846) in Catch 2.11.2. +> [Introduced](https://github.com/catchorg/Catch2/pull/1846) in Catch2 2.11.2. You can override Catch2's break-into-debugger code by defining the `CATCH_BREAK_INTO_DEBUGGER()` macro. This can be used if e.g. Catch2 does diff --git a/packages/Catch2/docs/contributing.md b/packages/Catch2/docs/contributing.md index ddf8dea26d4368a3d2833a7535c55f5ff081ab0f..fd45cc44478afe385877b6240bca3d9476d1d87a 100644 --- a/packages/Catch2/docs/contributing.md +++ b/packages/Catch2/docs/contributing.md @@ -26,7 +26,7 @@ Ongoing development happens in the `devel` branch for Catch2 v3, and in Commits should be small and atomic. A commit is atomic when, after it is applied, the codebase, tests and all, still works as expected. Small -commits are also prefered, as they make later operations with git history, +commits are also preferred, as they make later operations with git history, whether it is bisecting, reverting, or something else, easier. _When submitting a pull request please do not include changes to the @@ -147,9 +147,9 @@ be replaced with the actual version upon release. There are 2 styles of placeholders used through the documentation, you should pick one that fits your text better (if in doubt, take a look at the existing version tags for other features). - * `> [Introduced](link-to-issue-or-PR) in Catch X.Y.Z` - this + * `> [Introduced](link-to-issue-or-PR) in Catch2 X.Y.Z` - this placeholder is usually used after a section heading - * `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch X.Y.Z` + * `> X (Y and Z) was [introduced](link-to-issue-or-PR) in Catch2 X.Y.Z` - this placeholder is used when you need to tag a subpart of something, e.g. a list @@ -190,6 +190,24 @@ If want to contribute code, this section contains some simple rules and tips on things like code formatting, code constructions to avoid, and so on. +### C++ standard version + +Catch2 currently targets C++14 as the minimum supported C++ version. +Features from higher language versions should be used only sparingly, +when the benefits from using them outweight 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 +the C++17 would provide significant compilation speedups, the maintenance +cost would be too high. + ### Formatting @@ -210,7 +228,7 @@ are problematic and are not always caught by our CI infrastructure. #### Naked exceptions and exceptions-related function If you are throwing an exception, it should be done via `CATCH_ERROR` -or `CATCH_RUNTIME_ERROR` in `catch_enforce.h`. These macros will handle +or `CATCH_RUNTIME_ERROR` in `internal/catch_enforce.hpp`. These macros will handle the differences between compilation with or without exceptions for you. However, some platforms (IAR) also have problems with exceptions-related functions, such as `std::current_exceptions`. We do not have IAR in our @@ -219,6 +237,18 @@ However, if you do, they should be kept behind a `CATCH_CONFIG_DISABLE_EXCEPTIONS` macro. +#### Avoid `std::move` and `std::forward` + +`std::move` and `std::forward` provide nice semantic name for a specific +`static_cast`. However, being function templates they have surprisingly +high cost during compilation, and can also have a negative performance +impact for low-optimization builds. + +You should be using `CATCH_MOVE` and `CATCH_FORWARD` macros from +`internal/catch_move_and_forward.hpp` instead. They expand into the proper +`static_cast`, and avoid the overhead of `std::move` and `std::forward`. + + #### Unqualified usage of functions from C's stdlib If you are using a function from C's stdlib, please include the header @@ -227,6 +257,23 @@ there is no difference is wrong, QNX and VxWorks won't compile if you include the header as `<cfoo>` and call the function unqualified. +#### User-Defined Literals (UDL) for Catch2' types + +Due to messy standardese and ... not great ... implementation of +`-Wreserved-identifier` in Clang, avoid declaring UDLs as +```cpp +Approx operator "" _a(long double); +``` +and instead declare them as +```cpp +Approx operator ""_a(long double); +``` + +Notice that the second version does not have a space between the `""` and +the literal suffix. + + + ### New source file template If you are adding new source file, there is a template you should use. diff --git a/packages/Catch2/docs/deprecations.md b/packages/Catch2/docs/deprecations.md index c0e51b46dca59c7d7359e6b482ba2d852617f6a3..e56b197a298f07d11a4eb8e2d201e057130c47b1 100644 --- a/packages/Catch2/docs/deprecations.md +++ b/packages/Catch2/docs/deprecations.md @@ -9,16 +9,15 @@ either of these is a breaking change, and thus will not happen until at least the next major release. +### `ParseAndAddCatchTests.cmake` -## Planned changes - -### `CHECKED_IF` and `CHECKED_ELSE` +The CMake/CTest integration using `ParseAndAddCatchTests.cmake` is deprecated, +as it can be replaced by `Catch.cmake` that provides the function +`catch_discover_tests` to get tests directly from a CMake target via the +command line interface instead of parsing C++ code with regular expressions. -To make the `CHECKED_IF` and `CHECKED_ELSE` macros more useful, they will -be marked as "OK to fail" (`Catch::ResultDisposition::SuppressFail` flag -will be added), which means that their failure will not fail the test, -making the `else` actually useful. +## Planned changes ### Console Colour API diff --git a/packages/Catch2/docs/generators.md b/packages/Catch2/docs/generators.md index d48cf06b4fd6785e589f3ed53513ee47542c74a1..b8164f829fcb1b6b5930b5697fc215a89f26e56a 100644 --- a/packages/Catch2/docs/generators.md +++ b/packages/Catch2/docs/generators.md @@ -1,7 +1,7 @@ <a id="top"></a> # Data Generators -> Introduced in Catch 2.6.0. +> Introduced in Catch2 2.6.0. Data generators (also known as _data driven/parametrized test cases_) let you reuse the same set of assertions across different input values. @@ -92,7 +92,7 @@ TEST_CASE("Complex mix of sections and generates") { } ``` -> The ability to place `GENERATE` between two `SECTION`s was [introduced](https://github.com/catchorg/Catch2/issues/1938) in Catch 2.13.0. +> The ability to place `GENERATE` between two `SECTION`s was [introduced](https://github.com/catchorg/Catch2/issues/1938) in Catch2 2.13.0. ## Provided generators @@ -117,9 +117,9 @@ a test case, * `RangeGenerator<T>` -- generates all values inside an arithmetic range * `IteratorGenerator<T>` -- copies and returns values from an iterator range -> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch 2.7.0. +> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch2 2.7.0. -> `IteratorGenerator<T>` was introduced in Catch 2.10.0. +> `IteratorGenerator<T>` was introduced in Catch2 2.10.0. The generators also have associated helper functions that infer their type, making their usage much nicer. These are @@ -139,11 +139,11 @@ type, making their usage much nicer. These are * `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator<T>` * `from_range(Container const&)` for `IteratorGenerator<T>` -> `chunk()`, `random()` and both `range()` functions were introduced in Catch 2.7.0. +> `chunk()`, `random()` and both `range()` functions were introduced in Catch2 2.7.0. -> `from_range` has been introduced in Catch 2.10.0 +> `from_range` has been introduced in Catch2 2.10.0 -> `range()` for floating point numbers has been introduced in Catch 2.11.0 +> `range()` for floating point numbers has been introduced in Catch2 2.11.0 And can be used as shown in the example below to create a generator that returns 100 odd random number: @@ -176,7 +176,7 @@ scope and thus capturing references is dangerous. If you need to use variables inside the generator expression, make sure you thought through the lifetime implications and use `GENERATE_COPY` or `GENERATE_REF`.** -> `GENERATE_COPY` and `GENERATE_REF` were introduced in Catch 2.7.1. +> `GENERATE_COPY` and `GENERATE_REF` were introduced in Catch2 2.7.1. You can also override the inferred type by using `as<type>` as the first argument to the macro. This can be useful when dealing with string literals, diff --git a/packages/Catch2/docs/logging.md b/packages/Catch2/docs/logging.md index 476b1e08484c7ddbb438413867cc5cde8d29f4c0..dbd4f912ad553e71d1cb9e17f3a0cacd9c9d655b 100644 --- a/packages/Catch2/docs/logging.md +++ b/packages/Catch2/docs/logging.md @@ -30,7 +30,7 @@ When the last `CHECK` fails in the "Bar" test case, then only one message will b ## Logging without local scope -> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch2 2.7.0. `UNSCOPED_INFO` is similar to `INFO` with two key differences: @@ -106,7 +106,7 @@ This semicolon will be removed with next major version. It is highly advised to **UNSCOPED_INFO(** _message expression_ **)** -> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch 2.7.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1522) in Catch2 2.7.0. Similar to `INFO`, but messages are not limited to their own scope: They are removed from the buffer after each assertion, section or test case, whichever comes first. diff --git a/packages/Catch2/docs/matchers.md b/packages/Catch2/docs/matchers.md index a5bf13f2cce72f5301625916576e768775276fd1..6fdb15bfa0c64c840fa640f95c915a8df7688b2b 100644 --- a/packages/Catch2/docs/matchers.md +++ b/packages/Catch2/docs/matchers.md @@ -58,7 +58,7 @@ to a use-after-free (UAF): ```cpp #include <catch2/catch_test_macros.hpp> -#include <catch2/matchers/catch_matchers_string.h> +#include <catch2/matchers/catch_matchers_string.hpp> TEST_CASE("Bugs, bugs, bugs", "[Bug]"){ std::string str = "Bugs as a service"; @@ -99,9 +99,9 @@ somewhere inside it. The `Equals` matcher matches a string if (and only if) the argument string is equal to `str`. -Finally, the `Matches` matcher performs an ECMASCript regex match using +Finally, the `Matches` matcher performs an ECMAScript regex match using `str` against the argument string. It is important to know that -the match is performed agains the string as a whole, meaning that +the match is performed against the string as a whole, meaning that the regex `"abc"` will not match input string `"abcd"`. To match `"abcd"`, you need to use e.g. `"abc.*"` as your regex. @@ -125,7 +125,7 @@ These are * `Equals` which checks whether the result is exactly equal (order matters) to a specific vector * `UnorderedEquals` which checks whether the result is equal to a specific vector under a permutation * `Approx` which checks whether the result is "approx-equal" (order matters, but comparison is done via `Approx`) to a specific vector -> Approx matcher was [introduced](https://github.com/catchorg/Catch2/issues/1499) in Catch 2.7.2. +> Approx matcher was [introduced](https://github.com/catchorg/Catch2/issues/1499) in Catch2 2.7.2. An example usage: ```cpp @@ -145,10 +145,10 @@ Catch2 provides 3 matchers that target floating point numbers. These are: * `WithinAbs(double target, double margin)`, -* `WithinUlps(FloatingPoint target, uint64_t maxUlpDiff)`, and +* `WithinULP(FloatingPoint target, uint64_t maxUlpDiff)`, and * `WithinRel(FloatingPoint target, FloatingPoint eps)`. -> `WithinRel` matcher was introduced in Catch 2.10.0 +> `WithinRel` matcher was introduced in Catch2 2.10.0 `WithinAbs` creates a matcher that accepts floating point numbers whose @@ -161,6 +161,11 @@ away from the `target` value. The short version of what this means is that there is no more than `maxUlpDiff - 1` representeable floating point numbers between the argument for matching and the `target` value. +**Important**: The WithinULP matcher requires the platform to use the +[IEEE-754](https://en.wikipedia.org/wiki/IEEE_754) representation for +floating point numbers. + + `WithinRel` creates a matcher that accepts floating point numbers that are _approximately equal_ with the `target` with tolerance of `eps.` Specifically, it matches if @@ -243,7 +248,7 @@ Note that `DerivedException` in the example above has to derive from ### Generic range Matchers -> Generic range matchers were introduced in Catch X.Y.Z +> Generic range matchers were introduced in Catch2 X.Y.Z Catch2 also provides some matchers that use the new style matchers definitions to handle generic range-like types. These are: @@ -294,7 +299,7 @@ within certain range. We will call it `IsBetweenMatcher<T>`: ```c++ #include <catch2/catch_test_macros.hpp> -#include <catch2/matchers/catch_matchers.h> +#include <catch2/matchers/catch_matchers.hpp> // ... @@ -345,7 +350,7 @@ style matchers arbitrarily. ## Writing custom matchers (new style) -> New style matchers were introduced in Catch X.Y.Z +> New style matchers were introduced in Catch2 X.Y.Z To create a new-style matcher, you have to create your own type that derives from `Catch::Matchers::MatcherGenericBase`. Your type has to diff --git a/packages/Catch2/docs/migrate-v2-to-v3.md b/packages/Catch2/docs/migrate-v2-to-v3.md index b9590b1f1700c9ea803843bc6090190ee971745f..41c4d470e546d86ae3ef7af1a6c7f60e8e71d999 100644 --- a/packages/Catch2/docs/migrate-v2-to-v3.md +++ b/packages/Catch2/docs/migrate-v2-to-v3.md @@ -1,7 +1,34 @@ <a id="top"></a> # Migrating from v2 to v3 -If you want to migrate to v3, there are two basic approaches to do so. +v3 is the next major version of Catch2 and brings three significant changes: + * Catch2 is now split into multiple headers + * Catch2 is now compiled as a static library + * C++14 is the minimum required C++ version + +There are many reasons why we decided to go from the old single-header +distribution model to a more standard library distribution model. The +big one is compile-time performance, but moving over to a split header +distribution model also improves the future maintainability and +extendability of the codebase. For example v3 adds a new kind of matchers +without impacting the compilation times of users that do not use matchers +in their tests. The new model is also more friendly towards package +managers, such as vcpkg and Conan. + +The result of this move is a significant improvement in compilation +times, e.g. the inclusion overhead of Catch2 in the common case has been +reduced by roughly 80%. The improved ease of maintenance also led to +various runtime performance improvements and the introduction of new features. +For details, look at [the release notes of 3.0.1](release-notes.md#301). + +_Note that we still provide one header + one TU distribution but do +not consider it the primarily supported option. You should also expect +that the compilation times will be worse if you use this option._ + + +## How to migrate projects from v2 to v3 + +To migrate to v3, there are two basic approaches to do so. 1. Use `catch_amalgamated.hpp` and `catch_amalgamated.cpp`. 2. Build Catch2 as a proper (static) library, and move to piecewise headers @@ -54,4 +81,4 @@ reporter or listener, you might need to modify them a bit. --- -[Home](Readme.md#top) \ No newline at end of file +[Home](Readme.md#top) diff --git a/packages/Catch2/docs/opensource-users.md b/packages/Catch2/docs/opensource-users.md index 17483f8b07a4033abf31d7d6c3aefeec30f1fe48..f709aa6e7d27b91a11b27aedba8d6752b6e8482a 100644 --- a/packages/Catch2/docs/opensource-users.md +++ b/packages/Catch2/docs/opensource-users.md @@ -1,22 +1,25 @@ <a id="top"></a> -# Open Source projects using Catch +# Open Source projects using Catch2 -Catch is great for open source. With its [liberal license](../LICENSE.txt) and single-header, dependency-free, distribution -it's easy to just drop the header into your project and start writing tests - what's not to like? +Catch2 is great for open source. It is licensed under the [Boost Software +License (BSL)](../LICENSE.txt), has no further dependencies and supports +two file distribution. -As a result Catch is now being used in many Open Source projects, including some quite well known ones. -This page is an attempt to track those projects. Obviously it can never be complete. -This effort largely relies on the maintainers of the projects themselves updating this page and submitting a PR -(or, if you prefer contact one of the maintainers of Catch directly, use the -[forums](https://groups.google.com/forum/?fromgroups#!forum/catch-forum)), or raise an [issue](https://github.com/philsquared/Catch/issues) to let us know). -Of course users of those projects might want to update this page too. That's fine - as long you're confident the project maintainers won't mind. -If you're an Open Source project maintainer and see your project listed here but would rather it wasn't - -just let us know via any of the previously mentioned means - although I'm sure there won't be many who feel that way. +As a result, Catch2 is used for testing in many different Open Source +projects. This page lists at least some of them, even though it will +obviously never be complete (and does not have the ambition to be +complete). Note that the list below is intended to be in alphabetical +order, to avoid implications of relative importance of the projects. + +_Please only add projects here if you are their maintainer, or have the +maintainer's explicit consent._ -Listing a project here does not imply endorsement and the plan is to keep these ordered alphabetically to avoid an implication of relative importance. ## Libraries & Frameworks +### [alpaka](https://github.com/alpaka-group/alpaka) +A header-only C++14 abstraction library for accelerator development. + ### [ApprovalTests.cpp](https://github.com/approvals/ApprovalTests.cpp) C++11 implementation of Approval Tests, for quick, convenient testing of legacy code. @@ -59,6 +62,9 @@ A header-only library that allows CPUs to execute unmodified HIP code. It is gen ### [Inja](https://github.com/pantor/inja) A header-only template engine for modern C++. +### [LLAMA](https://github.com/alpaka-group/llama) +A C++17 template header-only library for the abstraction of memory access patterns. + ### [libcluon](https://github.com/chrberger/libcluon) A single-header-only library written in C++14 to glue distributed software components (UDP, TCP, shared memory) supporting natively Protobuf, LCM/ZCM, MsgPack, and JSON for dynamic message transformations in-between. @@ -103,6 +109,9 @@ A high available cloud native micro-service application management platform impl ### [ArangoDB](https://github.com/arangodb/arangodb) ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. +### [d-SEAMS](https://github.com/d-SEAMS/seams-core) +Open source molecular dynamics simulation structure analysis suite of tools in modern C++. + ### [Giada - Your Hardcore Loop Machine](https://github.com/monocasual/giada) Minimal, open-source and cross-platform audio tool for live music production. diff --git a/packages/Catch2/docs/other-macros.md b/packages/Catch2/docs/other-macros.md index 994115f16d120b2f1af08fc54444e21b8fce8460..5e7f0af09f4d6a45a94edc35ba92c33d12aed4d8 100644 --- a/packages/Catch2/docs/other-macros.md +++ b/packages/Catch2/docs/other-macros.md @@ -15,6 +15,8 @@ stringification machinery to the _expr_ and records the result. As with evaluates to `true`. `CHECKED_ELSE( expr )` work similarly, but the block is entered only if the _expr_ evaluated to `false`. +> `CHECKED_X` macros were changed to not count as failure in Catch2 X.Y.Z. + Example: ```cpp int a = ...; @@ -59,7 +61,7 @@ TEST_CASE( "SUCCEED showcase" ) { * `STATIC_REQUIRE` -> [Introduced](https://github.com/catchorg/Catch2/issues/1362) in Catch 2.4.2. +> [Introduced](https://github.com/catchorg/Catch2/issues/1362) in Catch2 2.4.2. `STATIC_REQUIRE( expr )` is a macro that can be used the same way as a `static_assert`, but also registers the success with Catch2, so it is @@ -117,24 +119,9 @@ is initiated. This means that it either needs to be done in a global constructor, or before Catch2's session is created in user's own main._ -* `ANON_TEST_CASE` - -`ANON_TEST_CASE` is a `TEST_CASE` replacement that will autogenerate -unique name. The advantage of this is that you do not have to think -of a name for the test case,`the disadvantage is that the name doesn't -necessarily remain stable across different links, and thus it might be -hard to run directly. - -Example: -```cpp -ANON_TEST_CASE() { - SUCCEED("Hello from anonymous test case"); -} -``` - * `DYNAMIC_SECTION` -> Introduced in Catch 2.3.0. +> Introduced in Catch2 2.3.0. `DYNAMIC_SECTION` is a `SECTION` where the user can use `operator<<` to create the final name for that section. This can be useful with e.g. diff --git a/packages/Catch2/docs/release-notes.md b/packages/Catch2/docs/release-notes.md index b8538c288cef415729f02d841b35e0fac6130252..7e0f5a8f90d065d98e7a3ded517642a572795b94 100644 --- a/packages/Catch2/docs/release-notes.md +++ b/packages/Catch2/docs/release-notes.md @@ -3,6 +3,9 @@ # Release notes **Contents**<br> [3.0.1](#301)<br> +[2.13.6](#2136)<br> +[2.13.5](#2135)<br> +[2.13.4](#2134)<br> [2.13.3](#2133)<br> [2.13.2](#2132)<br> [2.13.1](#2131)<br> @@ -47,7 +50,6 @@ ## 3.0.1 (in progress) - **Catch2 now uses statically compiled library as its distribution model. This also means that to get all of Catch2's functionality in a test file, you have to include multiple headers.** @@ -74,12 +76,13 @@ new design. * Will Catch2 again distribute single-header version in the future? * No. But we do provide sqlite-style amalgamated distribution option. This means that you can download just 1 .cpp file and 1 header and place them next to your own sources. However, doing this has downsides similar to using the `catch_all.hpp` header. * Why the big breaking change caused by replacing `catch.hpp` with `catch_all.hpp`? - * The convenience header `catch_all.hpp` exists for two reasons. One of them is to provide a way for quick migration from Catch2, the second one is to provide a simple way to test things with Catch2. Using it for migration has one drawback in that it is **big**. This means that including it _will_ cause significant compile time drag, and so using it to migrate should be a concious decision by the user, not something they can just stumble into unknowingly. + * The convenience header `catch_all.hpp` exists for two reasons. One of them is to provide a way for quick migration from Catch2, the second one is to provide a simple way to test things with Catch2. Using it for migration has one drawback in that it is **big**. This means that including it _will_ cause significant compile time drag, and so using it to migrate should be a conscious decision by the user, not something they can just stumble into unknowingly. ### (Potentially) Breaking changes * **Catch2 now uses statically compiled library as its distribution model** * **Including `catch.hpp` no longer works** +* **Catch2 now uses C++14 as the minimum support language version** * `ANON_TEST_CASE` has been removed, use `TEST_CASE` with no arguments instead (#1220) * `--list*` commands no longer have non-zero return code (#1410) * `--list-test-names-only` has been removed (#1190) @@ -123,6 +126,11 @@ new design. * `EventListenerBase` now directly derives from `IStreamingReporter`, instead of deriving from `StreamingReporterBase` * `GENERATE` decays its arguments (#2012, #2040) * This means that `str` in `auto str = GENERATE("aa", "bb", "cc");` is inferred to `char const*` rather than `const char[2]`. +* `--list-*` flags write their output to file specified by the `-o` flag +* Many changes to reporter interfaces + * With the exception of the XmlReporter, the outputs of first party reporters should remain the same + * New pair of events were added + * One obsolete event was removed ### Improvements @@ -130,16 +138,37 @@ new design. * This includes having templated `match` member function * See the [rewritten Matchers documentation](matchers.md#top) for details * Catch2 currently provides _some_ generic matchers, but there should be more before final release of v3 - * So far, `IsEmpty`, `SizeIs`, and `Contains` are provided. - * At least `ElementsAre` and `UnorderedElementsAre` are planned. -* Some runtime performance improvements + * `IsEmpty`, `SizeIs` which check that the range has specific properties + * `Contains`, which checks whether a range contains a specific element + * `AllMatch`, `AnyMatch`, `NoneMatch` range matchers, which apply matchers over a range of elements * Significant compilation time improvements * including `catch_test_macros.hpp` is 80% cheaper than including `catch.hpp` +* Some runtime performance optimizations + * In all tested cases the v3 branch was faster, so the table below shows the speedup of v3 to v2 at the same task +<a id="v3-runtime-optimization-table"></a> + +| task | debug build | release build | +|:------------------------------------------- | ------------:| -------------:| +| Run 1M `REQUIRE(true)` | 1.10 ± 0.01 | 1.02 ± 0.06 | +| Run 100 tests, 3^3 sections, 1 REQUIRE each | 1.27 ± 0.01 | 1.04 ± 0.01 | +| Run 3k tests, no names, no tags | 1.29 ± 0.01 | 1.05 ± 0.01 | +| Run 3k tests, names, tags | 1.49 ± 0.01 | 1.22 ± 0.01 | +| Run 1 out of 3k tests no names, no tags | 1.68 ± 0.02 | 1.19 ± 0.22 | +| Run 1 out of 3k tests, names, tags | 1.79 ± 0.02 | 2.06 ± 0.23 | + + +* POSIX platforms use `gmtime_r`, rather than `gmtime` when constructing a date string (#2008, #2165) +* `--list-*` flags write their output to file specified by the `-o` flag (#2061, #2163) +* `Approx::operator()` is now properly `const` +* Catch2's internal helper variables no longer use reserved identifiers (#578) ### Fixes * The `INFO` macro no longer contains superfluous semicolon (#1456) * The `--list*` family of command line flags now return 0 on success (#1410, #1146) +* Various ways of failing a benchmark are now counted and reporter properly +* The ULP matcher now handles comparing numbers with different signs properly (#2152) +* Universal ADL-found operators should no longer break decomposition (#2121) ### Other changes @@ -156,6 +185,49 @@ new design. +## 2.13.6 + +### Fixes +* Disabling all signal handlers no longer breaks compilation (#2212, #2213) + +### Miscellaneous +* `catch_discover_tests` should handle escaped semicolon (`;`) better (#2214, #2215) + + +## 2.13.5 + +### Improvements +* Detection of MAC and IPHONE platforms has been improved (#2140, #2157) +* Added workaround for bug in XLC 16.1.0.1 (#2155) +* Add detection for LCC when it is masquerading as GCC (#2199) +* Modified posix signal handling so it supports newer libcs (#2178) + * `MINSIGSTKSZ` was no longer usable in constexpr context. + +### Fixes +* Fixed compilation of benchmarking when `min` and `max` macros are defined (#2159) + * Including `windows.h` without `NOMINMAX` remains a really bad idea, don't do it + +### Miscellaneous +* The check whether Catch2 is being built as a subproject is now more reliable (#2202, #2204) + * The problem was that if the variable name used internally was defined the project including Catch2 as subproject, it would not be properly overwritten for Catch2's CMake. + + +## 2.13.4 + +### Improvements +* Improved the hashing algorithm used for shuffling test cases (#2070) + * `TEST_CASE`s that differ only in the last character should be properly shuffled + * Note that this means that v2.13.4 gives you a different order of test cases than 2.13.3, even given the same seed. + +### Miscellaneous +* Deprecated `ParseAndAddCatchTests` CMake integration (#2092) + * It is impossible to implement it properly for all the different test case variants Catch2 provides, and there are better options provided. + * Use `catch_discover_tests` instead, which uses runtime information about available tests. +* Fixed bug in `catch_discover_tests` that would cause it to fail when used in specific project structures (#2119) +* Added Bazel build file +* Added an experimental static library target to CMake + + ## 2.13.3 ### Fixes diff --git a/packages/Catch2/docs/slow-compiles.md b/packages/Catch2/docs/slow-compiles.md deleted file mode 100644 index 230f533059035150416e0387b2da9efd26fff160..0000000000000000000000000000000000000000 --- a/packages/Catch2/docs/slow-compiles.md +++ /dev/null @@ -1,72 +0,0 @@ -<a id="top"></a> -# Why do my tests take so long to compile? - -**Contents**<br> -[Short answer](#short-answer)<br> -[Long answer](#long-answer)<br> -[Practical example](#practical-example)<br> -[Other possible solutions](#other-possible-solutions)<br> - -Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that? - -Catch is implemented entirely in headers. There is a little overhead due to this - but not as much as you might think - and you can minimise it simply by organising your test code as follows: - -## Short answer -Exactly one source file must ```#define``` either ```CATCH_CONFIG_MAIN``` or ```CATCH_CONFIG_RUNNER``` before ```#include```-ing Catch. In this file *do not write any test cases*! In most cases that means this file will just contain two lines (the ```#define``` and the ```#include```). - -## Long answer - -Usually C++ code is split between a header file, containing declarations and prototypes, and an implementation file (.cpp) containing the definition, or implementation, code. Each implementation file, along with all the headers that it includes (and which those headers include, etc), is expanded into a single entity called a translation unit - which is then passed to the compiler and compiled down to an object file. - -But functions and methods can also be written inline in header files. The downside to this is that these definitions will then be compiled in *every* translation unit that includes the header. - -Because Catch is implemented *entirely* in headers you might think that the whole of Catch must be compiled into every translation unit that uses it! Actually it's not quite as bad as that. Catch mitigates this situation by effectively maintaining the traditional separation between the implementation code and declarations. Internally the implementation code is protected by ```#ifdef```s and is conditionally compiled into only one translation unit. This translation unit is that one that ```#define```s ```CATCH_CONFIG_MAIN``` or ```CATCH_CONFIG_RUNNER```. Let's call this the main source file. - -As a result the main source file *does* compile the whole of Catch every time! So it makes sense to dedicate this file to *only* ```#define```-ing the identifier and ```#include```-ing Catch (and implementing the runner code, if you're doing that). Keep all your test cases in other files. This way you won't pay the recompilation cost for the whole of Catch. - -## Practical example -Assume you have the `Factorial` function from the [tutorial](tutorial.md#top) in `factorial.cpp` (with forward declaration in `factorial.h`) and want to test it and keep the compile times down when adding new tests. Then you should have 2 files, `tests-main.cpp` and `tests-factorial.cpp`: - -```cpp -// tests-main.cpp -#define CATCH_CONFIG_MAIN -#include "catch.hpp" -``` - -```cpp -// tests-factorial.cpp -#include "catch.hpp" - -#include "factorial.h" - -TEST_CASE( "Factorials are computed", "[factorial]" ) { - REQUIRE( Factorial(1) == 1 ); - REQUIRE( Factorial(2) == 2 ); - REQUIRE( Factorial(3) == 6 ); - REQUIRE( Factorial(10) == 3628800 ); -} -``` - -After compiling `tests-main.cpp` once, it is enough to link it with separately compiled `tests-factorial.cpp`. This means that adding more tests to `tests-factorial.cpp`, will not result in recompiling Catch's main and the resulting compilation times will decrease substantially. - -``` -$ g++ tests-main.cpp -c -$ g++ factorial.cpp -c -$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact -Passed 1 test case with 4 assertions. -``` - -Now, the next time we change the file `tests-factorial.cpp` (say we add `REQUIRE( Factorial(0) == 1)`), it is enough to recompile the tests instead of recompiling main as well: - -``` -$ g++ tests-main.o factorial.o tests-factorial.cpp -o tests && ./tests -r compact -tests-factorial.cpp:11: failed: Factorial(0) == 1 for: 0 == 1 -Failed 1 test case, failed 1 assertion. -``` - -## Other possible solutions -You can also opt to sacrifice some features in order to speed-up Catch's compilation times. For details see the [documentation on Catch's compile-time configuration](configuration.md#other-toggles). - ---- - -[Home](Readme.md#top) diff --git a/packages/Catch2/docs/test-cases-and-sections.md b/packages/Catch2/docs/test-cases-and-sections.md index e9308c5ef0c78cb331959044b65d15157bf3d44c..7622eef36e8961adb7a157baddf512d649303ea4 100644 --- a/packages/Catch2/docs/test-cases-and-sections.md +++ b/packages/Catch2/docs/test-cases-and-sections.md @@ -90,15 +90,65 @@ This macro maps onto ```TEST_CASE``` and works in the same way, except that the * **WHEN(** _something_ **)** * **THEN(** _something_ **)** -These macros map onto ```SECTION```s except that the section names are the _something_s prefixed by "given: ", "when: " or "then: " respectively. +These macros map onto ```SECTION```s except that the section names are the _something_ texts prefixed by +"given: ", "when: " or "then: " respectively. These macros also map onto the AAA or A<sup>3</sup> test pattern +(standing either for [Assemble-Activate-Assert](http://wiki.c2.com/?AssembleActivateAssert) or +[Arrange-Act-Assert](http://wiki.c2.com/?ArrangeActAssert)), and in this context, the macros provide both code +documentation and reporting of these parts of a test case without the need for extra comments or code to do so. + +Semantically, a `GIVEN` clause may have multiple _independent_ `WHEN` clauses within it. This allows a test +to have, e.g., one set of "given" objects and multiple subtests using those objects in various ways in each +of the `WHEN` clauses without repeating the initialisation from the `GIVEN` clause. When there are _dependent_ +clauses -- such as a second `WHEN` clause that should only happen _after_ the previous `WHEN` clause has been +executed and validated -- there are additional macros starting with `AND_`: * **AND_GIVEN(** _something_ **)** * **AND_WHEN(** _something_ **)** * **AND_THEN(** _something_ **)** -Similar to ```GIVEN```, ```WHEN``` and ```THEN``` except that the prefixes start with "and ". These are used to chain ```GIVEN```s, ```WHEN```s and ```THEN```s together. +These are used to chain ```GIVEN```s, ```WHEN```s and ```THEN```s together. The `AND_*` clause is placed +_inside_ the clause on which it depends. There can be multiple _independent_ clauses that are all _dependent_ +on a single outer clause. +```cpp +SCENARIO( "vector can be sized and resized" ) { + GIVEN( "An empty vector" ) { + auto v = std::vector<std::string>{}; + + // Validate assumption of the GIVEN clause + THEN( "The size and capacity start at 0" ) { + REQUIRE( v.size() == 0 ); + REQUIRE( v.capacity() == 0 ); + } + + // Validate one use case for the GIVEN object + WHEN( "push_back() is called" ) { + v.push_back("hullo"); + + THEN( "The size changes" ) { + REQUIRE( v.size() == 1 ); + REQUIRE( v.capacity() >= 1 ); + } + } + } +} +``` + +This code will result in two runs through the scenario: +``` +Scenario : vector can be sized and resized + Given : An empty vector + Then : The size and capacity start at 0 + +Scenario : vector can be sized and resized + Given : An empty vector + When : push_back() is called + Then : The size changes +``` + +See also [runnable example on godbolt](https://godbolt.org/z/e5vPPM), +with a more complicated (and failing) example. -> `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch 2.4.0. +> `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch2 2.4.0. When any of these macros are used the console reporter recognises them and formats the test case header such that the Givens, Whens and Thens are aligned to aid readability. @@ -112,7 +162,7 @@ by types, in the form of `TEMPLATE_TEST_CASE`, * **TEMPLATE_TEST_CASE(** _test name_ , _tags_, _type1_, _type2_, ..., _typen_ **)** -> [Introduced](https://github.com/catchorg/Catch2/issues/1437) in Catch 2.5.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1437) in Catch2 2.5.0. _test name_ and _tag_ are exactly the same as they are in `TEST_CASE`, with the difference that the tag string must be provided (however, it @@ -164,7 +214,7 @@ TEMPLATE_TEST_CASE( "vectors can be sized and resized", "[vector][template]", in * **TEMPLATE_PRODUCT_TEST_CASE(** _test name_ , _tags_, (_template-type1_, _template-type2_, ..., _template-typen_), (_template-arg1_, _template-arg2_, ..., _template-argm_) **)** -> [Introduced](https://github.com/catchorg/Catch2/issues/1468) in Catch 2.6.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1468) in Catch2 2.6.0. _template-type1_ through _template-typen_ is list of template template types which should be combined with each of _template-arg1_ through @@ -209,7 +259,7 @@ is very high and should not be encountered in practice._ * **TEMPLATE_LIST_TEST_CASE(** _test name_, _tags_, _type list_ **)** -> [Introduced](https://github.com/catchorg/Catch2/issues/1627) in Catch 2.9.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1627) in Catch2 2.9.0. _type list_ is a generic list of types on which test case should be instantiated. List can be `std::tuple`, `boost::mpl::list`, `boost::mp11::mp_list` or anything with @@ -229,7 +279,7 @@ TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std ## Signature based parametrised test cases -> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch2 2.8.0. In addition to [type parametrised test cases](#type-parametrised-test-cases) Catch2 also supports signature base parametrised test cases, in form of `TEMPLATE_TEST_CASE_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_SIG`. @@ -251,7 +301,7 @@ Currently Catch2 support up to 11 template parameters in signature * **TEMPLATE_TEST_CASE_SIG(** _test name_ , _tags_, _signature_, _type1_, _type2_, ..., _typen_ **)** -Inside `TEMPLATE_TEST_CASE_SIG` test case you can use the names of template parameters as defined in _signature_. +Inside `TEMPLATE_TEST_CASE_SIG` test case you can use the names of template parameters as defined in _signature_. ```cpp TEMPLATE_TEST_CASE_SIG("TemplateTestSig: arrays can be created from NTTP arguments", "[vector][template][nttp]", diff --git a/packages/Catch2/docs/test-fixtures.md b/packages/Catch2/docs/test-fixtures.md index 832bba128023811273e72b1569256d2d352f6fee..d797214fbeda8a2bdbbb38aceb66af58097c9444 100644 --- a/packages/Catch2/docs/test-fixtures.md +++ b/packages/Catch2/docs/test-fixtures.md @@ -88,7 +88,7 @@ the limit is very high and should not be encountered in practice._ ## Signature-based parametrised test fixtures -> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch 2.8.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1609) in Catch2 2.8.0. Catch2 also provides `TEMPLATE_TEST_CASE_METHOD_SIG` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG` to support fixtures using non-type template parameters. These test cases work similar to `TEMPLATE_TEST_CASE_METHOD` and `TEMPLATE_PRODUCT_TEST_CASE_METHOD`, diff --git a/packages/Catch2/docs/tostring.md b/packages/Catch2/docs/tostring.md index 87a0caf0dfecbe8948bfe123c661067c3634a682..adce3cc764feda479a26389fba74f64733058da3 100644 --- a/packages/Catch2/docs/tostring.md +++ b/packages/Catch2/docs/tostring.md @@ -71,7 +71,7 @@ CATCH_TRANSLATE_EXCEPTION( MyType const& ex ) { ## Enums -> Introduced in Catch 2.8.0. +> Introduced in Catch2 2.8.0. Enums that already have a `<<` overload for `std::ostream` will convert to strings as expected. If you only need to convert enums to strings for test reporting purposes you can provide a `StringMaker` specialisations as any other type. @@ -110,7 +110,7 @@ TEST_CASE() { ## Floating point precision -> [Introduced](https://github.com/catchorg/Catch2/issues/1614) in Catch 2.8.0. +> [Introduced](https://github.com/catchorg/Catch2/issues/1614) in Catch2 2.8.0. Catch provides a built-in `StringMaker` specialization for both `float` and `double`. By default, it uses what we think is a reasonable precision, diff --git a/packages/Catch2/docs/tutorial.md b/packages/Catch2/docs/tutorial.md index 45cb9919b5b745096bc7f39a6fa3474d946d9104..f764321fe4c31309a85433d260eb038159eff1ae 100644 --- a/packages/Catch2/docs/tutorial.md +++ b/packages/Catch2/docs/tutorial.md @@ -10,33 +10,13 @@ [Type parametrised test cases](#type-parametrised-test-cases)<br> [Next steps](#next-steps)<br> -## Getting Catch2 - -The simplest way to get Catch2 is to download the latest -[amalgamated header](https://raw.githubusercontent.com/catchorg/Catch2/devel/extras/catch_amalgamated.hpp) -and [amalgamated source file](https://raw.githubusercontent.com/catchorg/Catch2/devel/extras/catch_amalgamated.cpp). - -These two files are the result of merging all headers, respectively -all source files, into one file. To use them, just drop them next to your -own project. Using Catch2 like this has a significant disadvantage in terms -of final compilation times, but it works well enough to get you started. - -Later, you should move towards using Catch2 as a proper library, preferably -via CMake. See our documentation on the [CMake integration](cmake-integration.md#top). - - -_If you have installed Catch2 from system package manager, or CMake -package, you need to include the header as `#include <catch2/catch.hpp>`_ - - --------- -The rest of this page is currently waiting for rewrite for the v3 -release. It might not be accurate in places, and likely doesn't mention -the proper header to include, or might refer to outdated functionality, -like the `CATCH_CONFIG_MAIN` macro. +## Getting Catch2 --------- +Ideally you should be using Catch2 through its [CMake integration](cmake-integration.md#top). +Catch2 also provides pkg-config files and single TU distribution, but this +documentation will assume you are using CMake. If you are using single-TU +distribution instead, remember to replace the included header with `catch_amalgamated.hpp`. ## Writing tests @@ -49,11 +29,8 @@ unsigned int Factorial( unsigned int number ) { } ``` -To keep things simple we'll put everything in a single file (<a href="#scaling-up">see later for more on how to structure your test files</a>). - ```c++ -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file -#include "catch.hpp" +#include <catch2/catch_test_macros.hpp> unsigned int Factorial( unsigned int number ) { return number <= 1 ? number : Factorial(number-1)*number; @@ -69,13 +46,10 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) { This will compile to a complete executable which responds to [command line arguments](command-line.md#top). If you just run it with no arguments it will execute all test cases (in this case there is just one), report any failures, report a summary of how many tests passed and failed and return the number of failed tests (useful for if you just want a yes/ no answer to: "did it work"). -If you run this as written it will pass. Everything is good. Right? -Well, there is still a bug here. In fact the first version of this tutorial I posted here genuinely had the bug in! So it's not completely contrived (thanks to Daryle Walker (```@CTMacUser```) for pointing this out). - -What is the bug? Well what is the factorial of zero? -[The factorial of zero is one](http://mathforum.org/library/drmath/view/57128.html) - which is just one of those things you have to know (and remember!). - -Let's add that to the test case: +Anyway, as the tests above as written will pass, but there is a bug. +The problem is that `Factorial(0)` should return 1 (due to [its +definition](https://en.wikipedia.org/wiki/Factorial#Factorial_of_zero)). +Let's add that as an assertion to the test case: ```c++ TEST_CASE( "Factorials are computed", "[factorial]" ) { @@ -87,7 +61,8 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) { } ``` -Now we get a failure - something like: +After another compile & run cycle, we will see a test failure. The output +will look something like: ``` Example.cpp:9: FAILED: @@ -96,37 +71,51 @@ with expansion: 0 == 1 ``` -Note that we get the actual return value of Factorial(0) printed for us (0) - even though we used a natural expression with the == operator. That lets us immediately see what the problem is. - -Let's change the factorial function to: +Note that the output contains both the original expression, +`REQUIRE( Factorial(0) == 1 )` and the actual value returned by the call +to the `Factorial` function: `0`. +We can fix this bug by slightly modifying the `Factorial` function to: ```c++ unsigned int Factorial( unsigned int number ) { return number > 1 ? Factorial(number-1)*number : 1; } ``` -Now all the tests pass. - -Of course there are still more issues to deal with. For example we'll hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. You might want to add tests for such cases and decide how to handle them. We'll stop short of doing that here. ### What did we do here? -Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take a moment to consider those before we move on. +Although this was a simple test it's been enough to demonstrate a few +things about how Catch2 is used. Let's take a moment to consider those +before we move on. + +* We introduce test cases with the `TEST_CASE` macro. This macro takes + one or two string arguments - a free form test name and, optionally, + one or more tags (for more see [Test cases and Sections](#test-cases-and-sections)). +* The test automatically self-registers with the test runner, and user + does not have do anything more to ensure that it is picked up by the test + framework. _Note that you can run specific test, or set of tests, + through the [command line](command-line#top)._ +* The individual test assertions are written using the `REQUIRE` macro. + It accepts a boolean expression, and uses expression templates to + internally decompose it, so that it can be individually stringified + on test failure. + +On the last point, note that there are more testing macros available, +because not all useful checks can be expressed as a simple boolean +expression. As an example, checking that an expression throws an exception +is done with the `REQUIRE_THROWS` macro. More on that later. -1. All we did was ```#define``` one identifier and ```#include``` one header and we got everything - even an implementation of ```main()``` that will [respond to command line arguments](command-line.md#top). You can only use that ```#define``` in one implementation file, for (hopefully) obvious reasons. Once you have more than one file with unit tests in you'll just ```#include "catch.hpp"``` and go. Usually it's a good idea to have a dedicated implementation file that just has ```#define CATCH_CONFIG_MAIN``` and ```#include "catch.hpp"```. You can also provide your own implementation of main and drive Catch yourself (see [Supplying-your-own-main()](own-main.md#top)). -2. We introduce test cases with the ```TEST_CASE``` macro. This macro takes one or two arguments - a free form test name and, optionally, one or more tags (for more see <a href="#test-cases-and-sections">Test cases and Sections</a>). The test name must be unique. You can run sets of tests by specifying a wildcarded test name or a tag expression. See the [command line docs](command-line.md#top) for more information on running tests. -3. The name and tags arguments are just strings. We haven't had to declare a function or method - or explicitly register the test case anywhere. Behind the scenes a function with a generated name is defined for you, and automatically registered using static registry classes. By abstracting the function name away we can name our tests without the constraints of identifier names. -4. We write our individual test assertions using the ```REQUIRE``` macro. Rather than a separate macro for each type of condition we express the condition naturally using C/C++ syntax. Behind the scenes a simple set of expression templates captures the left-hand-side and right-hand-side of the expression so we can display the values in our test report. As we'll see later there _are_ other assertion macros - but because of this technique the number of them is drastically reduced. -<a id="test-cases-and-sections"></a> ## Test cases and sections -Most test frameworks have a class-based fixture mechanism. That is, test cases map to methods on a class and common setup and teardown can be performed in ```setup()``` and ```teardown()``` methods (or constructor/ destructor in languages, like C++, that support deterministic destruction). - -While Catch fully supports this way of working there are a few problems with the approach. In particular the way your code must be split up, and the blunt granularity of it, may cause problems. You can only have one setup/ teardown pair across a set of methods, but sometimes you want slightly different setup in each method, or you may even want several levels of setup (a concept which we will clarify later on in this tutorial). It was <a href="http://jamesnewkirk.typepad.com/posts/2007/09/why-you-should-.html">problems like these</a> that led James Newkirk, who led the team that built NUnit, to start again from scratch and <a href="http://jamesnewkirk.typepad.com/posts/2007/09/announcing-xuni.html">build xUnit</a>). +Like most test frameworks, Catch2 supports a class-based fixture mechanism, +where individual tests are methods on class and setup/teardown can be +done in constructor/destructor of the type. -Catch takes a different approach (to both NUnit and xUnit) that is a more natural fit for C++ and the C family of languages. This is best explained through an example ([code](../examples/100-Fix-Section.cpp)): +However, idiomatic usage of Catch2 avoids using it in favour of free +standing test cases using _sections_ to share setup and teardown code. +This is best explained through an example ([code](../examples/100-Fix-Section.cpp)): ```c++ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { @@ -163,29 +152,42 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) { } ``` -For each ```SECTION``` the ```TEST_CASE``` is executed from the start - so as we enter each section we know that size is 5 and capacity is at least 5. We enforced those requirements with the ```REQUIRE```s at the top level so we can be confident in them. -This works because the ```SECTION``` macro contains an if statement that calls back into Catch to see if the section should be executed. One leaf section is executed on each run through a ```TEST_CASE```. The other sections are skipped. Next time through the next section is executed, and so on until no new sections are encountered. +For each `SECTION` the `TEST_CASE` is executed from the start. This means +that each section is entered with a freshly constructed vector `v`, that +we know has size 5 and capacity at least 5, because the two assertions +are also checked before the section is entered. Each run through a test +case will execute one, and only one, leaf section. -So far so good - this is already an improvement on the setup/teardown approach because now we see our setup code inline and use the stack. +Section can also be nested, in which case the parent section can be +entered multiple times, once for each leaf section. Nested sections are +most useful when you have multiple tests that share part of the set up. +To continue on the vector example above, you could add a check that +`std::vector::reserve` does not remove unused excess capacity, like this: -The power of sections really shows, however, when we need to execute a sequence of checked operations. Continuing the vector example, we might want to verify that attempting to reserve a capacity smaller than the current capacity of the vector changes nothing. We can do that, naturally, like so: - -```c++ +```cpp SECTION( "reserving bigger changes capacity but not size" ) { v.reserve( 10 ); REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 10 ); - - SECTION( "reserving smaller again does not change capacity" ) { + SECTION( "reserving down unused capacity does not change capacity" ) { v.reserve( 7 ); - + REQUIRE( v.size() == 5 ); REQUIRE( v.capacity() >= 10 ); } } ``` -Sections can be nested to an arbitrary depth (limited only by your stack size). Each leaf section (i.e. a section that contains no nested sections) will be executed exactly once, on a separate path of execution from any other leaf section (so no leaf section can interfere with another). A failure in a parent section will prevent nested sections from running - but then that's the idea. +Another way to look at sections is that they are a way to define a tree +of paths through the test. Each section represents a node, and the final +tree is walked in depth-first manner, with each path only visiting only +one leaf node. + +There is no practical limit on nesting sections, as long as your compiler +can handle them, but keep in mind that overly nested sections can become +unreadable. From experience, having section nest more than 3 levels is +usually very hard to follow and not worth the removed duplication. + ## BDD-Style @@ -247,24 +249,6 @@ Scenario: vectors can be sized and resized Then: the capacity changes but not the size ``` -<a id="scaling-up"></a> -## Scaling up - -To keep the tutorial simple we put all our code in a single file. This is fine to get started - and makes jumping into Catch even quicker and easier. As you write more real-world tests, though, this is not really the best approach. - -The requirement is that the following block of code ([or equivalent](own-main.md#top)): - -```c++ -#define CATCH_CONFIG_MAIN -#include "catch.hpp" -``` - -appears in _exactly one_ source file. Use as many additional cpp files (or whatever you call your implementation files) as you need for your tests, partitioned however makes most sense for your way of working. Each additional file need only ```#include "catch.hpp"``` - do not repeat the ```#define```! - -In fact it is usually a good idea to put the block with the ```#define``` [in its own source file](slow-compiles.md#top) (code example [main](../examples/020-TestCase-1.cpp), [tests](../examples/020-TestCase-2.cpp)). - -Do not write your tests in header files! - ## Type parametrised test cases diff --git a/packages/Catch2/docs/why-catch.md b/packages/Catch2/docs/why-catch.md index 86cc55bc56b52d8982a9e31ef788cae2102f8848..a4b8c2e2852ef987d6bec34cb034ccb585bb9ac9 100644 --- a/packages/Catch2/docs/why-catch.md +++ b/packages/Catch2/docs/why-catch.md @@ -6,40 +6,53 @@ including (but not limited to), [Google Test](http://code.google.com/p/googletest/), [Boost.Test](http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/index.html), [CppUnit](http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page), -[Cute](http://www.cute-test.com), +[Cute](http://www.cute-test.com), and [many, many more](http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#C.2B.2B). -So what does Catch bring to the party that differentiates it from these? Apart from a Catchy name, of course. +So what does Catch2 bring to the party that differentiates it from these? Apart from the catchy name, of course. + ## Key Features -* Quick and Really easy to get started. Just download catch.hpp, `#include` it and you're away. -* No external dependencies. As long as you can compile C++11 and have a C++ standard library available. +* 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. * 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. * Only one core assertion macro for comparisons. Standard C/C++ operators are used for the comparison - yet the full expression is decomposed and lhs and rhs values are logged. * Tests are named using free-form strings - no more couching names in legal identifiers. + ## Other core features * Tests can be tagged for easily running ad-hoc groups of tests. -* Failures can (optionally) break into the debugger on Windows and Mac. +* Failures can (optionally) break into the debugger on common platforms. * Output is through modular reporter objects. Basic textual and XML reporters are included. Custom reporters can easily be added. * JUnit xml output is supported for integration with third-party tools, such as CI servers. * A default main() function is provided, but you can supply your own for complete control (e.g. integration into your own test runner GUI). * A command line parser is provided and can still be used if you choose to provided your own main() function. -* Catch can test itself. * Alternative assertion macro(s) report failures but don't abort the test case -* Floating point tolerance comparisons are built in using an expressive Approx() syntax. +* Good set of facilities for floating point comparisons (`Catch::Approx` and full set of matchers) * Internal and friendly macros are isolated so name clashes can be managed -* Matchers +* Data generators (data driven test support) +* Hamcrest-style Matchers for testing complex properties +* Microbenchmarking support + -## Who else is using Catch? +## Who else is using Catch2? -See the list of [open source projects using Catch](opensource-users.md#top). +A whole lot of people. According to the 2021 Jetbrains C++ ecosystem survey, +about 11% of C++ programmers use Catch2 for unit testing, making it the +second most popular unit testing framework. + +You can also take a look at the (incomplete) list of [open source projects](opensource-users.md#top) +or the (very incomplete) list of [commercial users of Catch2](commercial-users.md#top) +for some idea on who else also uses Catch2. + +--- -See the [tutorial](tutorial.md#top) to get more of a taste of using Catch in practice +See the [tutorial](tutorial.md#top) to get more of a taste of using +Catch2 in practice. --- diff --git a/packages/Catch2/examples/210-Evt-EventListeners.cpp b/packages/Catch2/examples/210-Evt-EventListeners.cpp index 7a025375abbcfe6fe9c1ed0ab33a92bc025f5a8e..a4b938c9032575a1e36fd6a19ac6919bed82e785 100644 --- a/packages/Catch2/examples/210-Evt-EventListeners.cpp +++ b/packages/Catch2/examples/210-Evt-EventListeners.cpp @@ -366,10 +366,9 @@ struct MyListener : Catch::EventListenerBase { print( std::cout, 1, "- assertionInfo", assertionInfo ); } - bool assertionEnded( Catch::AssertionStats const& assertionStats ) override { + void assertionEnded( Catch::AssertionStats const& assertionStats ) override { std::cout << "\nEvent: assertionEnded:\n"; print( std::cout, 1, "- assertionStats", assertionStats ); - return true; } }; diff --git a/packages/Catch2/examples/302-Gen-Table.cpp b/packages/Catch2/examples/302-Gen-Table.cpp index 8b4fc97481d788cfd2f1d89998127b3d900c7c5f..74319518372296cac498e3ddc25fc954611f346f 100644 --- a/packages/Catch2/examples/302-Gen-Table.cpp +++ b/packages/Catch2/examples/302-Gen-Table.cpp @@ -48,7 +48,7 @@ TEST_CASE("Table allows pre-computed test inputs and outputs", "[example][genera * (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 preceeding variable delcarations can be + * - In C++17 mode std::tie() and the preceding variable delcarations can be * replaced by structured bindings: auto [test_input, expected] = GENERATE( * table<std::string, size_t>({ ... */ diff --git a/packages/Catch2/extras/Catch.cmake b/packages/Catch2/extras/Catch.cmake index b3f90a79e8bf16cf7210af5f651a966334142a66..a3885162039121634d4b72eb96d8545ce797a32f 100644 --- a/packages/Catch2/extras/Catch.cmake +++ b/packages/Catch2/extras/Catch.cmake @@ -202,4 +202,5 @@ endfunction() set(_CATCH_DISCOVER_TESTS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake + CACHE INTERNAL "Catch2 full path to CatchAddTests.cmake helper file" ) diff --git a/packages/Catch2/extras/CatchAddTests.cmake b/packages/Catch2/extras/CatchAddTests.cmake index 3688b72fd13255bef358be79209b1794b20aef3d..9210f5a4df30c49f744cd47bb5dac9e08f8806b1 100644 --- a/packages/Catch2/extras/CatchAddTests.cmake +++ b/packages/Catch2/extras/CatchAddTests.cmake @@ -16,7 +16,10 @@ set(tests) function(add_command NAME) set(_args "") - foreach(_arg ${ARGN}) + # use ARGV* instead of ARGN, because ARGN splits arrays into multiple arguments + math(EXPR _last_arg ${ARGC}-1) + foreach(_n RANGE 1 ${_last_arg}) + set(_arg "${ARGV${_n}}") if(_arg MATCHES "[^-./:a-zA-Z0-9_]") set(_args "${_args} [==[${_arg}]==]") # form a bracket_argument else() diff --git a/packages/Catch2/extras/ParseAndAddCatchTests.cmake b/packages/Catch2/extras/ParseAndAddCatchTests.cmake index 3f3da83198f3aac7bc555dbb69f7c50b887b9971..4771e02996a6167251a671a4b24e4edbc6b42be1 100644 --- a/packages/Catch2/extras/ParseAndAddCatchTests.cmake +++ b/packages/Catch2/extras/ParseAndAddCatchTests.cmake @@ -200,7 +200,7 @@ function(ParseAndAddCatchTests_ParseFile SourceFile TestTarget) # Escape commas in the test spec string(REPLACE "," "\\," Name ${Name}) - # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were neccessary, + # Work around CMake 3.18.0 change in `add_test()`, before the escaped quotes were necessary, # only with CMake 3.18.0 the escaped double quotes confuse the call. This change is reverted in 3.18.1 # And properly introduced in 3.19 with the CMP0110 policy if(_cmp0110_value STREQUAL "NEW" OR ${CMAKE_VERSION} VERSION_EQUAL "3.18") @@ -241,6 +241,7 @@ endfunction() # entry point function(ParseAndAddCatchTests TestTarget) + message(DEPRECATION "ParseAndAddCatchTest: function deprecated because of possibility of missed test cases. Consider using 'catch_discover_tests' from 'Catch.cmake'") ParseAndAddCatchTests_PrintDebugMessage("Started parsing ${TestTarget}") get_target_property(SourceFiles ${TestTarget} SOURCES) ParseAndAddCatchTests_PrintDebugMessage("Found the following sources: ${SourceFiles}") diff --git a/packages/Catch2/extras/catch_amalgamated.cpp b/packages/Catch2/extras/catch_amalgamated.cpp index 43f3eed9123a05150041430f070d1fce7b5d24b3..b67149f08e72e92549da2b44ce5fa4533e043dc4 100644 --- a/packages/Catch2/extras/catch_amalgamated.cpp +++ b/packages/Catch2/extras/catch_amalgamated.cpp @@ -1165,7 +1165,7 @@ namespace Catch { makeTestCaseInfo(std::string const& _className, NameAndTags const& nameAndTags, SourceLineInfo const& _lineInfo ) { - return Detail::unique_ptr<TestCaseInfo>(new TestCaseInfo(_className, nameAndTags, _lineInfo)); + return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo); } TestCaseInfo::TestCaseInfo(std::string const& _className, diff --git a/packages/Catch2/extras/catch_amalgamated.hpp b/packages/Catch2/extras/catch_amalgamated.hpp index 7f832413c6be01d4ac834cdbc3a4361a40a375c7..dd77291a9d3df7f814954f75f66022d91ec05448 100644 --- a/packages/Catch2/extras/catch_amalgamated.hpp +++ b/packages/Catch2/extras/catch_amalgamated.hpp @@ -950,7 +950,7 @@ namespace Catch { #include <iosfwd> namespace Catch { - + struct ITransientExpression; class LazyExpression { @@ -1430,7 +1430,7 @@ namespace Catch { double outlierVariance; template <typename Duration2> - operator BenchmarkStats<Duration2>() const { + explicit operator BenchmarkStats<Duration2>() const { std::vector<Duration2> samples2; samples2.reserve(samples.size()); for (auto const& sample : samples) { @@ -2575,7 +2575,7 @@ namespace Catch { analysis.outlier_variance, }; } else { - std::vector<Duration> samples; + std::vector<Duration> samples; samples.reserve(last - first); Duration mean = Duration(0); diff --git a/packages/Catch2/src/CMakeLists.txt b/packages/Catch2/src/CMakeLists.txt index f22236395c8468eba7ea842c21f31a20724d62e2..7e30c1a479805e6ebd0820ae8426029ffb4a0f7c 100644 --- a/packages/Catch2/src/CMakeLists.txt +++ b/packages/Catch2/src/CMakeLists.txt @@ -65,6 +65,8 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/internal/catch_errno_guard.hpp ${SOURCES_DIR}/internal/catch_exception_translator_registry.hpp ${SOURCES_DIR}/internal/catch_fatal_condition_handler.hpp + ${SOURCES_DIR}/internal/catch_floating_point_helpers.hpp + ${SOURCES_DIR}/internal/catch_unique_name.hpp ${SOURCES_DIR}/generators/catch_generator_exception.hpp ${SOURCES_DIR}/generators/catch_generators.hpp ${SOURCES_DIR}/generators/catch_generators_adapters.hpp @@ -79,7 +81,6 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.hpp - ${SOURCES_DIR}/interfaces/catch_interfaces_runner.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp ${SOURCES_DIR}/internal/catch_lazy_expr.hpp @@ -98,6 +99,7 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/catch_message.hpp ${SOURCES_DIR}/internal/catch_message_info.hpp ${SOURCES_DIR}/internal/catch_meta.hpp + ${SOURCES_DIR}/internal/catch_move_and_forward.hpp ${SOURCES_DIR}/internal/catch_option.hpp ${SOURCES_DIR}/internal/catch_output_redirect.hpp ${SOURCES_DIR}/internal/catch_platform.hpp @@ -160,6 +162,7 @@ set(IMPL_SOURCES ${SOURCES_DIR}/internal/catch_enum_values_registry.cpp ${SOURCES_DIR}/internal/catch_exception_translator_registry.cpp ${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp + ${SOURCES_DIR}/internal/catch_floating_point_helpers.cpp ${SOURCES_DIR}/generators/internal/catch_generators_combined_tu.cpp ${SOURCES_DIR}/interfaces/catch_interfaces_combined_tu.cpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.cpp @@ -239,12 +242,15 @@ add_library(Catch2 STATIC ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES} ) +add_build_reproducibility_settings(Catch2) add_library(Catch2::Catch2 ALIAS Catch2) if (ANDROID) target_link_libraries(Catch2 INTERFACE log) endif() +set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "d") + # depend on bunch of C++11 and C++14 features to have C++14 enabled by default target_compile_features(Catch2 PUBLIC @@ -280,12 +286,14 @@ target_include_directories(Catch2 add_library(Catch2WithMain STATIC ${SOURCES_DIR}/internal/catch_main.cpp ) +add_build_reproducibility_settings(Catch2WithMain) add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain) target_link_libraries(Catch2WithMain PUBLIC Catch2) set_target_properties(Catch2WithMain PROPERTIES OUTPUT_NAME "Catch2Main" ) +set_target_properties(Catch2WithMain PROPERTIES DEBUG_POSTFIX "d") if (NOT_SUBPROJECT) # create and install an export set for catch target as Catch2::Catch diff --git a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp index 8ff69b4ac88c443819985a08c6d0e351152076b3..28664b613e2484bd62bd9b96b1ac3e001b3256be 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_benchmark.hpp @@ -11,9 +11,11 @@ #define CATCH_BENCHMARK_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_config.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/interfaces/catch_interfaces_reporter.hpp> - +#include <catch2/internal/catch_unique_name.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/benchmark/catch_chronometer.hpp> #include <catch2/benchmark/catch_clock.hpp> #include <catch2/benchmark/catch_environment.hpp> @@ -34,11 +36,11 @@ namespace Catch { namespace Benchmark { struct Benchmark { Benchmark(std::string&& benchmarkName) - : name(std::move(benchmarkName)) {} + : name(CATCH_MOVE(benchmarkName)) {} template <class FUN> Benchmark(std::string&& benchmarkName , FUN &&func) - : fun(std::move(func)), name(std::move(benchmarkName)) {} + : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {} template <typename Clock> ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const { @@ -80,16 +82,18 @@ namespace Catch { auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end()); BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance }; getResultCapture().benchmarkEnded(stats); - + } CATCH_CATCH_ANON (TestFailureException) { + getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr); } CATCH_CATCH_ALL{ - if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow. - std::rethrow_exception(std::current_exception()); + getResultCapture().benchmarkFailed(translateActiveException()); + // We let the exception go further up so that the + // test case is marked as failed. + std::rethrow_exception(std::current_exception()); } } // sets lambda to be used in fun *and* executes benchmark! - template <typename Fun, - typename std::enable_if<!Detail::is_related<Fun, Benchmark>::value, int>::type = 0> + template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0> Benchmark & operator=(Fun func) { fun = Detail::BenchmarkFunction(func); run(); @@ -121,16 +125,16 @@ namespace Catch { #if defined(CATCH_CONFIG_PREFIX_ALL) #define CATCH_BENCHMARK(...) \ - INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,)) + INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,)) #define CATCH_BENCHMARK_ADVANCED(name) \ - INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name) + INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name) #else #define BENCHMARK(...) \ - INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,)) + INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,)) #define BENCHMARK_ADVANCED(name) \ - INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name) + INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name) #endif diff --git a/packages/Catch2/src/catch2/benchmark/catch_chronometer.hpp b/packages/Catch2/src/catch2/benchmark/catch_chronometer.hpp index 10fd5a2753f0596c2438249a4eb844991089448f..7ef08cef0d5a72b9c8d4508474dd4df7e533263a 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_chronometer.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_chronometer.hpp @@ -14,6 +14,7 @@ #include <catch2/benchmark/catch_optimizer.hpp> #include <catch2/benchmark/detail/catch_complete_invoke.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { namespace Benchmark { @@ -42,7 +43,7 @@ namespace Catch { struct Chronometer { public: template <typename Fun> - void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); } + void measure(Fun&& fun) { measure(CATCH_FORWARD(fun), is_callable<Fun(int)>()); } int runs() const { return repeats; } diff --git a/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp b/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp index 59600f21c107f8b2bd5a783fcc28c5ececaf0478..9da1eaaf8c015b53a6e096eef4e992927934bfa6 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_constructor.hpp @@ -10,6 +10,8 @@ #ifndef CATCH_CONSTRUCTOR_HPP_INCLUDED #define CATCH_CONSTRUCTOR_HPP_INCLUDED +#include <catch2/internal/catch_move_and_forward.hpp> + #include <type_traits> namespace Catch { @@ -18,7 +20,7 @@ namespace Catch { template <typename T, bool Destruct> struct ObjectStorage { - using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type; + using TStorage = std::aligned_storage_t<sizeof(T), std::alignment_of<T>::value>; ObjectStorage() : data() {} @@ -29,7 +31,7 @@ namespace Catch { ObjectStorage(ObjectStorage&& other) { - new(&data) T(std::move(other.stored_object())); + new(&data) T(CATCH_MOVE(other.stored_object())); } ~ObjectStorage() { destruct_on_exit<T>(); } @@ -37,11 +39,11 @@ namespace Catch { template <typename... Args> void construct(Args&&... args) { - new (&data) T(std::forward<Args>(args)...); + new (&data) T(CATCH_FORWARD(args)...); } template <bool AllowManualDestruction = !Destruct> - typename std::enable_if<AllowManualDestruction>::type destruct() + std::enable_if_t<AllowManualDestruction> destruct() { stored_object().~T(); } @@ -49,10 +51,10 @@ namespace Catch { private: // If this is a constructor benchmark, destruct the underlying object template <typename U> - void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); } + void destruct_on_exit(std::enable_if_t<Destruct, U>* = 0) { destruct<true>(); } // Otherwise, don't template <typename U> - void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { } + void destruct_on_exit(std::enable_if_t<!Destruct, U>* = 0) { } T& stored_object() { return *static_cast<T*>(static_cast<void*>(&data)); diff --git a/packages/Catch2/src/catch2/benchmark/catch_execution_plan.hpp b/packages/Catch2/src/catch2/benchmark/catch_execution_plan.hpp index 1dd0d9b01d595c5594d398b70f76f05e29fee978..bcb366ce6ab510f24d0092f94aea1cfc8907fe2d 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_execution_plan.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_execution_plan.hpp @@ -18,6 +18,7 @@ #include <catch2/benchmark/detail/catch_run_for_at_least.hpp> #include <algorithm> +#include <iterator> namespace Catch { namespace Benchmark { diff --git a/packages/Catch2/src/catch2/benchmark/catch_optimizer.hpp b/packages/Catch2/src/catch2/benchmark/catch_optimizer.hpp index 6f03ea0d475c1d94e6f67e9e56a1989764cdf822..b9af3ea1de55707af0601903441a8f9c5784d68e 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_optimizer.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_optimizer.hpp @@ -14,8 +14,9 @@ # include <atomic> // atomic_thread_fence #endif +#include <catch2/internal/catch_move_and_forward.hpp> + #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { @@ -56,13 +57,13 @@ namespace Catch { } template <typename Fn, typename... Args> - inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<!std::is_same<void, decltype(fn(args...))>::value>::type { - deoptimize_value(std::forward<Fn>(fn) (std::forward<Args...>(args...))); + inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same<void, decltype(fn(args...))>::value> { + deoptimize_value(CATCH_FORWARD(fn) (CATCH_FORWARD(args)...)); } template <typename Fn, typename... Args> - inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<std::is_same<void, decltype(fn(args...))>::value>::type { - std::forward<Fn>(fn) (std::forward<Args...>(args...)); + inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same<void, decltype(fn(args...))>::value> { + CATCH_FORWARD(fn) (CATCH_FORWARD(args)...); } } // namespace Benchmark } // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/catch_sample_analysis.hpp b/packages/Catch2/src/catch2/benchmark/catch_sample_analysis.hpp index 579e7af9547481846405a3520baca197f833672a..6204aaf1417454c81e130d8a4dbdeec108d06000 100644 --- a/packages/Catch2/src/catch2/benchmark/catch_sample_analysis.hpp +++ b/packages/Catch2/src/catch2/benchmark/catch_sample_analysis.hpp @@ -13,10 +13,10 @@ #include <catch2/benchmark/catch_clock.hpp> #include <catch2/benchmark/catch_estimate.hpp> #include <catch2/benchmark/catch_outlier_classification.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <vector> -#include <string> #include <iterator> namespace Catch { @@ -35,7 +35,7 @@ namespace Catch { samples2.reserve(samples.size()); std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); }); return { - std::move(samples2), + CATCH_MOVE(samples2), mean, standard_deviation, outliers, diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp index 0a52a8451ae4740fc681039be2b7426891e69980..cf96a3d28b9628d755b361a92df15469720c6d53 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_analyse.hpp @@ -11,8 +11,11 @@ #define CATCH_ANALYSE_HPP_INCLUDED #include <catch2/benchmark/catch_clock.hpp> +#include <catch2/benchmark/catch_environment.hpp> #include <catch2/benchmark/catch_sample_analysis.hpp> #include <catch2/benchmark/detail/catch_stats.hpp> +#include <catch2/interfaces/catch_interfaces_config.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <iterator> @@ -43,7 +46,7 @@ namespace Catch { samples2.reserve(samples.size()); std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); }); return { - std::move(samples2), + CATCH_MOVE(samples2), wrap_estimate(analysis.mean), wrap_estimate(analysis.standard_deviation), outliers, @@ -62,7 +65,7 @@ namespace Catch { mean /= i; return { - std::move(samples), + CATCH_MOVE(samples), Estimate<Duration>{mean, mean, mean, 0.0}, Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0}, OutlierClassification{}, diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp index 4e0c55ffcfdfb74c5366cfe0505dcac5d6c9f9f2..655c863508fcaa911d776f46dff161125d9da05b 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_benchmark_function.hpp @@ -14,19 +14,16 @@ #include <catch2/benchmark/detail/catch_complete_invoke.hpp> #include <catch2/internal/catch_meta.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> -#include <cassert> #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { namespace Detail { - template <typename T> - using Decay = typename std::decay<T>::type; template <typename T, typename U> struct is_related - : std::is_same<Decay<T>, Decay<U>> {}; + : std::is_same<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 @@ -39,7 +36,7 @@ namespace Catch { private: struct callable { virtual void call(Chronometer meter) const = 0; - virtual callable* clone() const = 0; + virtual Catch::Detail::unique_ptr<callable> clone() const = 0; virtual ~callable(); // = default; callable() = default; @@ -48,10 +45,12 @@ namespace Catch { }; template <typename Fun> struct model : public callable { - model(Fun&& fun_) : fun(std::move(fun_)) {} + model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {} model(Fun const& fun_) : fun(fun_) {} - model<Fun>* clone() const override { return new model<Fun>(*this); } + Catch::Detail::unique_ptr<callable> clone() const override { + return Catch::Detail::make_unique<model<Fun>>( *this ); + } void call(Chronometer meter) const override { call(meter, is_callable<Fun(Chronometer)>()); @@ -76,24 +75,24 @@ namespace Catch { : f(new model<do_nothing>{ {} }) {} template <typename Fun, - typename std::enable_if<!is_related<Fun, BenchmarkFunction>::value, int>::type = 0> + std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0> BenchmarkFunction(Fun&& fun) - : f(new model<typename std::decay<Fun>::type>(std::forward<Fun>(fun))) {} + : f(new model<std::decay_t<Fun>>(CATCH_FORWARD(fun))) {} BenchmarkFunction( BenchmarkFunction&& that ) noexcept: - f( std::move( that.f ) ) {} + f( CATCH_MOVE( that.f ) ) {} BenchmarkFunction(BenchmarkFunction const& that) : f(that.f->clone()) {} BenchmarkFunction& operator=( BenchmarkFunction&& that ) noexcept { - f = std::move( that.f ); + f = CATCH_MOVE( that.f ); return *this; } BenchmarkFunction& operator=(BenchmarkFunction const& that) { - f.reset(that.f->clone()); + f = that.f->clone(); return *this; } diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_complete_invoke.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_complete_invoke.hpp index 8cb132112124a51760df577fed1b5776c7544b5b..747b37a9968b302c8deb0c8127bde314be1db214 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_complete_invoke.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_complete_invoke.hpp @@ -10,13 +10,13 @@ #ifndef CATCH_COMPLETE_INVOKE_HPP_INCLUDED #define CATCH_COMPLETE_INVOKE_HPP_INCLUDED -#include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_test_failure_exception.hpp> #include <catch2/internal/catch_meta.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <type_traits> -#include <utility> namespace Catch { namespace Benchmark { @@ -33,14 +33,14 @@ namespace Catch { struct CompleteInvoker { template <typename Fun, typename... Args> static Result invoke(Fun&& fun, Args&&... args) { - return std::forward<Fun>(fun)(std::forward<Args>(args)...); + return CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); } }; template <> struct CompleteInvoker<void> { template <typename Fun, typename... Args> static CompleteType_t<void> invoke(Fun&& fun, Args&&... args) { - std::forward<Fun>(fun)(std::forward<Args>(args)...); + CATCH_FORWARD(fun)(CATCH_FORWARD(args)...); return {}; } }; @@ -48,20 +48,14 @@ namespace Catch { // invoke and not return void :( template <typename Fun, typename... Args> CompleteType_t<FunctionReturnType<Fun, Args...>> complete_invoke(Fun&& fun, Args&&... args) { - return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(std::forward<Fun>(fun), std::forward<Args>(args)...); + return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...); } - extern const std::string benchmarkErrorMsg; } // namespace Detail template <typename Fun> Detail::CompleteType_t<FunctionReturnType<Fun>> user_code(Fun&& fun) { - CATCH_TRY{ - return Detail::complete_invoke(std::forward<Fun>(fun)); - } CATCH_CATCH_ALL{ - getResultCapture().benchmarkFailed(translateActiveException()); - CATCH_RUNTIME_ERROR(Detail::benchmarkErrorMsg); - } + return Detail::complete_invoke(CATCH_FORWARD(fun)); } } // namespace Benchmark } // namespace Catch diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp index 0a49e51374b29d65476de8830e8e73361393ed35..3bba791e4091de6a6f999d76323d8235e9e35ad5 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_estimate_clock.hpp @@ -16,6 +16,7 @@ #include <catch2/benchmark/detail/catch_measure.hpp> #include <catch2/benchmark/detail/catch_run_for_at_least.hpp> #include <catch2/benchmark/catch_clock.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> #include <algorithm> #include <iterator> @@ -66,7 +67,9 @@ namespace Catch { } template <typename Clock> EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) { - auto time_limit = std::min(resolution * clock_cost_estimation_tick_limit, FloatDuration<Clock>(clock_cost_estimation_time_limit)); + auto time_limit = (std::min)( + resolution * clock_cost_estimation_tick_limit, + FloatDuration<Clock>(clock_cost_estimation_time_limit)); auto time_clock = [](int k) { return Detail::measure<Clock>([k] { for (int i = 0; i < k; ++i) { @@ -92,7 +95,14 @@ namespace Catch { template <typename Clock> Environment<FloatDuration<Clock>> measure_environment() { - static Environment<FloatDuration<Clock>>* env = nullptr; +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wexit-time-destructors" +#endif + static Catch::Detail::unique_ptr<Environment<FloatDuration<Clock>>> env; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif if (env) { return *env; } @@ -101,7 +111,7 @@ namespace Catch { auto resolution = Detail::estimate_clock_resolution<Clock>(iters); auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean); - env = new Environment<FloatDuration<Clock>>{ resolution, cost }; + env = Catch::Detail::make_unique<Environment<FloatDuration<Clock>>>( Environment<FloatDuration<Clock>>{resolution, cost} ); return *env; } } // namespace Detail diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp index 49df259ad486e57471409a7c45b00e35f29eafef..739e91e58947d6445ab7f36ab219bdcee86613b4 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_measure.hpp @@ -13,8 +13,7 @@ #include <catch2/benchmark/catch_clock.hpp> #include <catch2/benchmark/detail/catch_complete_invoke.hpp> #include <catch2/benchmark/detail/catch_timing.hpp> - -#include <utility> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { namespace Benchmark { @@ -22,10 +21,10 @@ namespace Catch { template <typename Clock, typename Fun, typename... Args> TimingOf<Clock, Fun, Args...> measure(Fun&& fun, Args&&... args) { auto start = Clock::now(); - auto&& r = Detail::complete_invoke(fun, std::forward<Args>(args)...); + auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...); auto end = Clock::now(); auto delta = end - start; - return { delta, std::forward<decltype(r)>(r), 1 }; + return { delta, CATCH_FORWARD(r), 1 }; } } // namespace Detail } // namespace Benchmark diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_repeat.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_repeat.hpp index cc2ea0241af72f5a2cf6075c40f3b7281703d096..360af09b6fa8bb729e792576600105265ed60f4a 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_repeat.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_repeat.hpp @@ -11,7 +11,7 @@ #define CATCH_REPEAT_HPP_INCLUDED #include <type_traits> -#include <utility> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { namespace Benchmark { @@ -26,8 +26,8 @@ namespace Catch { Fun fun; }; template <typename Fun> - repeater<typename std::decay<Fun>::type> repeat(Fun&& fun) { - return { std::forward<Fun>(fun) }; + repeater<std::decay_t<Fun>> repeat(Fun&& fun) { + return { CATCH_FORWARD(fun) }; } } // namespace Detail } // namespace Benchmark diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.hpp index da08a92ba06cb29cf38b77591af397fe78eb1fde..6b2f56e77bc055a4abe55bc7f828ee918bda62d3 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_run_for_at_least.hpp @@ -16,8 +16,8 @@ #include <catch2/benchmark/detail/catch_complete_invoke.hpp> #include <catch2/benchmark/detail/catch_timing.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> -#include <utility> #include <type_traits> namespace Catch { @@ -32,24 +32,27 @@ namespace Catch { Detail::ChronometerModel<Clock> meter; auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters)); - return { meter.elapsed(), std::move(result), iters }; + return { meter.elapsed(), CATCH_MOVE(result), iters }; } template <typename Clock, typename Fun> - using run_for_at_least_argument_t = typename std::conditional<is_callable<Fun(Chronometer)>::value, Chronometer, int>::type; + using run_for_at_least_argument_t = std::conditional_t<is_callable<Fun(Chronometer)>::value, Chronometer, int>; [[noreturn]] void throw_optimized_away_error(); template <typename Clock, typename Fun> - TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>> run_for_at_least(ClockDuration<Clock> how_long, int seed, Fun&& fun) { - auto iters = seed; + TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>> + run_for_at_least(ClockDuration<Clock> how_long, + const int initial_iterations, + Fun&& fun) { + auto iters = initial_iterations; while (iters < (1 << 30)) { auto&& Timing = measure_one<Clock>(fun, iters, is_callable<Fun(Chronometer)>()); if (Timing.elapsed >= how_long) { - return { Timing.elapsed, std::move(Timing.result), iters }; + return { Timing.elapsed, CATCH_MOVE(Timing.result), iters }; } iters *= 2; } diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp index 8e14bfd71ead287d73065f31031826db1095fcdd..45190da86e15194545a111926fea5a570174d567 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.cpp @@ -171,7 +171,7 @@ namespace Catch { double sb = stddev.point; double mn = mean.point / n; double mg_min = mn / 2.; - double sg = std::min(mg_min / 4., sb / std::sqrt(n)); + double sg = (std::min)(mg_min / 4., sb / std::sqrt(n)); double sg2 = sg * sg; double sb2 = sb * sb; @@ -190,7 +190,7 @@ namespace Catch { return (nc / n) * (sb2 - nc * sg2); }; - return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2; + return (std::min)(var_out(1), var_out((std::min)(c_max(0.), c_max(mg_min)))) / sb2; } diff --git a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp index b8044131acf40186aa0fe43057e1b9908cd7a94a..8985670f0892a9eb7c5558b4dc24d30cb5d988b9 100644 --- a/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp +++ b/packages/Catch2/src/catch2/benchmark/detail/catch_stats.hpp @@ -18,7 +18,6 @@ #include <numeric> #include <tuple> #include <cmath> -#include <utility> namespace Catch { namespace Benchmark { @@ -116,8 +115,8 @@ namespace Catch { double b2 = bias - z1; double a1 = a(b1); double a2 = a(b2); - auto lo = std::max(cumn(a1), 0); - auto hi = std::min(cumn(a2), n - 1); + auto lo = (std::max)(cumn(a1), 0); + auto hi = (std::min)(cumn(a2), n - 1); return { point, resample[lo], resample[hi], confidence_level }; } diff --git a/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp b/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp index c7234966fc23710250709140a109c2fe4b6d4966..ffbae6962821927d6813e8ac6e4d57498da13942 100644 --- a/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp +++ b/packages/Catch2/src/catch2/benchmark/internal/catch_benchmark_combined_tu.cpp @@ -47,26 +47,6 @@ namespace Catch { } // namespace Catch -//////////////////////////////////////////////// -// vvv formerly catch_complete_invoke.cpp vvv // -//////////////////////////////////////////////// - -#include <catch2/benchmark/detail/catch_complete_invoke.hpp> - -namespace Catch { - namespace Benchmark { - namespace Detail { - CATCH_INTERNAL_START_WARNINGS_SUPPRESSION - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS - const std::string benchmarkErrorMsg = "a benchmark failed to run successfully"; - CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION - } // namespace Detail - } // namespace Benchmark -} // namespace Catch - - - - ///////////////////////////////////////////////// // vvv formerly catch_run_for_at_least.cpp vvv // ///////////////////////////////////////////////// diff --git a/packages/Catch2/src/catch2/catch_all.hpp b/packages/Catch2/src/catch2/catch_all.hpp index 3bd6d9c85e16d134703c3775f549c7cede6db314..35bd9741ac947f63bc0ff5e4cd616bc69a37deb2 100644 --- a/packages/Catch2/src/catch2/catch_all.hpp +++ b/packages/Catch2/src/catch2/catch_all.hpp @@ -66,11 +66,13 @@ #include <catch2/internal/catch_errno_guard.hpp> #include <catch2/internal/catch_exception_translator_registry.hpp> #include <catch2/internal/catch_fatal_condition_handler.hpp> +#include <catch2/internal/catch_floating_point_helpers.hpp> #include <catch2/internal/catch_lazy_expr.hpp> #include <catch2/internal/catch_leak_detector.hpp> #include <catch2/internal/catch_list.hpp> #include <catch2/internal/catch_message_info.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_noncopyable.hpp> #include <catch2/internal/catch_option.hpp> #include <catch2/internal/catch_output_redirect.hpp> @@ -100,6 +102,7 @@ #include <catch2/internal/catch_textflow.hpp> #include <catch2/internal/catch_to_string.hpp> #include <catch2/internal/catch_uncaught_exceptions.hpp> +#include <catch2/internal/catch_unique_name.hpp> #include <catch2/internal/catch_unique_ptr.hpp> #include <catch2/internal/catch_wildcard_pattern.hpp> #include <catch2/internal/catch_windows_h_proxy.hpp> diff --git a/packages/Catch2/src/catch2/catch_approx.hpp b/packages/Catch2/src/catch2/catch_approx.hpp index 7483349477913e77663a96a97b1042408acf7383..7c3a17c031d88e8ee90adc99d77b52b01c47a4dd 100644 --- a/packages/Catch2/src/catch2/catch_approx.hpp +++ b/packages/Catch2/src/catch2/catch_approx.hpp @@ -30,7 +30,7 @@ namespace Catch { Approx operator-() const; template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> - Approx operator()( T const& value ) { + Approx operator()( T const& value ) const { Approx approx( static_cast<double>(value) ); approx.m_epsilon = m_epsilon; approx.m_margin = m_margin; @@ -114,8 +114,8 @@ namespace Catch { }; namespace literals { - Approx operator "" _a(long double val); - Approx operator "" _a(unsigned long long val); + Approx operator ""_a(long double val); + Approx operator ""_a(unsigned long long val); } // end namespace literals template<> diff --git a/packages/Catch2/src/catch2/catch_assertion_result.cpp b/packages/Catch2/src/catch2/catch_assertion_result.cpp index 4e1609153672edb0f5b1d0e617cb00681c2abc88..04e00d265c7c00a5db6dd580c7318ba315623534 100644 --- a/packages/Catch2/src/catch2/catch_assertion_result.cpp +++ b/packages/Catch2/src/catch2/catch_assertion_result.cpp @@ -91,7 +91,7 @@ namespace Catch { : expr; } - std::string AssertionResult::getMessage() const { + StringRef AssertionResult::getMessage() const { return m_resultData.message; } SourceLineInfo AssertionResult::getSourceInfo() const { diff --git a/packages/Catch2/src/catch2/catch_assertion_result.hpp b/packages/Catch2/src/catch2/catch_assertion_result.hpp index 0afb0e02e2eb4daf1b90a270b39e824561b44c08..3008664c212b3e0cec06a8be23041d4ad7b624dc 100644 --- a/packages/Catch2/src/catch2/catch_assertion_result.hpp +++ b/packages/Catch2/src/catch2/catch_assertion_result.hpp @@ -46,7 +46,7 @@ namespace Catch { std::string getExpressionInMacro() const; bool hasExpandedExpression() const; std::string getExpandedExpression() const; - std::string getMessage() const; + StringRef getMessage() const; SourceLineInfo getSourceInfo() const; StringRef getTestMacroName() const; diff --git a/packages/Catch2/src/catch2/catch_config.cpp b/packages/Catch2/src/catch2/catch_config.cpp index 7a4a0bdaed38628e8ecca2281e87b455d723244c..92fcff2063cd040e6cdca0198b7bebe122573cb7 100644 --- a/packages/Catch2/src/catch2/catch_config.cpp +++ b/packages/Catch2/src/catch2/catch_config.cpp @@ -18,7 +18,7 @@ namespace Catch { Config::Config( ConfigData const& data ) : m_data( data ), - m_stream( openStream() ) + m_stream( Catch::makeStream(m_data.outputFilename) ) { // We need to trim filter specs to avoid trouble with superfluous // whitespace (esp. important for bdd macros, as those are manually @@ -52,7 +52,6 @@ namespace Catch { bool Config::listTags() const { return m_data.listTags; } bool Config::listReporters() const { return m_data.listReporters; } - std::string Config::getProcessName() const { return m_data.processName; } std::string const& Config::getReporterName() const { return m_data.reporterName; } std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; } @@ -66,7 +65,7 @@ namespace Catch { // IConfig interface bool Config::allowThrows() const { return !m_data.noThrow; } std::ostream& Config::stream() const { return m_stream->stream(); } - std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } + StringRef Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; } bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; } bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); } bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); } @@ -86,8 +85,4 @@ namespace Catch { unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; } std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); } - IStream const* Config::openStream() { - return Catch::makeStream(m_data.outputFilename); - } - } // end namespace Catch diff --git a/packages/Catch2/src/catch2/catch_config.hpp b/packages/Catch2/src/catch2/catch_config.hpp index 10d0487a84202388bff1ca262f6b4aa2526714a6..7daf61c713071d59aebba6b5444e642268cfc244 100644 --- a/packages/Catch2/src/catch2/catch_config.hpp +++ b/packages/Catch2/src/catch2/catch_config.hpp @@ -76,7 +76,6 @@ namespace Catch { bool listTags() const; bool listReporters() const; - std::string getProcessName() const; std::string const& getReporterName() const; std::vector<std::string> const& getTestsOrTags() const override; @@ -90,7 +89,7 @@ namespace Catch { // IConfig interface bool allowThrows() const override; std::ostream& stream() const override; - std::string name() const override; + StringRef name() const override; bool includeSuccessfulResults() const override; bool warnAboutMissingAssertions() const override; bool warnAboutNoTests() const override; @@ -110,8 +109,6 @@ namespace Catch { std::chrono::milliseconds benchmarkWarmupTime() const override; private: - - IStream const* openStream(); ConfigData m_data; Detail::unique_ptr<IStream const> m_stream; diff --git a/packages/Catch2/src/catch2/catch_message.cpp b/packages/Catch2/src/catch2/catch_message.cpp index c140c08e1bc6168d7fad0aeebcc522d8dda6df60..2ad4aea37ba0ad165c778fb3714306474d63ab59 100644 --- a/packages/Catch2/src/catch2/catch_message.cpp +++ b/packages/Catch2/src/catch2/catch_message.cpp @@ -9,6 +9,7 @@ #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_uncaught_exceptions.hpp> #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <cassert> #include <stack> @@ -17,13 +18,6 @@ namespace Catch { //////////////////////////////////////////////////////////////////////////// - Catch::MessageBuilder::MessageBuilder( StringRef const& macroName, - SourceLineInfo const& lineInfo, - ResultWas::OfType type ) - :m_info(macroName, lineInfo, type) {} - - //////////////////////////////////////////////////////////////////////////// - ScopedMessage::ScopedMessage( MessageBuilder const& builder ): m_info( builder.m_info ) { @@ -32,7 +26,7 @@ namespace Catch { } ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept: - m_info( std::move( old.m_info ) ) { + m_info( CATCH_MOVE( old.m_info ) ) { old.m_moved = true; } diff --git a/packages/Catch2/src/catch2/catch_message.hpp b/packages/Catch2/src/catch2/catch_message.hpp index db60b6bf8f385fd9aa2b4ef63e4bbafdc9bc8839..970ba438a4c73c47603227cbddbead9cb594a355 100644 --- a/packages/Catch2/src/catch2/catch_message.hpp +++ b/packages/Catch2/src/catch2/catch_message.hpp @@ -34,9 +34,11 @@ namespace Catch { }; struct MessageBuilder : MessageStream { - MessageBuilder( StringRef const& macroName, + MessageBuilder( StringRef macroName, SourceLineInfo const& lineInfo, - ResultWas::OfType type ); + ResultWas::OfType type ): + m_info(macroName, lineInfo, type) {} + template<typename T> MessageBuilder& operator << ( T const& value ) { diff --git a/packages/Catch2/src/catch2/catch_registry_hub.cpp b/packages/Catch2/src/catch2/catch_registry_hub.cpp index e3a222dfccd4b1e39cda717e4e79e671985a857b..edf9b2b52ec65d5ade457f330f560350ea131d37 100644 --- a/packages/Catch2/src/catch2/catch_registry_hub.cpp +++ b/packages/Catch2/src/catch2/catch_registry_hub.cpp @@ -19,6 +19,7 @@ #include <catch2/catch_test_case_info.hpp> #include <catch2/internal/catch_noncopyable.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { @@ -48,16 +49,16 @@ namespace Catch { public: // IMutableRegistryHub void registerReporter( std::string const& name, IReporterFactoryPtr factory ) override { - m_reporterRegistry.registerReporter( name, std::move(factory) ); + m_reporterRegistry.registerReporter( name, CATCH_MOVE(factory) ); } void registerListener( IReporterFactoryPtr factory ) override { - m_reporterRegistry.registerListener( std::move(factory) ); + m_reporterRegistry.registerListener( CATCH_MOVE(factory) ); } void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker ) override { - m_testCaseRegistry.registerTest( std::move(testInfo), std::move(invoker) ); + m_testCaseRegistry.registerTest( CATCH_MOVE(testInfo), CATCH_MOVE(invoker) ); } - void registerTranslator( const IExceptionTranslator* translator ) override { - m_exceptionTranslatorRegistry.registerTranslator( translator ); + void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) override { + m_exceptionTranslatorRegistry.registerTranslator( CATCH_MOVE(translator) ); } void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override { m_tagAliasRegistry.add( alias, tag, lineInfo ); diff --git a/packages/Catch2/src/catch2/catch_reporter_registrars.hpp b/packages/Catch2/src/catch2/catch_reporter_registrars.hpp index e7375aa7b67bdb30326cd135722e425aee220f40..978d2925e24e34004281b2905286ab532b570a18 100644 --- a/packages/Catch2/src/catch2/catch_reporter_registrars.hpp +++ b/packages/Catch2/src/catch2/catch_reporter_registrars.hpp @@ -9,11 +9,15 @@ #define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/internal/catch_unique_ptr.hpp> namespace Catch { + struct IStreamingReporter; + using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; + template <typename T> class ReporterFactory : public IReporterFactory { diff --git a/packages/Catch2/src/catch2/catch_section_info.hpp b/packages/Catch2/src/catch2/catch_section_info.hpp index df0732ec35400228e6bd2298a9f4b9895161afc3..1d206891d0d293dc9ec9b7c3de8851d0faa8859b 100644 --- a/packages/Catch2/src/catch2/catch_section_info.hpp +++ b/packages/Catch2/src/catch2/catch_section_info.hpp @@ -8,6 +8,7 @@ #ifndef CATCH_SECTION_INFO_HPP_INCLUDED #define CATCH_SECTION_INFO_HPP_INCLUDED +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/catch_totals.hpp> @@ -22,7 +23,7 @@ namespace Catch { // still use the `-c` flag comfortably. SectionInfo( SourceLineInfo const& _lineInfo, std::string _name, const char* const = nullptr ): - name(std::move(_name)), + name(CATCH_MOVE(_name)), lineInfo(_lineInfo) {} diff --git a/packages/Catch2/src/catch2/catch_session.cpp b/packages/Catch2/src/catch2/catch_session.cpp index 5b1a50a9298e7a7ac871866f5e9f6fc4563ceb45..9738cbb4f994c910031dc99a47f9ec53c6fd1a1e 100644 --- a/packages/Catch2/src/catch2/catch_session.cpp +++ b/packages/Catch2/src/catch2/catch_session.cpp @@ -21,6 +21,7 @@ #include <catch2/reporters/catch_reporter_listening.hpp> #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <iomanip> @@ -43,19 +44,13 @@ namespace Catch { return createReporter(config->getReporterName(), config); } - // On older platforms, returning unique_ptr<ListeningReporter> - // when the return type is unique_ptr<IStreamingReporter> - // doesn't compile without a std::move call. However, this causes - // a warning on newer platforms. Thus, we have to work around - // it a bit and downcast the pointer manually. - auto ret = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter(config)); - auto& multi = static_cast<ListeningReporter&>(*ret); + auto multi = Detail::make_unique<ListeningReporter>(config); auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); for (auto const& listener : listeners) { - multi.addListener(listener->create(Catch::ReporterConfig(config))); + multi->addListener(listener->create(Catch::ReporterConfig(config))); } - multi.addReporter(createReporter(config->getReporterName(), config)); - return ret; + multi->addReporter(createReporter(config->getReporterName(), config)); + return multi; } class TestGroup { @@ -63,7 +58,7 @@ namespace Catch { explicit TestGroup(IStreamingReporterPtr&& reporter, Config const* config): m_reporter(reporter.get()), m_config{config}, - m_context{config, std::move(reporter)} { + m_context{config, CATCH_MOVE(reporter)} { auto const& allTestCases = getAllTestCasesSorted(*m_config); m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config); @@ -82,7 +77,6 @@ namespace Catch { Totals execute() { auto const& invalidArgs = m_config->testSpec().getInvalidArgs(); Totals totals; - m_context.testGroupStarting(m_config->name(), 1, 1); for (auto const& testCase : m_tests) { if (!m_context.aborting()) totals += m_context.runTest(*testCase); @@ -102,7 +96,6 @@ namespace Catch { m_reporter->reportInvalidArguments(invalidArg); } - m_context.testGroupEnded(m_config->name(), totals, 1, 1); return totals; } @@ -161,16 +154,16 @@ namespace Catch { void Session::showHelp() const { Catch::cout() - << "\nCatch v" << libraryVersion() << "\n" - << m_cli << std::endl - << "For more detailed usage please see the project docs\n" << std::endl; + << "\nCatch v" << libraryVersion() << '\n' + << m_cli << '\n' + << "For more detailed usage please see the project docs\n\n" << std::flush; } void Session::libIdentify() { Catch::cout() << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n" << std::left << std::setw(16) << "category: " << "testframework\n" << std::left << std::setw(16) << "framework: " << "Catch Test\n" - << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl; + << std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush; } int Session::applyCommandLine( int argc, char const * const * argv ) { @@ -186,7 +179,7 @@ namespace Catch { << "\nError(s) in input:\n" << TextFlow::Column( result.errorMessage() ).indent( 2 ) << "\n\n"; - Catch::cerr() << "Run with -? for usage\n" << std::endl; + Catch::cerr() << "Run with -? for usage\n\n" << std::flush; return MaxExitCode; } @@ -229,12 +222,12 @@ namespace Catch { int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before starting" << std::endl; + Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; static_cast<void>(std::getchar()); } int exitCode = runInternal(); if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl; + Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush; static_cast<void>(std::getchar()); } return exitCode; @@ -283,7 +276,7 @@ namespace Catch { return 0; } - TestGroup tests { std::move(reporter), m_config.get() }; + TestGroup tests { CATCH_MOVE(reporter), m_config.get() }; auto const totals = tests.execute(); if( m_config->warnAboutNoTests() && totals.error == -1 ) @@ -296,7 +289,7 @@ namespace Catch { } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) catch( std::exception& ex ) { - Catch::cerr() << ex.what() << std::endl; + Catch::cerr() << ex.what() << '\n' << std::flush; return MaxExitCode; } #endif diff --git a/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.hpp b/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.hpp index 6b5c2f1c8ad315eaebf314454accf3b794b4106c..c742bcd3bc0f8f3d06b6fc6b60cae446e7403cad 100644 --- a/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.hpp +++ b/packages/Catch2/src/catch2/catch_tag_alias_autoregistrar.hpp @@ -9,6 +9,7 @@ #define CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED #include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/internal/catch_unique_name.hpp> #include <catch2/internal/catch_source_line_info.hpp> namespace Catch { diff --git a/packages/Catch2/src/catch2/catch_test_case_info.cpp b/packages/Catch2/src/catch2/catch_test_case_info.cpp index e8029e9c23a29040144a9d09d02c70bb9167cfe7..7dab6ae48146f833bc618f48addf7a9070520e48 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.cpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.cpp @@ -101,13 +101,17 @@ namespace Catch { const size_t extras = 3 + 3; return extractFilenamePart(filepath).size() + extras; } + } // end unnamed namespace + + bool operator<( Tag const& lhs, Tag const& rhs ) { + return lhs.original < rhs.original; } Detail::unique_ptr<TestCaseInfo> makeTestCaseInfo(std::string const& _className, NameAndTags const& nameAndTags, SourceLineInfo const& _lineInfo ) { - return Detail::unique_ptr<TestCaseInfo>(new TestCaseInfo(_className, nameAndTags, _lineInfo)); + return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo); } TestCaseInfo::TestCaseInfo(std::string const& _className, @@ -146,6 +150,7 @@ namespace Catch { // it over to backing storage and actually reference the // backing storage in the saved tags StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1); + CATCH_ENFORCE(!tagStr.empty(), "Empty tags are not allowed"); enforceNotReservedTag(tagStr, lineInfo); properties |= parseSpecialTag(tagStr); // When copying a tag to the backing storage, we need to @@ -227,15 +232,19 @@ namespace Catch { StringRef(backingLCaseTags.c_str() + backingStart, backingEnd - backingStart)); } - - bool TestCaseHandle::operator == ( TestCaseHandle const& rhs ) const { - return m_invoker == rhs.m_invoker - && m_info->name == rhs.m_info->name - && m_info->className == rhs.m_info->className; - } - - bool TestCaseHandle::operator < ( TestCaseHandle const& rhs ) const { - return m_info->name < rhs.m_info->name; + bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) { + // We want to avoid redoing the string comparisons multiple times, + // so we store the result of a three-way comparison before using + // it in the actual comparison logic. + const auto cmpName = lhs.name.compare( rhs.name ); + if ( cmpName != 0 ) { + return cmpName < 0; + } + const auto cmpClassName = lhs.className.compare( rhs.className ); + if ( cmpClassName != 0 ) { + return cmpClassName < 0; + } + return lhs.tags < rhs.tags; } TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const { diff --git a/packages/Catch2/src/catch2/catch_test_case_info.hpp b/packages/Catch2/src/catch2/catch_test_case_info.hpp index 1383f11b9efc732cf4457541273f53fb07818567..8048bd3a3027ee548d59ade9eeafe803277fe820 100644 --- a/packages/Catch2/src/catch2/catch_test_case_info.hpp +++ b/packages/Catch2/src/catch2/catch_test_case_info.hpp @@ -30,6 +30,8 @@ namespace Catch { original(original_), lowerCased(lowerCased_) {} StringRef original, lowerCased; + + friend bool operator<( Tag const& lhs, Tag const& rhs ); }; struct ITestInvoker; @@ -44,7 +46,15 @@ namespace Catch { Benchmark = 1 << 6 }; - + /** + * Various metadata about the test case. + * + * A test case is uniquely identified by its (class)name and tags + * combination, with source location being ignored, and other properties + * being determined from tags. + * + * Tags are kept sorted. + */ struct TestCaseInfo : Detail::NonCopyable { TestCaseInfo(std::string const& _className, @@ -59,6 +69,10 @@ namespace Catch { // Adds the tag(s) with test's filename (for the -# flag) void addFilenameTag(); + //! Orders by name, classname and tags + friend bool operator<( TestCaseInfo const& lhs, + TestCaseInfo const& rhs ); + std::string tagsAsString() const; @@ -75,6 +89,12 @@ namespace Catch { TestCaseProperties properties = TestCaseProperties::None; }; + /** + * Wrapper over the test case information and the test case invoker + * + * Does not own either, and is specifically made to be cheap + * to copy around. + */ class TestCaseHandle { TestCaseInfo* m_info; ITestInvoker* m_invoker; @@ -87,9 +107,6 @@ namespace Catch { } TestCaseInfo const& getTestCaseInfo() const; - - bool operator== ( TestCaseHandle const& rhs ) const; - bool operator < ( TestCaseHandle const& rhs ) const; }; Detail::unique_ptr<TestCaseInfo> makeTestCaseInfo( std::string const& className, diff --git a/packages/Catch2/src/catch2/catch_test_macros.hpp b/packages/Catch2/src/catch2/catch_test_macros.hpp index dcbe53db9ab8b947a9a76da0074ed91a2876b1fe..918fd4bfff071e8e4792ea8d515b16ae43bddd18 100644 --- a/packages/Catch2/src/catch2/catch_test_macros.hpp +++ b/packages/Catch2/src/catch2/catch_test_macros.hpp @@ -13,6 +13,8 @@ #include <catch2/internal/catch_preprocessor.hpp> #include <catch2/internal/catch_section.hpp> #include <catch2/internal/catch_test_registry.hpp> +#include <catch2/internal/catch_unique_name.hpp> + // All of our user-facing macros support configuration toggle, that // forces them to be defined prefixed with CATCH_. We also like to @@ -30,8 +32,8 @@ #define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ ) - #define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) - #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) + #define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) + #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) #define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) @@ -87,8 +89,8 @@ #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0) #define CATCH_CHECK_NOTHROW( ... ) (void)(0) - #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) - #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) + #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) + #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define CATCH_METHOD_AS_TEST_CASE( method, ... ) #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0) #define CATCH_SECTION( ... ) @@ -101,8 +103,8 @@ #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0) // "BDD-style" convenience wrappers - #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) - #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className ) + #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) + #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className ) #define CATCH_GIVEN( desc ) #define CATCH_AND_GIVEN( desc ) #define CATCH_WHEN( desc ) @@ -121,8 +123,8 @@ #define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) #define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ ) - #define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) - #define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) + #define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) + #define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) #define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ ) #define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ ) @@ -177,8 +179,8 @@ #define CHECK_THROWS_AS( expr, exceptionType ) (void)(0) #define CHECK_NOTHROW( ... ) (void)(0) - #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__) - #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )) + #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__) + #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ )) #define METHOD_AS_TEST_CASE( method, ... ) #define REGISTER_TEST_CASE( Function, ... ) (void)(0) #define SECTION( ... ) @@ -191,8 +193,8 @@ #define STATIC_REQUIRE_FALSE( ... ) (void)(0) // "BDD-style" convenience wrappers - #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) ) - #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className ) + #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ) ) + #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className ) #define GIVEN( desc ) #define AND_GIVEN( desc ) diff --git a/packages/Catch2/src/catch2/catch_tostring.cpp b/packages/Catch2/src/catch2/catch_tostring.cpp index 8b0ffe01b577bbf83f8daf6a99b084c26d6320eb..4c24234eef9f4222031193457a7722b51c75bc83 100644 --- a/packages/Catch2/src/catch2/catch_tostring.cpp +++ b/packages/Catch2/src/catch2/catch_tostring.cpp @@ -5,12 +5,6 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wexit-time-destructors" -# pragma clang diagnostic ignored "-Wglobal-constructors" -#endif - #include <catch2/catch_tostring.hpp> #include <catch2/interfaces/catch_interfaces_config.hpp> @@ -24,8 +18,6 @@ namespace Catch { namespace Detail { - const std::string unprintableString = "{?}"; - namespace { const int hexThreshold = 255; @@ -62,6 +54,48 @@ namespace Detail { } } // end unnamed namespace + std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string ret; + // This is enough for the "don't escape invisibles" case, and a good + // lower bound on the "escape invisibles" case. + ret.reserve(string.size() + 2); + + if (!escape_invisibles) { + ret += '"'; + ret += string; + ret += '"'; + return ret; + } + + ret += '"'; + for (char c : string) { + switch (c) { + case '\r': + ret.append("\\r"); + break; + case '\n': + ret.append("\\n"); + break; + case '\t': + ret.append("\\t"); + break; + case '\f': + ret.append("\\f"); + break; + default: + ret.push_back(c); + break; + } + } + ret += '"'; + + return ret; + } + + std::string convertIntoString(StringRef string) { + return convertIntoString(string, getCurrentContext().getConfig()->showInvisibles()); + } + std::string rawMemoryToString( const void *object, std::size_t size ) { // Reverse order for little endian architectures int i = 0, end = static_cast<int>( size ), inc = 1; @@ -88,44 +122,25 @@ namespace Detail { //// ======================================================= //// std::string StringMaker<std::string>::convert(const std::string& str) { - if (!getCurrentContext().getConfig()->showInvisibles()) { - return '"' + str + '"'; - } - - std::string s("\""); - for (char c : str) { - switch (c) { - case '\n': - s.append("\\n"); - break; - case '\t': - s.append("\\t"); - break; - default: - s.push_back(c); - break; - } - } - s.append("\""); - return s; + return Detail::convertIntoString( str ); } #ifdef CATCH_CONFIG_CPP17_STRING_VIEW std::string StringMaker<std::string_view>::convert(std::string_view str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( StringRef( str.data(), str.size() ) ); } #endif std::string StringMaker<char const*>::convert(char const* str) { if (str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( str ); } else { return{ "{null string}" }; } } std::string StringMaker<char*>::convert(char* str) { if (str) { - return ::Catch::Detail::stringify(std::string{ str }); + return Detail::convertIntoString( str ); } else { return{ "{null string}" }; } @@ -237,8 +252,3 @@ std::string StringMaker<double>::convert(double value) { } } // end namespace Catch - -#if defined(__clang__) -# pragma clang diagnostic pop -#endif - diff --git a/packages/Catch2/src/catch2/catch_tostring.hpp b/packages/Catch2/src/catch2/catch_tostring.hpp index d0f799a0279d6106e03fe611786af262e67e8f24..e82552bf82c1fecaad23de3406dde800023cadad 100644 --- a/packages/Catch2/src/catch2/catch_tostring.hpp +++ b/packages/Catch2/src/catch2/catch_tostring.hpp @@ -13,6 +13,7 @@ #include <cstddef> #include <type_traits> #include <string> +#include <string.h> #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_config_wchar.hpp> #include <catch2/internal/catch_stream.hpp> @@ -27,10 +28,26 @@ #pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless #endif +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy{}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + namespace Catch { + // Bring in global namespace operator<< for ADL lookup in + // `IsStreamInsertable` below. + using ::operator<<; + namespace Detail { - extern const std::string unprintableString; + + constexpr StringRef unprintableString = "{?}"_sr; + + //! Encases `string in quotes, and optionally escapes invisibles + std::string convertIntoString( StringRef string, bool escapeInvisibles ); + + //! Encases `string` in quotes, and escapes invisibles if user requested + //! it via CLI + std::string convertIntoString( StringRef string ); std::string rawMemoryToString( const void *object, std::size_t size ); @@ -59,7 +76,7 @@ namespace Catch { std::enable_if_t< !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value, std::string> convertUnstreamable( T const& ) { - return Detail::unprintableString; + return std::string(Detail::unprintableString); } template<typename T> std::enable_if_t< @@ -186,24 +203,31 @@ namespace Catch { }; #endif // CATCH_CONFIG_WCHAR - // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer, - // while keeping string semantics? template<int SZ> struct StringMaker<char[SZ]> { static std::string convert(char const* str) { - return ::Catch::Detail::stringify(std::string{ str }); + // Note that `strnlen` is not actually part of standard C++, + // but both POSIX and Windows cstdlib provide it. + return Detail::convertIntoString( + StringRef( str, strnlen( str, SZ ) ) ); } }; template<int SZ> struct StringMaker<signed char[SZ]> { static std::string convert(signed char const* str) { - return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) }); + // See the plain `char const*` overload + auto reinterpreted = reinterpret_cast<char const*>(str); + return Detail::convertIntoString( + StringRef(reinterpreted, strnlen(reinterpreted, SZ))); } }; template<int SZ> struct StringMaker<unsigned char[SZ]> { static std::string convert(unsigned char const* str) { - return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) }); + // See the plain `char const*` overload + auto reinterpreted = reinterpret_cast<char const*>(str); + return Detail::convertIntoString( + StringRef(reinterpreted, strnlen(reinterpreted, SZ))); } }; @@ -451,24 +475,24 @@ namespace Catch { using std::begin; using std::end; - namespace detail { + namespace Detail { template <typename...> struct void_type { using type = void; }; + template <typename... Ts> + using void_type_t = typename void_type<Ts...>::type; + template <typename T, typename = void> - struct is_range_impl : std::false_type { - }; + struct is_range_impl : std::false_type {}; template <typename T> - struct is_range_impl<T, typename void_type<decltype(begin(std::declval<T>()))>::type> : std::true_type { - }; - } // namespace detail + struct is_range_impl<T, void_type_t<decltype(begin(std::declval<T>()))>> : std::true_type {}; + } // namespace Detail template <typename T> - struct is_range : detail::is_range_impl<T> { - }; + struct is_range : Detail::is_range_impl<T> {}; #if defined(_MANAGED) // Managed types are never ranges template <typename T> @@ -625,7 +649,7 @@ struct ratio_string<std::milli> { #else std::strftime(timeStamp, timeStampSize, fmt, timeInfo); #endif - return std::string(timeStamp); + return std::string(timeStamp, timeStampSize - 1); } }; } diff --git a/packages/Catch2/src/catch2/catch_translate_exception.hpp b/packages/Catch2/src/catch2/catch_translate_exception.hpp index 412a1062e4b21755df39acf6b8c7c96c2cd2b27b..dfd95cd69619ef2cf9064201f944bb24aeb8b316 100644 --- a/packages/Catch2/src/catch2/catch_translate_exception.hpp +++ b/packages/Catch2/src/catch2/catch_translate_exception.hpp @@ -9,6 +9,8 @@ #define CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_exception.hpp> +#include <catch2/internal/catch_compiler_capabilities.hpp> +#include <catch2/internal/catch_unique_name.hpp> #include <exception> @@ -46,8 +48,9 @@ namespace Catch { public: template<typename T> ExceptionTranslatorRegistrar( std::string(*translateFunction)( T const& ) ) { - getMutableRegistryHub().registerTranslator - ( new ExceptionTranslator<T>( translateFunction ) ); + getMutableRegistryHub().registerTranslator( + Detail::make_unique<ExceptionTranslator<T>>(translateFunction) + ); } }; diff --git a/packages/Catch2/src/catch2/generators/catch_generators.hpp b/packages/Catch2/src/catch2/generators/catch_generators.hpp index 4ac73005160cef2c58581ebe085844333b441a68..9ffb9b76d7e763173b5b6f6fdef75734b53298d2 100644 --- a/packages/Catch2/src/catch2/generators/catch_generators.hpp +++ b/packages/Catch2/src/catch2/generators/catch_generators.hpp @@ -11,10 +11,10 @@ #include <catch2/interfaces/catch_interfaces_generatortracker.hpp> #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <vector> #include <tuple> -#include <utility> namespace Catch { @@ -55,7 +55,7 @@ namespace Detail { GeneratorWrapper(IGenerator<T>* generator): m_generator(generator) {} GeneratorWrapper(GeneratorPtr<T> generator): - m_generator(std::move(generator)) {} + m_generator(CATCH_MOVE(generator)) {} T const& get() const { return m_generator->get(); @@ -74,7 +74,7 @@ namespace Detail { m_value(value) {} SingleValueGenerator(T&& value): - m_value(std::move(value)) + m_value(CATCH_MOVE(value)) {} T const& get() const override { @@ -108,7 +108,7 @@ namespace Detail { GeneratorWrapper<DecayedT> value( T&& value ) { return GeneratorWrapper<DecayedT>( Catch::Detail::make_unique<SingleValueGenerator<DecayedT>>( - std::forward<T>( value ) ) ); + CATCH_FORWARD( value ) ) ); } template <typename T> GeneratorWrapper<T> values(std::initializer_list<T> values) { @@ -121,35 +121,35 @@ namespace Detail { size_t m_current = 0; void add_generator( GeneratorWrapper<T>&& generator ) { - m_generators.emplace_back( std::move( generator ) ); + m_generators.emplace_back( CATCH_MOVE( generator ) ); } void add_generator( T const& val ) { m_generators.emplace_back( value( val ) ); } void add_generator( T&& val ) { - m_generators.emplace_back( value( std::move( val ) ) ); + m_generators.emplace_back( value( CATCH_MOVE( val ) ) ); } template <typename U> std::enable_if_t<!std::is_same<std::decay_t<U>, T>::value> add_generator( U&& val ) { - add_generator( T( std::forward<U>( val ) ) ); + add_generator( T( CATCH_FORWARD( val ) ) ); } template <typename U> void add_generators( U&& valueOrGenerator ) { - add_generator( std::forward<U>( valueOrGenerator ) ); + add_generator( CATCH_FORWARD( valueOrGenerator ) ); } template <typename U, typename... Gs> void add_generators( U&& valueOrGenerator, Gs&&... moreGenerators ) { - add_generator( std::forward<U>( valueOrGenerator ) ); - add_generators( std::forward<Gs>( moreGenerators )... ); + add_generator( CATCH_FORWARD( valueOrGenerator ) ); + add_generators( CATCH_FORWARD( moreGenerators )... ); } public: template <typename... Gs> Generators(Gs &&... moreGenerators) { m_generators.reserve(sizeof...(Gs)); - add_generators(std::forward<Gs>(moreGenerators)...); + add_generators(CATCH_FORWARD(moreGenerators)...); } T const& get() const override { @@ -181,19 +181,19 @@ namespace Detail { template<typename T, typename... Gs> auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> { - return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...); + return Generators<T>(CATCH_MOVE(generator), CATCH_FORWARD(moreGenerators)...); } template<typename T> auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> { - return Generators<T>(std::move(generator)); + return Generators<T>(CATCH_MOVE(generator)); } template<typename T, typename... Gs> auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<std::decay_t<T>> { - return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... ); + return makeGenerators( value( CATCH_FORWARD( val ) ), CATCH_FORWARD( moreGenerators )... ); } template<typename T, typename U, typename... Gs> auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> { - return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... ); + return makeGenerators( value( T( CATCH_FORWARD( val ) ) ), CATCH_FORWARD( moreGenerators )... ); } auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&; diff --git a/packages/Catch2/src/catch2/generators/catch_generators_adapters.hpp b/packages/Catch2/src/catch2/generators/catch_generators_adapters.hpp index 393b070000ea8080c89ed4cf095974254c190584..c55a3962538b0335bdd6ce1df8570f8f312e499c 100644 --- a/packages/Catch2/src/catch2/generators/catch_generators_adapters.hpp +++ b/packages/Catch2/src/catch2/generators/catch_generators_adapters.hpp @@ -10,6 +10,9 @@ #include <catch2/generators/catch_generators.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> + +#include <cassert> namespace Catch { namespace Generators { @@ -21,7 +24,7 @@ namespace Generators { size_t m_target; public: TakeGenerator(size_t target, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), + m_generator(CATCH_MOVE(generator)), m_target(target) { assert(target != 0 && "Empty generators are not allowed"); @@ -47,7 +50,7 @@ namespace Generators { template <typename T> GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<TakeGenerator<T>>(target, std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<TakeGenerator<T>>(target, CATCH_MOVE(generator))); } @@ -58,8 +61,8 @@ namespace Generators { public: template <typename P = Predicate> FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), - m_predicate(std::forward<P>(pred)) + m_generator(CATCH_MOVE(generator)), + m_predicate(CATCH_FORWARD(pred)) { if (!m_predicate(m_generator.get())) { // It might happen that there are no values that pass the @@ -88,7 +91,7 @@ namespace Generators { template <typename T, typename Predicate> GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<FilterGenerator<T, Predicate>>(CATCH_FORWARD(pred), CATCH_MOVE(generator))); } template <typename T> @@ -103,7 +106,7 @@ namespace Generators { size_t m_repeat_index = 0; public: RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator): - m_generator(std::move(generator)), + m_generator(CATCH_MOVE(generator)), m_target_repeats(repeats) { assert(m_target_repeats > 0 && "Repeat generator must repeat at least once"); @@ -144,7 +147,7 @@ namespace Generators { template <typename T> GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) { - return GeneratorWrapper<T>(Catch::Detail::make_unique<RepeatGenerator<T>>(repeats, std::move(generator))); + return GeneratorWrapper<T>(Catch::Detail::make_unique<RepeatGenerator<T>>(repeats, CATCH_MOVE(generator))); } template <typename T, typename U, typename Func> @@ -157,8 +160,8 @@ namespace Generators { public: template <typename F2 = Func> MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) : - m_generator(std::move(generator)), - m_function(std::forward<F2>(function)), + m_generator(CATCH_MOVE(generator)), + m_function(CATCH_FORWARD(function)), m_cache(m_function(m_generator.get())) {} @@ -177,14 +180,14 @@ namespace Generators { template <typename Func, typename U, typename T = FunctionReturnType<Func, U>> GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator)) ); } template <typename T, typename U, typename Func> GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) { return GeneratorWrapper<T>( - Catch::Detail::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator)) + Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator)) ); } @@ -196,7 +199,7 @@ namespace Generators { bool m_used_up = false; public: ChunkGenerator(size_t size, GeneratorWrapper<T> generator) : - m_chunk_size(size), m_generator(std::move(generator)) + m_chunk_size(size), m_generator(CATCH_MOVE(generator)) { m_chunk.reserve(m_chunk_size); if (m_chunk_size != 0) { @@ -227,7 +230,7 @@ namespace Generators { template <typename T> GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) { return GeneratorWrapper<std::vector<T>>( - Catch::Detail::make_unique<ChunkGenerator<T>>(size, std::move(generator)) + Catch::Detail::make_unique<ChunkGenerator<T>>(size, CATCH_MOVE(generator)) ); } diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_all.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_all.hpp index 6dc4ebf17bf745b8263b878d0016f8a410dc3c90..2960bf6763b11f06567a2ff35002fd4233ba0c05 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_all.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_all.hpp @@ -31,7 +31,6 @@ #include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> -#include <catch2/interfaces/catch_interfaces_runner.hpp> #include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp> #include <catch2/interfaces/catch_interfaces_testcase.hpp> diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp index bfd0c0232ab12476f48870066ab1e2b213208601..2e7a631f152f28356893bd5524145cd6f2aa0b12 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_capture.hpp @@ -44,10 +44,10 @@ namespace Catch { virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0; - virtual void benchmarkPreparing( std::string const& name ) = 0; + virtual void benchmarkPreparing( StringRef name ) = 0; virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0; virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0; - virtual void benchmarkFailed( std::string const& error ) = 0; + virtual void benchmarkFailed( StringRef error ) = 0; virtual void pushScopedMessage( MessageInfo const& message ) = 0; virtual void popScopedMessage( MessageInfo const& message ) = 0; @@ -63,7 +63,7 @@ namespace Catch { virtual void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) = 0; virtual void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp index 46d7c38cf3a9f1a23d47daffcf73db2612d46e77..7acf0a12407cf6d1d18ba6a76ab769ce2320cd92 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_combined_tu.cpp @@ -63,17 +63,6 @@ namespace Catch { } -////////////////////////////////////////////////// -// vvv formerly catch_interfaces_runner.cpp vvv // -////////////////////////////////////////////////// - -#include <catch2/interfaces/catch_interfaces_runner.hpp> - -namespace Catch { - IRunner::~IRunner() = default; -} - - //////////////////////////////////////////////////// // vvv formerly catch_interfaces_testcase.cpp vvv // //////////////////////////////////////////////////// diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp index f09b0c0fe95c163702906fae406c385893399ff9..60c4e9be8c47ffa9f0e1392968d221dfd59c0247 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_config.hpp @@ -9,6 +9,7 @@ #define CATCH_INTERFACES_CONFIG_HPP_INCLUDED #include <catch2/internal/catch_noncopyable.hpp> +#include <catch2/internal/catch_stringref.hpp> #include <chrono> #include <iosfwd> @@ -59,7 +60,7 @@ namespace Catch { virtual bool allowThrows() const = 0; virtual std::ostream& stream() const = 0; - virtual std::string name() const = 0; + virtual StringRef name() const = 0; virtual bool includeSuccessfulResults() const = 0; virtual bool shouldDebugBreak() const = 0; virtual bool warnAboutMissingAssertions() const = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp index 2c18059a442fb864662d45ee52998a0aef61c383..e00f2c9db5ab376689480afebfabc131d1e753fa 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_enum_values_registry.hpp @@ -26,7 +26,7 @@ namespace Catch { } // namespace Detail struct IMutableEnumValuesRegistry { - virtual ~IMutableEnumValuesRegistry(); + virtual ~IMutableEnumValuesRegistry(); // = default; virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp index 84bb4974d104cd78da2ec4c8c902b0dc0237d1dc..c1834074577e0e1465a094c1e0aad6c703ba7bed 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp @@ -9,7 +9,6 @@ #define CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> -#include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_unique_ptr.hpp> #include <string> @@ -22,12 +21,12 @@ namespace Catch { using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>; struct IExceptionTranslator { - virtual ~IExceptionTranslator(); + virtual ~IExceptionTranslator(); // = default virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0; }; struct IExceptionTranslatorRegistry { - virtual ~IExceptionTranslatorRegistry(); + virtual ~IExceptionTranslatorRegistry(); // = default virtual std::string translateActiveException() const = 0; }; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp index bea1f7d480727179c95e3ab6c90a604d82ba97be..aeefeedb5fb26c708e48c8229deff966150a8ade 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_registry_hub.hpp @@ -31,7 +31,7 @@ namespace Catch { using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; struct IRegistryHub { - virtual ~IRegistryHub(); + virtual ~IRegistryHub(); // = default virtual IReporterRegistry const& getReporterRegistry() const = 0; virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0; @@ -43,11 +43,11 @@ namespace Catch { }; struct IMutableRegistryHub { - virtual ~IMutableRegistryHub(); + virtual ~IMutableRegistryHub(); // = default virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0; virtual void registerListener( IReporterFactoryPtr factory ) = 0; virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0; - virtual void registerTranslator( const IExceptionTranslator* translator ) = 0; + virtual void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) = 0; virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0; virtual void registerStartupException() noexcept = 0; virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp index 194161302d6a9fec3cff227eaee56b813aea4fa0..89a86f59a867b2837d7ae45a111d556bd1dc01e7 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -29,20 +29,9 @@ namespace Catch { std::ostream& ReporterConfig::stream() const { return *m_stream; } IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; } - - TestRunInfo::TestRunInfo( std::string const& _name ) : name( _name ) {} - - GroupInfo::GroupInfo( std::string const& _name, - std::size_t _groupIndex, - std::size_t _groupsCount ) - : name( _name ), - groupIndex( _groupIndex ), - groupsCounts( _groupsCount ) - {} - - AssertionStats::AssertionStats( AssertionResult const& _assertionResult, - std::vector<MessageInfo> const& _infoMessages, - Totals const& _totals ) + AssertionStats::AssertionStats( AssertionResult const& _assertionResult, + std::vector<MessageInfo> const& _infoMessages, + Totals const& _totals ) : assertionResult( _assertionResult ), infoMessages( _infoMessages ), totals( _totals ) @@ -84,20 +73,6 @@ namespace Catch { {} - TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo, - Totals const& _totals, - bool _aborting ) - : groupInfo( _groupInfo ), - totals( _totals ), - aborting( _aborting ) - {} - - TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo ) - : groupInfo( _groupInfo ), - aborting( false ) - {} - - TestRunStats::TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, bool _aborting ) @@ -106,6 +81,6 @@ namespace Catch { aborting( _aborting ) {} - void IStreamingReporter::fatalErrorEncountered( StringRef ) {} + IStreamingReporter::~IStreamingReporter() = default; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp index 5a4c31a8df65760f8401e11d707d2c19eb55ebd7..681c8e4d85357cd7bc3f63a560ad4eb2881427a2 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -14,7 +14,7 @@ #include <catch2/internal/catch_message_info.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_unique_ptr.hpp> - +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/benchmark/catch_estimate.hpp> #include <catch2/benchmark/catch_outlier_classification.hpp> @@ -45,17 +45,8 @@ namespace Catch { }; struct TestRunInfo { - TestRunInfo( std::string const& _name ); - std::string name; - }; - struct GroupInfo { - GroupInfo( std::string const& _name, - std::size_t _groupIndex, - std::size_t _groupsCount ); - - std::string name; - std::size_t groupIndex; - std::size_t groupsCounts; + TestRunInfo(StringRef _name) : name(_name) {} + StringRef name; }; struct AssertionStats { @@ -99,17 +90,6 @@ namespace Catch { bool aborting; }; - struct TestGroupStats { - TestGroupStats( GroupInfo const& _groupInfo, - Totals const& _totals, - bool _aborting ); - TestGroupStats( GroupInfo const& _groupInfo ); - - GroupInfo groupInfo; - Totals totals; - bool aborting; - }; - struct TestRunStats { TestRunStats( TestRunInfo const& _runInfo, Totals const& _totals, @@ -150,7 +130,7 @@ namespace Catch { } return { info, - std::move(samples2), + CATCH_MOVE(samples2), mean, standardDeviation, outliers, @@ -182,7 +162,7 @@ namespace Catch { public: IStreamingReporter( IConfig const* config ): m_config( config ) {} - virtual ~IStreamingReporter() = default; + virtual ~IStreamingReporter(); // = default; // Implementing class must also provide the following static methods: // static std::string getDescription(); @@ -191,35 +171,36 @@ namespace Catch { return m_preferences; } - virtual void noMatchingTestCases( std::string const& spec ) = 0; - - virtual void reportInvalidArguments(std::string const&) {} + virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0; + virtual void reportInvalidArguments( StringRef invalidArgument ) = 0; virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0; - virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0; + //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0; virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0; - virtual void benchmarkPreparing( std::string const& ) {} - virtual void benchmarkStarting( BenchmarkInfo const& ) {} - virtual void benchmarkEnded( BenchmarkStats<> const& ) {} - virtual void benchmarkFailed( std::string const& ) {} + virtual void benchmarkPreparing( StringRef benchmarkName ) = 0; + virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0; + virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0; + virtual void benchmarkFailed( StringRef benchmarkName ) = 0; virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0; - // The return value indicates if the messages buffer should be cleared: - virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0; + virtual void assertionEnded( AssertionStats const& assertionStats ) = 0; virtual void sectionEnded( SectionStats const& sectionStats ) = 0; + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0; + //! Called _once_ for each TEST_CASE, no matter how many times it is entered virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0; - virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0; virtual void testRunEnded( TestRunStats const& testRunStats ) = 0; virtual void skipTest( TestCaseInfo const& testInfo ) = 0; - // Default empty implementation provided - virtual void fatalErrorEncountered( StringRef name ); + virtual void fatalErrorEncountered( StringRef error ) = 0; //! Writes out information about provided reporters using reporter-specific format virtual void listReporters(std::vector<ReporterDescription> const& descriptions) = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp index 9bcf94f0b9efd4683b448fae75d2bae5dcfa06ca..5a40d1bded67f983b054ce0e348f37cc50b98edc 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp @@ -8,9 +8,16 @@ #ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED #define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED +#include <catch2/internal/catch_unique_ptr.hpp> + +#include <string> + namespace Catch { struct ReporterConfig; + struct IStreamingReporter; + using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; + struct IReporterFactory { virtual ~IReporterFactory(); // = default diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp index 05195f370ec85731c7f0781efe906f3470ad3124..54871ccedc236d162899531a9920565c3b52b514 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp @@ -27,7 +27,7 @@ namespace Catch { using FactoryMap = std::map<std::string, IReporterFactoryPtr>; using Listeners = std::vector<IReporterFactoryPtr>; - virtual ~IReporterRegistry(); + virtual ~IReporterRegistry(); // = default virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0; virtual FactoryMap const& getFactories() const = 0; virtual Listeners const& getListeners() const = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_runner.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_runner.hpp deleted file mode 100644 index 9072d72123f6c1eeb001e6b29ec7cef4fc047b0c..0000000000000000000000000000000000000000 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_runner.hpp +++ /dev/null @@ -1,19 +0,0 @@ - -// Copyright Catch2 Authors -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// https://www.boost.org/LICENSE_1_0.txt) - -// SPDX-License-Identifier: BSL-1.0 -#ifndef CATCH_INTERFACES_RUNNER_HPP_INCLUDED -#define CATCH_INTERFACES_RUNNER_HPP_INCLUDED - -namespace Catch { - - struct IRunner { - virtual ~IRunner(); - virtual bool aborting() const = 0; - }; -} - -#endif // CATCH_INTERFACES_RUNNER_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp index 152fdc2341436bcf48e58c47b00a1e2c37d05fb5..6b0973b40208204bc814619c43bed15e6d82c8a5 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_tag_alias_registry.hpp @@ -15,7 +15,7 @@ namespace Catch { struct TagAlias; struct ITagAliasRegistry { - virtual ~ITagAliasRegistry(); + virtual ~ITagAliasRegistry(); // = default // Nullptr if not present virtual TagAlias const* find( std::string const& alias ) const = 0; virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0; diff --git a/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp index aad5ea20e3a66f0dbe5e83d5b8533ece6d5c6740..2d0b6c284f59836bf0995916fcb0fcc2320a62d9 100644 --- a/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp +++ b/packages/Catch2/src/catch2/interfaces/catch_interfaces_testcase.hpp @@ -17,14 +17,14 @@ namespace Catch { struct ITestInvoker { virtual void invoke () const = 0; - virtual ~ITestInvoker(); + virtual ~ITestInvoker(); // = default }; class TestCaseHandle; struct IConfig; struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); + virtual ~ITestCaseRegistry(); // = default // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0; virtual std::vector<TestCaseHandle> const& getAllTests() const = 0; diff --git a/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp b/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp index 7774ca68f116c5187fabe07098fcb706e3e9ef29..828aa7cdff567238974b9d20e132377ea2bf0360 100644 --- a/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp +++ b/packages/Catch2/src/catch2/internal/catch_assertion_handler.cpp @@ -18,7 +18,7 @@ namespace Catch { AssertionHandler::AssertionHandler - ( StringRef const& macroName, + ( StringRef macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition ) @@ -29,7 +29,7 @@ namespace Catch { void AssertionHandler::handleExpr( ITransientExpression const& expr ) { m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction ); } - void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) { + void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) { m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction ); } @@ -80,7 +80,7 @@ namespace Catch { // This is the overload that takes a string and infers the Equals matcher from it // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ) { + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) { handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString ); } diff --git a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp index 8e266ade62a8fbb906e506ddbab7895a343418a4..b7c7613e311d874dacb60860a1ccefbc4719468e 100644 --- a/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp +++ b/packages/Catch2/src/catch2/internal/catch_assertion_handler.hpp @@ -32,7 +32,7 @@ namespace Catch { public: AssertionHandler - ( StringRef const& macroName, + ( StringRef macroName, SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition ); @@ -49,7 +49,7 @@ namespace Catch { } void handleExpr( ITransientExpression const& expr ); - void handleMessage(ResultWas::OfType resultType, StringRef const& message); + void handleMessage(ResultWas::OfType resultType, StringRef message); void handleExceptionThrownAsExpected(); void handleUnexpectedExceptionNotThrown(); @@ -64,7 +64,7 @@ namespace Catch { auto allowThrows() const -> bool; }; - void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ); } // namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_clara.hpp b/packages/Catch2/src/catch2/internal/catch_clara.hpp index 2da6919a229d49e8beb52def386a7cb665a3ab06..477cb08d1e7a509e96da5d962cbe33fcbd2bbfab 100644 --- a/packages/Catch2/src/catch2/internal/catch_clara.hpp +++ b/packages/Catch2/src/catch2/internal/catch_clara.hpp @@ -30,11 +30,11 @@ #endif #include <catch2/internal/catch_noncopyable.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <cassert> #include <cctype> #include <memory> -#include <ostream> #include <sstream> #include <string> #include <vector> @@ -69,8 +69,7 @@ namespace Catch { template <typename ClassT, typename ReturnT, typename ArgT> struct UnaryLambdaTraits<ReturnT ( ClassT::* )( ArgT ) const> { static const bool isValid = true; - using ArgType = typename std::remove_const< - typename std::remove_reference<ArgT>::type>::type; + using ArgType = std::remove_const_t<std::remove_reference_t<ArgT>>; using ReturnType = ReturnT; }; @@ -293,7 +292,7 @@ namespace Catch { T temp; auto result = convertInto( source, temp ); if ( result ) - target = std::move( temp ); + target = CATCH_MOVE( temp ); return result; } #endif // CLARA_CONFIG_OPTIONAL_TYPE diff --git a/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp b/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp index c3ed9e2bc7abead4b9a86462fa02714bb64b0665..b78d190498d519da2ed12db622fd75a89b4464a6 100644 --- a/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp +++ b/packages/Catch2/src/catch2/internal/catch_combined_tu.cpp @@ -194,7 +194,7 @@ Catch::LeakDetector::~LeakDetector() { namespace Catch { - MessageInfo::MessageInfo( StringRef const& _macroName, + MessageInfo::MessageInfo( StringRef _macroName, SourceLineInfo const& _lineInfo, ResultWas::OfType _type ) : macroName( _macroName ), diff --git a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp index 3c24cf2b819898252e2f9401afeb53b6fe4a66cd..0684050b921cf3502ee531cfaa1554cb594cd5b4 100644 --- a/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp +++ b/packages/Catch2/src/catch2/internal/catch_compiler_capabilities.hpp @@ -38,9 +38,9 @@ #endif -// We have to avoid both ICC and Clang, because they try to mask themselves -// as gcc, and we want only GCC in this block -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) # define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) # define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) @@ -71,8 +71,13 @@ // REQUIRE(std::string("12") + "34" == "1234") // ``` // +// Similarly, NVHPC's implementation of `__builtin_constant_p` has a bug which +// results in calls to the immediately evaluated lambda expressions to be +// reported as unevaluated lambdas. +// https://developer.nvidia.com/nvidia_bug/3321845. +// // Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. -# if !defined(__ibmxl__) && !defined(__CUDACC__) +# if !defined(__ibmxl__) && !defined(__CUDACC__) && !defined( __NVCOMPILER ) # define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ # endif @@ -222,7 +227,7 @@ // Check if byte is available and usable # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER) # include <cstddef> - # if __cpp_lib_byte > 0 + # 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) diff --git a/packages/Catch2/src/catch2/internal/catch_container_nonmembers.hpp b/packages/Catch2/src/catch2/internal/catch_container_nonmembers.hpp index f1dedeb6a4ca9ecea25e9f33b1d5a76ff0e8f4c4..d6f10eb5ed0a9e5d07050441f17403dbf9a60377 100644 --- a/packages/Catch2/src/catch2/internal/catch_container_nonmembers.hpp +++ b/packages/Catch2/src/catch2/internal/catch_container_nonmembers.hpp @@ -10,6 +10,8 @@ #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. diff --git a/packages/Catch2/src/catch2/internal/catch_context.cpp b/packages/Catch2/src/catch2/internal/catch_context.cpp index 86c56a6f5b577f27f8da7b2bf43091a01659eb73..790a1b23d62273f5ea2d8ccab8e76ae461b6371f 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_context.cpp @@ -17,9 +17,6 @@ namespace Catch { IResultCapture* getResultCapture() override { return m_resultCapture; } - IRunner* getRunner() override { - return m_runner; - } IConfig const* getConfig() const override { return m_config; @@ -31,9 +28,6 @@ namespace Catch { void setResultCapture( IResultCapture* resultCapture ) override { m_resultCapture = resultCapture; } - void setRunner( IRunner* runner ) override { - m_runner = runner; - } void setConfig( IConfig const* config ) override { m_config = config; } @@ -42,7 +36,6 @@ namespace Catch { private: IConfig const* m_config = nullptr; - IRunner* m_runner = nullptr; IResultCapture* m_resultCapture = nullptr; }; diff --git a/packages/Catch2/src/catch2/internal/catch_context.hpp b/packages/Catch2/src/catch2/internal/catch_context.hpp index 6f660f3a039788deaf042e0580273d56d4804d82..d3552448222247500d5cc67542116ae32b5562ce 100644 --- a/packages/Catch2/src/catch2/internal/catch_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_context.hpp @@ -11,23 +11,20 @@ namespace Catch { struct IResultCapture; - struct IRunner; struct IConfig; struct IContext { - virtual ~IContext(); + virtual ~IContext(); // = default virtual IResultCapture* getResultCapture() = 0; - virtual IRunner* getRunner() = 0; virtual IConfig const* getConfig() const = 0; }; struct IMutableContext : IContext { - virtual ~IMutableContext(); + virtual ~IMutableContext(); // = default virtual void setResultCapture( IResultCapture* resultCapture ) = 0; - virtual void setRunner( IRunner* runner ) = 0; virtual void setConfig( IConfig const* config ) = 0; private: diff --git a/packages/Catch2/src/catch2/internal/catch_debugger.cpp b/packages/Catch2/src/catch2/internal/catch_debugger.cpp index e1764034b6a0bfc4c78492b5fefd0e7226a563fd..3c80173a69c830fc6ab1c719bc98aa5b59d5c091 100644 --- a/packages/Catch2/src/catch2/internal/catch_debugger.cpp +++ b/packages/Catch2/src/catch2/internal/catch_debugger.cpp @@ -53,7 +53,7 @@ size = sizeof(info); if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) { - Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl; + Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n\n" << std::flush; return false; } diff --git a/packages/Catch2/src/catch2/internal/catch_decomposer.hpp b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp index 9af5c19f706c9a59c2701396f08a21e7e2920c84..a747c34cd61a5b364749823d210f7d0b80e1870f 100644 --- a/packages/Catch2/src/catch2/internal/catch_decomposer.hpp +++ b/packages/Catch2/src/catch2/internal/catch_decomposer.hpp @@ -183,60 +183,53 @@ namespace Catch { public: explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {} - template<typename RhsT> - auto operator == ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { compareEqual( m_lhs, rhs ), m_lhs, "=="_sr, rhs }; + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> + friend auto operator == ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { + return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; } - auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const { - return { m_lhs == rhs, m_lhs, "=="_sr, rhs }; + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> + friend auto operator == ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { + return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs }; } - template<typename RhsT> - auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { compareNotEqual( m_lhs, rhs ), m_lhs, "!="_sr, rhs }; + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> + friend auto operator != ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { + return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; } - auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const { - return { m_lhs != rhs, m_lhs, "!="_sr, rhs }; + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> + friend auto operator != ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { + return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs }; } - template<typename RhsT> - auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs > rhs), m_lhs, ">"_sr, rhs }; - } - template<typename RhsT> - auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs < rhs), m_lhs, "<"_sr, rhs }; - } - template<typename RhsT> - auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs >= rhs), m_lhs, ">="_sr, rhs }; - } - template<typename RhsT> - auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<="_sr, rhs }; - } - template <typename RhsT> - auto operator | (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs | rhs), m_lhs, "|"_sr, rhs }; - } - template <typename RhsT> - auto operator & (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs & rhs), m_lhs, "&"_sr, rhs }; - } - template <typename RhsT> - auto operator ^ (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const { - return { static_cast<bool>(m_lhs ^ rhs), m_lhs, "^"_sr, rhs }; + #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op) \ + template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> \ + friend auto operator op ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { \ + return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ + } \ + template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> \ + friend auto operator op ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { \ + return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \ } + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<=) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>=) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(|) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(&) + CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(^) + + #undef CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR + template<typename RhsT> - auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + friend auto operator && ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT const&> { static_assert(always_false<RhsT>::value, "operator&& is not supported inside assertions, " "wrap the expression inside parentheses, or decompose it"); } template<typename RhsT> - auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const { + friend auto operator || ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT const&> { static_assert(always_false<RhsT>::value, "operator|| is not supported inside assertions, " "wrap the expression inside parentheses, or decompose it"); @@ -247,21 +240,15 @@ namespace Catch { } }; - void handleExpression( ITransientExpression const& expr ); - - template<typename T> - void handleExpression( ExprLhs<T> const& expr ) { - handleExpression( expr.makeUnaryExpr() ); - } - struct Decomposer { - template<typename T> - auto operator <= ( T const& lhs ) -> ExprLhs<T const&> { - return ExprLhs<T const&>{ lhs }; + template<typename T, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<T>>::value, int> = 0> + friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs<T const&> { + return ExprLhs<const T&>{ lhs }; } - auto operator <=( bool value ) -> ExprLhs<bool> { - return ExprLhs<bool>{ value }; + template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0> + friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> { + return ExprLhs<T>{ value }; } }; diff --git a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp index cfa206f99abadfe7e528744460f5100cc590a6ac..ef4baf9a994bc45f738fc49d7814a4fbd7b6b8cf 100644 --- a/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_enum_values_registry.cpp @@ -13,7 +13,7 @@ namespace Catch { - IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {} + IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default; namespace Detail { @@ -21,7 +21,7 @@ namespace Catch { // Extracts the actual name part of an enum instance // In other words, it returns the Blue part of Bikeshed::Colour::Blue StringRef extractInstanceName(StringRef enumInstance) { - // Find last occurence of ":" + // Find last occurrence of ":" size_t name_start = enumInstance.size(); while (name_start > 0 && enumInstance[name_start - 1] != ':') { --name_start; diff --git a/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp b/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp index 084838894e5697b7738d8df0fd5cc7716d7d975d..acddea6ec99d796d699c01892bfcf34498f44891 100644 --- a/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.cpp @@ -9,39 +9,45 @@ #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_enforce.hpp> #include <catch2/internal/catch_test_failure_exception.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() { } - void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator ) { - m_translators.push_back( Detail::unique_ptr<const IExceptionTranslator>( translator ) ); + void ExceptionTranslatorRegistry::registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) { + m_translators.push_back( CATCH_MOVE( translator ) ); } #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) std::string ExceptionTranslatorRegistry::translateActiveException() const { + // Compiling a mixed mode project with MSVC means that CLR + // exceptions will be caught in (...) as well. However, these do + // do not fill-in std::current_exception and thus lead to crash + // when attempting rethrow. + // /EHa switch also causes structured exceptions to be caught + // here, but they fill-in current_exception properly, so + // at worst the output should be a little weird, instead of + // causing a crash. + if ( std::current_exception() == nullptr ) { + return "Non C++ exception. Possibly a CLR exception."; + } + + // First we try user-registered translators. If none of them can + // handle the exception, it will be rethrown handled by our defaults. try { - // Compiling a mixed mode project with MSVC means that CLR - // exceptions will be caught in (...) as well. However, these - // do not fill-in std::current_exception and thus lead to crash - // when attempting rethrow. - // /EHa switch also causes structured exceptions to be caught - // here, but they fill-in current_exception properly, so - // at worst the output should be a little weird, instead of - // causing a crash. - if (std::current_exception() == nullptr) { - return "Non C++ exception. Possibly a CLR exception."; - } return tryTranslators(); } + // To avoid having to handle TFE explicitly everywhere, we just + // rethrow it so that it goes back up the caller. catch( TestFailureException& ) { std::rethrow_exception(std::current_exception()); } - catch( std::exception& ex ) { + catch( std::exception const& ex ) { return ex.what(); } - catch( std::string& msg ) { + catch( std::string const& msg ) { return msg; } catch( const char* msg ) { diff --git a/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.hpp b/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.hpp index f4a28d91acfcabdfe21ed76c0dc235db0c49e0a8..465796d35b8aecf61908480f561285fa1fc78131 100644 --- a/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_exception_translator_registry.hpp @@ -9,6 +9,8 @@ #define CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED #include <catch2/interfaces/catch_interfaces_exception.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> + #include <vector> #include <string> @@ -16,8 +18,8 @@ namespace Catch { class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry { public: - ~ExceptionTranslatorRegistry(); - virtual void registerTranslator( const IExceptionTranslator* translator ); + ~ExceptionTranslatorRegistry() override; + void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ); std::string translateActiveException() const override; std::string tryTranslators() const; diff --git a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp index 1b1e5c7fd2bd1c4e61fd736ca757290bf6fbf943..9383257cecb51fc2e5762b94fc1f24df607292e8 100644 --- a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp +++ b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.cpp @@ -5,30 +5,73 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 + +/** \file + * This file provides platform specific implementations of FatalConditionHandler + * + * This means that there is a lot of conditional compilation, and platform + * specific code. Currently, Catch2 supports a dummy handler (if no + * handler is desired), and 2 platform specific handlers: + * * Windows' SEH + * * POSIX signals + * + * Consequently, various pieces of code below are compiled if either of + * the platform specific handlers is enabled, or if none of them are + * enabled. It is assumed that both cannot be enabled at the same time, + * and doing so should cause a compilation error. + * + * If another platform specific handler is added, the compile guards + * below will need to be updated taking these assumptions into account. + */ + #include <catch2/internal/catch_fatal_condition_handler.hpp> #include <catch2/internal/catch_context.hpp> +#include <catch2/internal/catch_enforce.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> +#include <catch2/internal/catch_windows_h_proxy.hpp> -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#endif +#include <algorithm> + +#if !defined( CATCH_CONFIG_WINDOWS_SEH ) && !defined( CATCH_CONFIG_POSIX_SIGNALS ) + +namespace Catch { + + // If neither SEH nor signal handling is required, the handler impls + // do not have to do anything, and can be empty. + void FatalConditionHandler::engage_platform() {} + void FatalConditionHandler::disengage_platform() {} + FatalConditionHandler::FatalConditionHandler() = default; + FatalConditionHandler::~FatalConditionHandler() = default; + +} // end namespace Catch + +#endif // !CATCH_CONFIG_WINDOWS_SEH && !CATCH_CONFIG_POSIX_SIGNALS + +#if defined( CATCH_CONFIG_WINDOWS_SEH ) && defined( CATCH_CONFIG_POSIX_SIGNALS ) +#error "Inconsistent configuration: Windows' SEH handling and POSIX signals cannot be enabled at the same time" +#endif // CATCH_CONFIG_WINDOWS_SEH && CATCH_CONFIG_POSIX_SIGNALS #if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS ) namespace { - // Report the error condition + //! Signals fatal error message to the run context void reportFatal( char const * const message ) { Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message ); } -} -#endif // signals/SEH handling + //! Minimal size Catch2 needs for its own fatal error handling. + //! Picked empirically, so it might not be sufficient on all + //! platforms, and for all configurations. + constexpr std::size_t minStackSizeForErrors = 32 * 1024; +} // end unnamed namespace + +#endif // CATCH_CONFIG_WINDOWS_SEH || CATCH_CONFIG_POSIX_SIGNALS #if defined( CATCH_CONFIG_WINDOWS_SEH ) namespace Catch { + struct SignalDefs { DWORD id; const char* name; }; // There is no 1-1 mapping between signals and windows exceptions. @@ -41,7 +84,7 @@ namespace Catch { { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" }, }; - LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { + static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { for (auto const& def : signalDefs) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) { reportFatal(def.name); @@ -52,35 +95,52 @@ namespace Catch { return EXCEPTION_CONTINUE_SEARCH; } + // Since we do not support multiple instantiations, we put these + // into global variables and rely on cleaning them up in outlined + // constructors/destructors + static PVOID exceptionHandlerHandle = nullptr; + + + // For MSVC, we reserve part of the stack memory for handling + // memory overflow structured exception. FatalConditionHandler::FatalConditionHandler() { - isSet = true; - // 32k seems enough for Catch to handle stack overflow, - // but the value was found experimentally, so there is no strong guarantee - guaranteeSize = 32 * 1024; - exceptionHandlerHandle = nullptr; + ULONG guaranteeSize = static_cast<ULONG>(minStackSizeForErrors); + if (!SetThreadStackGuarantee(&guaranteeSize)) { + // We do not want to fully error out, because needing + // the stack reserve should be rare enough anyway. + Catch::cerr() + << "Failed to reserve piece of stack." + << " Stack overflows will not be reported successfully."; + } + } + + // We do not attempt to unset the stack guarantee, because + // Windows does not support lowering the stack size guarantee. + FatalConditionHandler::~FatalConditionHandler() = default; + + + void FatalConditionHandler::engage_platform() { // Register as first handler in current chain exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); - // Pass in guarantee size to be filled - SetThreadStackGuarantee(&guaranteeSize); + if (!exceptionHandlerHandle) { + CATCH_RUNTIME_ERROR("Could not register vectored exception handler"); + } } - void FatalConditionHandler::reset() { - if (isSet) { - RemoveVectoredExceptionHandler(exceptionHandlerHandle); - SetThreadStackGuarantee(&guaranteeSize); - exceptionHandlerHandle = nullptr; - isSet = false; + void FatalConditionHandler::disengage_platform() { + if (!RemoveVectoredExceptionHandler(exceptionHandlerHandle)) { + CATCH_RUNTIME_ERROR("Could not unregister vectored exception handler"); } + exceptionHandlerHandle = nullptr; } -bool FatalConditionHandler::isSet = false; -ULONG FatalConditionHandler::guaranteeSize = 0; -PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr; +} // end namespace Catch +#endif // CATCH_CONFIG_WINDOWS_SEH -} // namespace Catch +#if defined( CATCH_CONFIG_POSIX_SIGNALS ) -#elif defined( CATCH_CONFIG_POSIX_SIGNALS ) +#include <signal.h> namespace Catch { @@ -89,10 +149,6 @@ namespace Catch { const char* name; }; - // 32kb for the alternate stack seems to be sufficient. However, this value - // is experimentally determined, so that's not guaranteed. - static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; - static SignalDefs signalDefs[] = { { SIGINT, "SIGINT - Terminal interrupt signal" }, { SIGILL, "SIGILL - Illegal instruction signal" }, @@ -102,8 +158,32 @@ namespace Catch { { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" } }; +// Older GCCs trigger -Wmissing-field-initializers for T foo = {} +// which is zero initialization, but not explicit. We want to avoid +// that. +#if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + + static char* altStackMem = nullptr; + static std::size_t altStackSize = 0; + static stack_t oldSigStack{}; + static struct sigaction oldSigActions[sizeof(signalDefs) / sizeof(SignalDefs)]{}; + + static void restorePreviousSignalHandlers() { + // We set signal handlers back to the previous ones. Hopefully + // nobody overwrote them in the meantime, and doesn't expect + // their signal handlers to live past ours given that they + // installed them after ours.. + for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { + sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); + } + // Return the old stack + sigaltstack(&oldSigStack, nullptr); + } - void FatalConditionHandler::handleSignal( int sig ) { + static void handleSignal( int sig ) { char const * name = "<unknown signal>"; for (auto const& def : signalDefs) { if (sig == def.id) { @@ -111,16 +191,33 @@ namespace Catch { break; } } - reset(); - reportFatal(name); + // We need to restore previous signal handlers and let them do + // their thing, so that the users can have the debugger break + // when a signal is raised, and so on. + restorePreviousSignalHandlers(); + reportFatal( name ); raise( sig ); } FatalConditionHandler::FatalConditionHandler() { - isSet = true; + assert(!altStackMem && "Cannot initialize POSIX signal handler when one already exists"); + if (altStackSize == 0) { + altStackSize = std::max(static_cast<size_t>(SIGSTKSZ), minStackSizeForErrors); + } + altStackMem = new char[altStackSize](); + } + + FatalConditionHandler::~FatalConditionHandler() { + delete[] altStackMem; + // We signal that another instance can be constructed by zeroing + // out the pointer. + altStackMem = nullptr; + } + + void FatalConditionHandler::engage_platform() { stack_t sigStack; sigStack.ss_sp = altStackMem; - sigStack.ss_size = sigStackSize; + sigStack.ss_size = altStackSize; sigStack.ss_flags = 0; sigaltstack(&sigStack, &oldSigStack); struct sigaction sa = { }; @@ -132,28 +229,15 @@ namespace Catch { } } - void FatalConditionHandler::reset() { - if( isSet ) { - // Set signals back to previous values -- hopefully nobody overwrote them in the meantime - for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) { - sigaction(signalDefs[i].id, &oldSigActions[i], nullptr); - } - // Return the old stack - sigaltstack(&oldSigStack, nullptr); - isSet = false; - } - } - - bool FatalConditionHandler::isSet = false; - struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; - stack_t FatalConditionHandler::oldSigStack = {}; - char FatalConditionHandler::altStackMem[sigStackSize] = {}; +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif -} // namespace Catch + void FatalConditionHandler::disengage_platform() { + restorePreviousSignalHandlers(); + } -#endif // signals/SEH handling +} // end namespace Catch -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif +#endif // CATCH_CONFIG_POSIX_SIGNALS diff --git a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp index 1b23c0b88fe70599fa1c581012ccd9488d7ad6e3..4a2818cb567b4c427bc224e945a8509db06fc0bd 100644 --- a/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp +++ b/packages/Catch2/src/catch2/internal/catch_fatal_condition_handler.hpp @@ -10,57 +10,60 @@ #include <catch2/internal/catch_platform.hpp> #include <catch2/internal/catch_compiler_capabilities.hpp> -#include <catch2/internal/catch_windows_h_proxy.hpp> - -#if defined( CATCH_CONFIG_WINDOWS_SEH ) +#include <cassert> namespace Catch { - struct FatalConditionHandler { - - static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo); + /** + * Wrapper for platform-specific fatal error (signals/SEH) handlers + * + * Tries to be cooperative with other handlers, and not step over + * other handlers. This means that unknown structured exceptions + * are passed on, previous signal handlers are called, and so on. + * + * Can only be instantiated once, and assumes that once a signal + * is caught, the binary will end up terminating. Thus, there + */ + class FatalConditionHandler { + bool m_started = false; + + // Install/disengage implementation for specific platform. + // Should be if-defed to work on current platform, can assume + // engage-disengage 1:1 pairing. + void engage_platform(); + void disengage_platform(); + public: + // Should also have platform-specific implementations as needed FatalConditionHandler(); - static void reset(); - ~FatalConditionHandler() { reset(); } - - private: - static bool isSet; - static ULONG guaranteeSize; - static PVOID exceptionHandlerHandle; + ~FatalConditionHandler(); + + void engage() { + assert(!m_started && "Handler cannot be installed twice."); + m_started = true; + engage_platform(); + } + + void disengage() { + assert(m_started && "Handler cannot be uninstalled without being installed first"); + m_started = false; + disengage_platform(); + } }; -} // namespace Catch - -#elif defined ( CATCH_CONFIG_POSIX_SIGNALS ) - -#include <signal.h> - -namespace Catch { - - struct FatalConditionHandler { - - static bool isSet; - static struct sigaction oldSigActions[]; - static stack_t oldSigStack; - static char altStackMem[]; - - static void handleSignal( int sig ); - - FatalConditionHandler(); - ~FatalConditionHandler() { reset(); } - static void reset(); + //! Simple RAII guard for (dis)engaging the FatalConditionHandler + class FatalConditionHandlerGuard { + FatalConditionHandler* m_handler; + public: + FatalConditionHandlerGuard(FatalConditionHandler* handler): + m_handler(handler) { + m_handler->engage(); + } + ~FatalConditionHandlerGuard() { + m_handler->disengage(); + } }; -} // namespace Catch - - -#else - -namespace Catch { - struct FatalConditionHandler {}; -} - -#endif +} // end namespace Catch #endif // CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55a95a2846740c9bd87a479e0b65a6a1ec6adb7c --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.cpp @@ -0,0 +1,32 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#include <catch2/internal/catch_floating_point_helpers.hpp> + +#include <cstring> + +namespace Catch { + namespace Detail { + + uint32_t convertToBits(float f) { + static_assert(sizeof(float) == sizeof(uint32_t), "Important ULP matcher assumption violated"); + uint32_t i; + std::memcpy(&i, &f, sizeof(f)); + return i; + } + + uint64_t convertToBits(double d) { + static_assert(sizeof(double) == sizeof(uint64_t), "Important ULP matcher assumption violated"); + uint64_t i; + std::memcpy(&i, &d, sizeof(d)); + return i; + } + + } // end namespace Detail +} // end namespace Catch + diff --git a/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3e73b3a72314a1e7bb8b8ad2b42ba24ed2cb6d27 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_floating_point_helpers.hpp @@ -0,0 +1,88 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED +#define CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED + +#include <catch2/internal/catch_polyfills.hpp> + +#include <cmath> +#include <cstdint> +#include <utility> +#include <limits> + +namespace Catch { + namespace Detail { + + uint32_t convertToBits(float f); + uint64_t convertToBits(double d); + + } // end namespace Detail + + + /** + * Calculates the ULP distance between two floating point numbers + * + * The ULP distance of two floating point numbers is the count of + * valid floating point numbers representable between them. + * + * There are some exceptions between how this function counts the + * distance, and the interpretation of the standard as implemented. + * by e.g. `nextafter`. For this function it always holds that: + * * `(x == y) => ulpDistance(x, y) == 0` (so `ulpDistance(-0, 0) == 0`) + * * `ulpDistance(maxFinite, INF) == 1` + * * `ulpDistance(x, -x) == 2 * ulpDistance(x, 0)` + * + * \pre `!isnan( lhs )` + * \pre `!isnan( rhs )` + * \pre floating point numbers are represented in IEEE-754 format + */ + template <typename FP> + uint64_t ulpDistance( FP lhs, FP rhs ) { + assert( std::numeric_limits<FP>::is_iec559 && + "ulpDistance assumes IEEE-754 format for floating point types" ); + assert( !Catch::isnan( lhs ) && + "Distance between NaN and number is not meaningful" ); + assert( !Catch::isnan( rhs ) && + "Distance between NaN and number is not meaningful" ); + + // We want X == Y to imply 0 ULP distance even if X and Y aren't + // bit-equal (-0 and 0), or X - Y != 0 (same sign infinities). + if ( lhs == rhs ) { return 0; } + + // We need a properly typed positive zero for type inference. + static constexpr FP positive_zero{}; + + // We want to ensure that +/- 0 is always represented as positive zero + if ( lhs == positive_zero ) { lhs = positive_zero; } + if ( rhs == positive_zero ) { rhs = positive_zero; } + + // If arguments have different signs, we can handle them by summing + // how far are they from 0 each. + if ( std::signbit( lhs ) != std::signbit( rhs ) ) { + return ulpDistance( std::abs( lhs ), positive_zero ) + + ulpDistance( std::abs( rhs ), positive_zero ); + } + + // When both lhs and rhs are of the same sign, we can just + // read the numbers bitwise as integers, and then subtract them + // (assuming IEEE). + uint64_t lc = Detail::convertToBits( lhs ); + uint64_t rc = Detail::convertToBits( rhs ); + + // The ulp distance between two numbers is symmetric, so to avoid + // dealing with overflows we want the bigger converted number on the lhs + if ( lc < rc ) { + std::swap( lc, rc ); + } + + return lc - rc; + } + +} // end namespace Catch + +#endif // CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_list.cpp b/packages/Catch2/src/catch2/internal/catch_list.cpp index d7969096e372330580a23c482d158be9e690067a..20613c70798b6e3f0e08cd4bfd58e1374a13f205 100644 --- a/packages/Catch2/src/catch2/internal/catch_list.cpp +++ b/packages/Catch2/src/catch2/internal/catch_list.cpp @@ -12,6 +12,7 @@ #include <catch2/interfaces/catch_interfaces_reporter_registry.hpp> #include <catch2/interfaces/catch_interfaces_testcase.hpp> #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <catch2/internal/catch_context.hpp> #include <catch2/catch_config.hpp> @@ -43,7 +44,7 @@ namespace Catch { std::vector<TagInfo> infos; infos.reserve(tagCounts.size()); for (auto& tagc : tagCounts) { - infos.push_back(std::move(tagc.second)); + infos.push_back(CATCH_MOVE(tagc.second)); } reporter.listTags(infos); diff --git a/packages/Catch2/src/catch2/internal/catch_main.cpp b/packages/Catch2/src/catch2/internal/catch_main.cpp index 940ac3bc2d46ba9db03e39ce201364050c3ac434..ed89ab6eed5ca2564faac97d76eee23a7f51767f 100644 --- a/packages/Catch2/src/catch2/internal/catch_main.cpp +++ b/packages/Catch2/src/catch2/internal/catch_main.cpp @@ -20,7 +20,7 @@ namespace Catch { #if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN) // Standard C/C++ Win32 Unicode wmain entry point -extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) { +extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) { #else // Standard C/C++ main entry point int main (int argc, char * argv[]) { diff --git a/packages/Catch2/src/catch2/internal/catch_message_info.hpp b/packages/Catch2/src/catch2/internal/catch_message_info.hpp index 0c3076eae0069dcbe9d28f30fdcaa598996c17b9..ecd78cabf8b9a95780c5fa7a5cee214d34fd6f56 100644 --- a/packages/Catch2/src/catch2/internal/catch_message_info.hpp +++ b/packages/Catch2/src/catch2/internal/catch_message_info.hpp @@ -17,7 +17,7 @@ namespace Catch { struct MessageInfo { - MessageInfo( StringRef const& _macroName, + MessageInfo( StringRef _macroName, SourceLineInfo const& _lineInfo, ResultWas::OfType _type ); diff --git a/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp b/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp new file mode 100644 index 0000000000000000000000000000000000000000..70520308f1a61459c55ba4b8e1463ce1f217eb25 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_move_and_forward.hpp @@ -0,0 +1,19 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_MOVE_AND_FORWARD_HPP_INCLUDED +#define CATCH_MOVE_AND_FORWARD_HPP_INCLUDED + +#include <type_traits> + +//! TODO: replaces std::move for better performance +#define CATCH_MOVE(...) static_cast<std::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__) + +#define CATCH_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__) + +#endif // CATCH_MOVE_AND_FORWARD_HPP_INCLUDED + \ No newline at end of file diff --git a/packages/Catch2/src/catch2/internal/catch_platform.hpp b/packages/Catch2/src/catch2/internal/catch_platform.hpp index 537abce5205c726018831802c8551b196c863b29..8ecf01ad296f1115d18574cfad5b5963a69c80bc 100644 --- a/packages/Catch2/src/catch2/internal/catch_platform.hpp +++ b/packages/Catch2/src/catch2/internal/catch_platform.hpp @@ -8,13 +8,16 @@ #ifndef CATCH_PLATFORM_HPP_INCLUDED #define CATCH_PLATFORM_HPP_INCLUDED +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html #ifdef __APPLE__ -# include <TargetConditionals.h> -# if TARGET_OS_OSX == 1 -# define CATCH_PLATFORM_MAC -# elif TARGET_OS_IPHONE == 1 -# define CATCH_PLATFORM_IPHONE -# endif +# include <TargetConditionals.h> +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif #elif defined(linux) || defined(__linux) || defined(__linux__) # define CATCH_PLATFORM_LINUX diff --git a/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp b/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp index 372a0e3776760a2a714b56a8f4310424013a1b24..ee92ad7de024de325109a43cfbe8534e4533a43d 100644 --- a/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_reporter_registry.cpp @@ -16,6 +16,7 @@ #include <catch2/reporters/catch_reporter_tap.hpp> #include <catch2/reporters/catch_reporter_teamcity.hpp> #include <catch2/reporters/catch_reporter_xml.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { @@ -43,10 +44,10 @@ namespace Catch { } void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) { - m_factories.emplace(name, std::move(factory)); + m_factories.emplace(name, CATCH_MOVE(factory)); } void ReporterRegistry::registerListener( IReporterFactoryPtr factory ) { - m_listeners.push_back( std::move(factory) ); + m_listeners.push_back( CATCH_MOVE(factory) ); } IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const { diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.cpp b/packages/Catch2/src/catch2/internal/catch_run_context.cpp index 8379a7aa02ff2a0e3ce97366c0d105a0e1b48f70..b8e74e5f35885e003737e11709cefb22780fb453 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.cpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.cpp @@ -50,7 +50,7 @@ namespace Catch { // without it, the code above creates 5 nested generators. if ( currentTracker.nameAndLocation() == nameAndLocation ) { auto thisTracker = - currentTracker.parent().findChild( nameAndLocation ); + currentTracker.parent()->findChild( nameAndLocation ); assert( thisTracker ); assert( thisTracker->isGeneratorTracker() ); tracker = static_cast<GeneratorTracker*>( thisTracker ); @@ -64,7 +64,7 @@ namespace Catch { Catch::Detail::make_unique<GeneratorTracker>( nameAndLocation, ctx, ¤tTracker ); tracker = newTracker.get(); - currentTracker.addChild( std::move(newTracker) ); + currentTracker.addChild( CATCH_MOVE(newTracker) ); } if( !tracker->isComplete() ) { @@ -110,7 +110,7 @@ namespace Catch { // This is safe: there is always at least one section // tracker in a test case tracking tree while ( !parent->isSectionTracker() ) { - parent = &( parent->parent() ); + parent = parent->parent(); } assert( parent && "Missing root (test case) level section" ); @@ -153,21 +153,20 @@ namespace Catch { return m_generator; } void setGenerator( GeneratorBasePtr&& generator ) override { - m_generator = std::move( generator ); + m_generator = CATCH_MOVE( generator ); } }; - GeneratorTracker::~GeneratorTracker() {} + GeneratorTracker::~GeneratorTracker() = default; } RunContext::RunContext(IConfig const* _config, IStreamingReporterPtr&& reporter) : m_runInfo(_config->name()), m_context(getCurrentMutableContext()), m_config(_config), - m_reporter(std::move(reporter)), + m_reporter(CATCH_MOVE(reporter)), m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal }, m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions ) { - m_context.setRunner(this); m_context.setResultCapture(this); m_reporter->testRunStarting(m_runInfo); } @@ -176,16 +175,8 @@ namespace Catch { m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting())); } - void RunContext::testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount) { - m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount)); - } - - void RunContext::testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount) { - m_reporter->testGroupEnded(TestGroupStats(GroupInfo(testSpec, groupIndex, groupsCount), totals, aborting())); - } - Totals RunContext::runTest(TestCaseHandle const& testCase) { - Totals prevTotals = m_totals; + const Totals prevTotals = m_totals; std::string redirectedCout; std::string redirectedCerr; @@ -200,10 +191,25 @@ namespace Catch { ITracker& rootTracker = m_trackerContext.startRun(); assert(rootTracker.isSectionTracker()); static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun()); + + uint64_t testRuns = 0; do { m_trackerContext.startCycle(); m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo)); - runCurrentTest(redirectedCout, redirectedCerr); + + m_reporter->testCasePartialStarting(testInfo, testRuns); + + const auto beforeRunTotals = m_totals; + std::string oneRunCout, oneRunCerr; + runCurrentTest(oneRunCout, oneRunCerr); + redirectedCout += oneRunCout; + redirectedCerr += oneRunCerr; + + const auto singleRunTotals = m_totals.delta(beforeRunTotals); + auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, redirectedCout, oneRunCerr, aborting()); + + m_reporter->testCasePartialEnded(statsForOneRun, testRuns); + ++testRuns; } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting()); Totals deltaTotals = m_totals.delta(prevTotals); @@ -230,9 +236,11 @@ namespace Catch { if (result.getResultType() == ResultWas::Ok) { m_totals.assertions.passed++; m_lastAssertionPassed = true; - } else if (!result.isOk()) { + } else if (!result.succeeded()) { m_lastAssertionPassed = false; - if( m_activeTestCase->getTestCaseInfo().okToFail() ) + if (result.isOk()) { + } + else if( m_activeTestCase->getTestCaseInfo().okToFail() ) m_totals.assertions.failedButOk++; else m_totals.assertions.failed++; @@ -241,9 +249,7 @@ namespace Catch { m_lastAssertionPassed = true; } - // We have no use for the return value (whether messages should be cleared), because messages were made scoped - // and should be let to clear themselves out. - static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); + m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)); if (result.getResultType() != ResultWas::Warning) m_messageScopes.clear(); @@ -315,7 +321,7 @@ namespace Catch { m_unfinishedSections.push_back(endInfo); } - void RunContext::benchmarkPreparing(std::string const& name) { + void RunContext::benchmarkPreparing( StringRef name ) { m_reporter->benchmarkPreparing(name); } void RunContext::benchmarkStarting( BenchmarkInfo const& info ) { @@ -324,8 +330,8 @@ namespace Catch { void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) { m_reporter->benchmarkEnded( stats ); } - void RunContext::benchmarkFailed(std::string const & error) { - m_reporter->benchmarkFailed(error); + void RunContext::benchmarkFailed( StringRef error ) { + m_reporter->benchmarkFailed( error ); } void RunContext::pushScopedMessage(MessageInfo const & message) { @@ -388,7 +394,6 @@ namespace Catch { std::string(), false)); m_totals.testCases.failed++; - testGroupEnded(std::string(), m_totals, 1, 1); m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false)); } @@ -459,10 +464,10 @@ namespace Catch { } void RunContext::invokeActiveTestCase() { - // We need to register a handler for signals/structured exceptions + // We need to engage a handler for signals/structured exceptions // before running the tests themselves, or the binary can crash // without failed test being reported. - FatalConditionHandler _; + FatalConditionHandlerGuard _(&m_fatalConditionhandler); m_activeTestCase->invoke(); } @@ -518,7 +523,7 @@ namespace Catch { void RunContext::handleMessage( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) { m_reporter->assertionStarting( info ); diff --git a/packages/Catch2/src/catch2/internal/catch_run_context.hpp b/packages/Catch2/src/catch2/internal/catch_run_context.hpp index 24e0c99a3ebef042bea6c5f0f20f7c82b1ec605f..7c315e9acc830648f3bc2cd5152629c941e200dc 100644 --- a/packages/Catch2/src/catch2/internal/catch_run_context.hpp +++ b/packages/Catch2/src/catch2/internal/catch_run_context.hpp @@ -8,9 +8,9 @@ #ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED #define CATCH_RUN_CONTEXT_HPP_INCLUDED -#include <catch2/interfaces/catch_interfaces_runner.hpp> #include <catch2/interfaces/catch_interfaces_reporter.hpp> #include <catch2/internal/catch_test_registry.hpp> +#include <catch2/internal/catch_fatal_condition_handler.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/catch_message.hpp> #include <catch2/catch_totals.hpp> @@ -18,6 +18,7 @@ #include <catch2/catch_assertion_info.hpp> #include <catch2/catch_assertion_result.hpp> #include <catch2/internal/catch_option.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <string> @@ -29,7 +30,7 @@ namespace Catch { /////////////////////////////////////////////////////////////////////////// - class RunContext : public IResultCapture, public IRunner { + class RunContext : public IResultCapture { public: RunContext( RunContext const& ) = delete; @@ -39,9 +40,6 @@ namespace Catch { ~RunContext() override; - void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ); - void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ); - Totals runTest(TestCaseHandle const& testCase); public: // IResultCapture @@ -54,7 +52,7 @@ namespace Catch { void handleMessage ( AssertionInfo const& info, ResultWas::OfType resultType, - StringRef const& message, + StringRef message, AssertionReaction& reaction ) override; void handleUnexpectedExceptionNotThrown ( AssertionInfo const& info, @@ -77,10 +75,10 @@ namespace Catch { auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override; - void benchmarkPreparing( std::string const& name ) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& info ) override; void benchmarkEnded( BenchmarkStats<> const& stats ) override; - void benchmarkFailed( std::string const& error ) override; + void benchmarkFailed( StringRef error ) override; void pushScopedMessage( MessageInfo const& message ) override; void popScopedMessage( MessageInfo const& message ) override; @@ -101,7 +99,7 @@ namespace Catch { public: // !TBD We need to do this another way! - bool aborting() const override; + bool aborting() const; private: @@ -139,6 +137,7 @@ namespace Catch { std::vector<SectionEndInfo> m_unfinishedSections; std::vector<ITracker*> m_activeSections; TrackerContext m_trackerContext; + FatalConditionHandler m_fatalConditionhandler; bool m_lastAssertionPassed = false; bool m_shouldReportUnexpected = true; bool m_includeSuccessfulResults; diff --git a/packages/Catch2/src/catch2/internal/catch_section.cpp b/packages/Catch2/src/catch2/internal/catch_section.cpp index 6c13c7dd77094908796d9a11a197606a02e11ae0..8f37e27491545c00ef7cd5da9aaf1935ec5b765e 100644 --- a/packages/Catch2/src/catch2/internal/catch_section.cpp +++ b/packages/Catch2/src/catch2/internal/catch_section.cpp @@ -6,15 +6,14 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/internal/catch_section.hpp> -#include <catch2/internal/catch_test_macro_impl.hpp> +#include <catch2/internal/catch_run_context.hpp> #include <catch2/internal/catch_uncaught_exceptions.hpp> - -#include <utility> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { Section::Section( SectionInfo&& info ): - m_info( std::move( info ) ), + m_info( CATCH_MOVE( info ) ), m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) { // Non-"included" sections will not use the timing information diff --git a/packages/Catch2/src/catch2/internal/catch_section.hpp b/packages/Catch2/src/catch2/internal/catch_section.hpp index 36d900bbeb094bb906da78b467afb755e3aaf751..2e72923c3a1a267752a5b4d6f77565d20a2d6863 100644 --- a/packages/Catch2/src/catch2/internal/catch_section.hpp +++ b/packages/Catch2/src/catch2/internal/catch_section.hpp @@ -13,8 +13,7 @@ #include <catch2/catch_section_info.hpp> #include <catch2/catch_timer.hpp> #include <catch2/catch_totals.hpp> - -#include <string> +#include <catch2/internal/catch_unique_name.hpp> namespace Catch { diff --git a/packages/Catch2/src/catch2/internal/catch_singletons.cpp b/packages/Catch2/src/catch2/internal/catch_singletons.cpp index 36e0e7bdae1ea69951907a89d32974432e8e37a8..116fce4698630727876b03af314f71ae1c268c09 100644 --- a/packages/Catch2/src/catch2/internal/catch_singletons.cpp +++ b/packages/Catch2/src/catch2/internal/catch_singletons.cpp @@ -20,7 +20,7 @@ namespace Catch { } } - ISingleton::~ISingleton() {} + ISingleton::~ISingleton() = default; void addSingleton(ISingleton* singleton ) { getSingletons()->push_back( singleton ); diff --git a/packages/Catch2/src/catch2/internal/catch_singletons.hpp b/packages/Catch2/src/catch2/internal/catch_singletons.hpp index 0a7f7cccb4974bcb3c6777fdbacd44a0cefd174f..d06d224487eff160b5d30d8c7385381b3b255ef1 100644 --- a/packages/Catch2/src/catch2/internal/catch_singletons.hpp +++ b/packages/Catch2/src/catch2/internal/catch_singletons.hpp @@ -11,7 +11,7 @@ namespace Catch { struct ISingleton { - virtual ~ISingleton(); + virtual ~ISingleton(); // = default }; diff --git a/packages/Catch2/src/catch2/internal/catch_source_line_info.hpp b/packages/Catch2/src/catch2/internal/catch_source_line_info.hpp index 8aca4867396e7f22d288d1600eb43cfd3fd742cb..c6b98195e1e4a4bb46ec36da9c6856a832fd2cb6 100644 --- a/packages/Catch2/src/catch2/internal/catch_source_line_info.hpp +++ b/packages/Catch2/src/catch2/internal/catch_source_line_info.hpp @@ -8,23 +8,9 @@ #ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED #define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED -#include <catch2/internal/catch_config_counter.hpp> - #include <cstddef> #include <iosfwd> -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) -#ifdef CATCH_CONFIG_COUNTER -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) -#else -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) -#endif - -// We need a dummy global operator<< so we can bring it into Catch namespace later -struct Catch_global_namespace_dummy {}; -std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); - namespace Catch { struct SourceLineInfo { @@ -43,12 +29,6 @@ namespace Catch { friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info); }; - - - // Bring in operator<< from global namespace into Catch namespace - // This is necessary because the overload of operator<< above makes - // lookup stop at namespace Catch - using ::operator<<; } #define CATCH_INTERNAL_LINEINFO \ diff --git a/packages/Catch2/src/catch2/internal/catch_stream.cpp b/packages/Catch2/src/catch2/internal/catch_stream.cpp index 3014256de3d09ff195c7c38296dfd1bea4a20ef0..9890ae3a5df5a8b544eb235d98aa4cfe073039c7 100644 --- a/packages/Catch2/src/catch2/internal/catch_stream.cpp +++ b/packages/Catch2/src/catch2/internal/catch_stream.cpp @@ -64,8 +64,10 @@ namespace Detail { struct OutputDebugWriter { - void operator()( std::string const&str ) { - writeToDebugConsole( str ); + void operator()( std::string const& str ) { + if ( !str.empty() ) { + writeToDebugConsole( str ); + } } }; @@ -74,7 +76,7 @@ namespace Detail { class FileStream : public IStream { mutable std::ofstream m_ofs; public: - FileStream( StringRef filename ) { + FileStream( std::string const& filename ) { m_ofs.open( filename.c_str() ); CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" ); } @@ -121,17 +123,17 @@ namespace Detail { /////////////////////////////////////////////////////////////////////////// - auto makeStream( StringRef const &filename ) -> IStream const* { + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream const> { if( filename.empty() ) - return new Detail::CoutStream(); + return Detail::make_unique<Detail::CoutStream>(); else if( filename[0] == '%' ) { if( filename == "%debug" ) - return new Detail::DebugOutStream(); + return Detail::make_unique<Detail::DebugOutStream>(); else CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); } else - return new Detail::FileStream( filename ); + return Detail::make_unique<Detail::FileStream>( filename ); } @@ -143,7 +145,7 @@ namespace Detail { auto add() -> std::size_t { if( m_unused.empty() ) { - m_streams.push_back( Detail::unique_ptr<std::ostringstream>( new std::ostringstream ) ); + m_streams.push_back( Detail::make_unique<std::ostringstream>() ); return m_streams.size()-1; } else { diff --git a/packages/Catch2/src/catch2/internal/catch_stream.hpp b/packages/Catch2/src/catch2/internal/catch_stream.hpp index 5f24fc38df285f583aa1ee12fbc6e120cd3a5719..39a4c0c8cd7de0abbc3ac1493019341caaa2f3b7 100644 --- a/packages/Catch2/src/catch2/internal/catch_stream.hpp +++ b/packages/Catch2/src/catch2/internal/catch_stream.hpp @@ -9,10 +9,12 @@ #define CATCH_STREAM_HPP_INCLUDED #include <catch2/internal/catch_noncopyable.hpp> +#include <catch2/internal/catch_unique_ptr.hpp> #include <iosfwd> #include <cstddef> #include <ostream> +#include <string> namespace Catch { @@ -20,14 +22,12 @@ namespace Catch { std::ostream& cerr(); std::ostream& clog(); - class StringRef; - struct IStream { - virtual ~IStream(); + virtual ~IStream(); // = default virtual std::ostream& stream() const = 0; }; - auto makeStream( StringRef const &filename ) -> IStream const*; + auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream const>; class ReusableStringStream : Detail::NonCopyable { std::size_t m_index; diff --git a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp index df6b6c3485be8f4d6f5366a49e838945cafcd9e9..0444cd38ed6b958051b60953629d65c2bb0533c1 100644 --- a/packages/Catch2/src/catch2/internal/catch_string_manip.cpp +++ b/packages/Catch2/src/catch2/internal/catch_string_manip.cpp @@ -94,11 +94,6 @@ namespace Catch { return subStrings; } - pluralise::pluralise( std::size_t count, std::string const& label ) - : m_count( count ), - m_label( label ) - {} - std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) { os << pluraliser.m_count << ' ' << pluraliser.m_label; if( pluraliser.m_count != 1 ) diff --git a/packages/Catch2/src/catch2/internal/catch_string_manip.hpp b/packages/Catch2/src/catch2/internal/catch_string_manip.hpp index d4a2fbafe5c18818017408e19bfbc32c5db24f62..bd7d0ddf40fa4a0cc3f3af5e54303120faaad5f6 100644 --- a/packages/Catch2/src/catch2/internal/catch_string_manip.hpp +++ b/packages/Catch2/src/catch2/internal/catch_string_manip.hpp @@ -32,13 +32,26 @@ namespace Catch { std::vector<StringRef> splitStringRef( StringRef str, char delimiter ); bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ); + /** + * Helper for streaming a "count [maybe-plural-of-label]" human-friendly string + * + * Usage example: + * ```cpp + * std::cout << "Found " << pluralise(count, "error") << '\n'; + * ``` + * + * **Important:** The provided string must outlive the instance + */ struct pluralise { - pluralise( std::size_t count, std::string const& label ); + pluralise(std::size_t count, StringRef label): + m_count(count), + m_label(label) + {} friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ); std::size_t m_count; - std::string m_label; + StringRef m_label; }; } diff --git a/packages/Catch2/src/catch2/internal/catch_stringref.cpp b/packages/Catch2/src/catch2/internal/catch_stringref.cpp index a318857cadd6ab14f7220c0e5bc1991ddd8836ae..36a6d2466d83845ce44e8e57823216d607b832fe 100644 --- a/packages/Catch2/src/catch2/internal/catch_stringref.cpp +++ b/packages/Catch2/src/catch2/internal/catch_stringref.cpp @@ -5,7 +5,6 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include <catch2/internal/catch_enforce.hpp> #include <catch2/internal/catch_stringref.hpp> #include <algorithm> @@ -18,11 +17,6 @@ namespace Catch { : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) ) {} - auto StringRef::c_str() const -> char const* { - CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance"); - return m_start; - } - auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool { return m_size == other.m_size && (std::memcmp( m_start, other.m_start, m_size ) == 0); diff --git a/packages/Catch2/src/catch2/internal/catch_stringref.hpp b/packages/Catch2/src/catch2/internal/catch_stringref.hpp index 33b35ef6c682e65daffc78d1d65559db506c7aea..17f5d07dab0312218743f42cf4d814421294ab89 100644 --- a/packages/Catch2/src/catch2/internal/catch_stringref.hpp +++ b/packages/Catch2/src/catch2/internal/catch_stringref.hpp @@ -69,10 +69,6 @@ namespace Catch { return m_size; } - // Returns the current start pointer. If the StringRef is not - // null-terminated, throws std::domain_exception - auto c_str() const -> char const*; - public: // substrings and searches // Returns a substring of [start, start + length). // If start + length > size(), then the substring is [start, start + size()). @@ -91,10 +87,6 @@ namespace Catch { return m_start; } - constexpr auto isNullTerminated() const noexcept -> bool { - return m_start[m_size] == '\0'; - } - public: // iterators constexpr const_iterator begin() const { return m_start; } constexpr const_iterator end() const { return m_start + m_size; } @@ -106,12 +98,12 @@ namespace Catch { }; - constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { return StringRef( rawChars, size ); } } // namespace Catch -constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { +constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { return Catch::StringRef( rawChars, size ); } diff --git a/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp b/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp index 5df3c02ba8988d2b6850bd6a41987869d86b8977..8c3e339f6761894e0d272c1f18512f534ab78457 100644 --- a/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_tag_alias_registry.cpp @@ -46,7 +46,7 @@ namespace Catch { << "\tRedefined at: " << lineInfo ); } - ITagAliasRegistry::~ITagAliasRegistry() {} + ITagAliasRegistry::~ITagAliasRegistry() = default; ITagAliasRegistry const& ITagAliasRegistry::get() { return getRegistryHub().getTagAliasRegistry(); diff --git a/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp b/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp index 3617109b3eb18fcb0c31abea5c68eaa895cf7851..1099f9db890726804aba573aac6bf99a6eb5a895 100644 --- a/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_template_test_registry.hpp @@ -12,6 +12,8 @@ #include <catch2/internal/catch_compiler_capabilities.hpp> #include <catch2/internal/catch_preprocessor.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_unique_name.hpp> + // GCC 5 and older do not properly handle disabling unused-variable warning // with a _Pragma. This means that we have to leak the suppression to the @@ -33,34 +35,34 @@ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) #endif #endif @@ -98,18 +100,18 @@ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \ @@ -148,18 +150,18 @@ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ - INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T,__VA_ARGS__) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__) #else #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\ - INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__) #else #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\ @@ -191,7 +193,7 @@ static void TestFunc() #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \ - INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, TmplList ) + INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, TmplList ) #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \ @@ -226,18 +228,18 @@ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \ - INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\ @@ -279,18 +281,18 @@ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ - INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) ) #endif #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\ - INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature, __VA_ARGS__ ) + INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature, __VA_ARGS__ ) #else #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\ - INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) ) + INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) ) #endif #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \ @@ -325,7 +327,7 @@ void TestName<TestType>::test() #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \ - INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, TmplList ) + INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, TmplList ) #endif // CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp index 7f7f101d18ad7079d1bc73b54c039eda33f20cdb..dd1744a7072f699e263ddef58f85d0dac32e8a49 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -12,9 +12,9 @@ #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> #include <catch2/internal/catch_random_number_generator.hpp> #include <catch2/internal/catch_run_context.hpp> -#include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_test_case_info.hpp> #include <catch2/catch_test_spec.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <set> @@ -22,24 +22,27 @@ namespace Catch { namespace { - struct HashTest { - explicit HashTest(SimplePcg32& rng_inst) { - basis = rng_inst(); - basis <<= 32; - basis |= rng_inst(); - } + struct TestHasher { + using hash_t = uint64_t; + + explicit TestHasher( hash_t hashSuffix ): + m_hashSuffix( hashSuffix ) {} - uint64_t basis; + uint64_t m_hashSuffix; - uint64_t operator()(TestCaseInfo const& t) const { - // Modified FNV-1a hash - static constexpr uint64_t prime = 1099511628211; - uint64_t hash = basis; + uint32_t operator()( TestCaseInfo const& t ) const { + // FNV-1a hash with multiplication fold. + const hash_t prime = 1099511628211u; + hash_t hash = 14695981039346656037u; for (const char c : t.name) { hash ^= c; hash *= prime; } - return hash; + hash ^= m_hashSuffix; + hash *= prime; + const uint32_t low{ static_cast<uint32_t>(hash) }; + const uint32_t high{ static_cast<uint32_t>(hash >> 32) }; + return low * high; } }; } // end anonymous namespace @@ -51,20 +54,36 @@ namespace { case TestRunOrder::LexicographicallySorted: { std::vector<TestCaseHandle> sorted = unsortedTestCases; - std::sort(sorted.begin(), sorted.end()); + std::sort( + sorted.begin(), + sorted.end(), + []( TestCaseHandle const& lhs, TestCaseHandle const& rhs ) { + return lhs.getTestCaseInfo() < rhs.getTestCaseInfo(); + } + ); return sorted; } case TestRunOrder::Randomized: { seedRng(config); - HashTest h(rng()); - std::vector<std::pair<uint64_t, TestCaseHandle>> indexed_tests; + using TestWithHash = std::pair<TestHasher::hash_t, TestCaseHandle>; + + TestHasher h{ config.rngSeed() }; + std::vector<TestWithHash> indexed_tests; indexed_tests.reserve(unsortedTestCases.size()); for (auto const& handle : unsortedTestCases) { indexed_tests.emplace_back(h(handle.getTestCaseInfo()), handle); } - std::sort(indexed_tests.begin(), indexed_tests.end()); + std::sort( indexed_tests.begin(), + indexed_tests.end(), + []( TestWithHash const& lhs, TestWithHash const& rhs ) { + if ( lhs.first == rhs.first ) { + return lhs.second.getTestCaseInfo() < + rhs.second.getTestCaseInfo(); + } + return lhs.first < rhs.first; + } ); std::vector<TestCaseHandle> randomized; randomized.reserve(indexed_tests.size()); @@ -88,14 +107,22 @@ namespace { return testSpec.matches( testCase.getTestCaseInfo() ) && isThrowSafe( testCase, config ); } - void enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& functions ) { - std::set<TestCaseHandle> seenFunctions; - for( auto const& function : functions ) { - auto prev = seenFunctions.insert( function ); - CATCH_ENFORCE( prev.second, - "error: TEST_CASE( \"" << function.getTestCaseInfo().name << "\" ) already defined.\n" - << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" - << "\tRedefined at " << function.getTestCaseInfo().lineInfo ); + void + enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& tests ) { + auto testInfoCmp = []( TestCaseInfo const* lhs, + TestCaseInfo const* rhs ) { + return *lhs < *rhs; + }; + std::set<TestCaseInfo const*, decltype(testInfoCmp)> seenTests(testInfoCmp); + for ( auto const& test : tests ) { + const auto infoPtr = &test.getTestCaseInfo(); + const auto prev = seenTests.insert( infoPtr ); + CATCH_ENFORCE( + prev.second, + "error: test case \"" << infoPtr->name << "\", with tags \"" + << infoPtr->tagsAsString() << "\" already defined.\n" + << "\tFirst seen at " << ( *prev.first )->lineInfo << "\n" + << "\tRedefined at " << infoPtr->lineInfo ); } } @@ -117,8 +144,8 @@ namespace { void TestRegistry::registerTest(Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker) { m_handles.emplace_back(testInfo.get(), testInvoker.get()); m_viewed_test_infos.push_back(testInfo.get()); - m_owned_test_infos.push_back(std::move(testInfo)); - m_invokers.push_back(std::move(testInvoker)); + m_owned_test_infos.push_back(CATCH_MOVE(testInfo)); + m_invokers.push_back(CATCH_MOVE(testInvoker)); } std::vector<TestCaseInfo*> const& TestRegistry::getAllInfos() const { @@ -146,17 +173,4 @@ namespace { m_testAsFunction(); } - std::string extractClassName( StringRef const& classOrQualifiedMethodName ) { - std::string className(classOrQualifiedMethodName); - if( startsWith( className, '&' ) ) - { - std::size_t lastColons = className.rfind( "::" ); - std::size_t penultimateColons = className.rfind( "::", lastColons-1 ); - if( penultimateColons == std::string::npos ) - penultimateColons = 1; - className = className.substr( penultimateColons, lastColons-penultimateColons ); - } - return className; - } - } // end namespace Catch diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp index f7fc37ef3a32a252d35e2fd03655a5fdfc24a6da..60a8f9bdc5af5b9af129b63d11686282265552d6 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_registry_impl.hpp @@ -63,9 +63,6 @@ namespace Catch { void invoke() const override; }; - - std::string extractClassName( StringRef const& classOrQualifiedMethodName ); - /////////////////////////////////////////////////////////////////////////// diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_tracker.cpp b/packages/Catch2/src/catch2/internal/catch_test_case_tracker.cpp index 2e8c3169f61055c384b9e7d2ce71bc840931be4c..ce76dcba89287acaf63e6cc712c00f11c7439baf 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_tracker.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_tracker.cpp @@ -9,6 +9,7 @@ #include <catch2/internal/catch_enforce.hpp> #include <catch2/internal/catch_string_manip.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <cassert> @@ -29,8 +30,12 @@ namespace TestCaseTracking { ITracker::~ITracker() = default; + void ITracker::markAsNeedingAnotherRun() { + m_runState = NeedsAnotherRun; + } + void ITracker::addChild( ITrackerPtr&& child ) { - m_children.push_back( std::move(child) ); + m_children.push_back( CATCH_MOVE(child) ); } ITracker* ITracker::findChild( NameAndLocation const& nameAndLocation ) { @@ -45,7 +50,27 @@ namespace TestCaseTracking { return ( it != m_children.end() ) ? it->get() : nullptr; } + bool ITracker::isSectionTracker() const { return false; } + bool ITracker::isGeneratorTracker() const { return false; } + + bool ITracker::isSuccessfullyCompleted() const { + return m_runState == CompletedSuccessfully; + } + bool ITracker::isOpen() const { + return m_runState != NotStarted && !isComplete(); + } + + bool ITracker::hasStarted() const { return m_runState != NotStarted; } + + void ITracker::openChild() { + if (m_runState != ExecutingChildren) { + m_runState = ExecutingChildren; + if (m_parent) { + m_parent->openChild(); + } + } + } ITracker& TrackerContext::startRun() { using namespace std::string_literals; @@ -84,36 +109,13 @@ namespace TestCaseTracking { TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ): - ITracker(nameAndLocation), - m_ctx( ctx ), - m_parent( parent ) + ITracker(nameAndLocation, parent), + m_ctx( ctx ) {} bool TrackerBase::isComplete() const { return m_runState == CompletedSuccessfully || m_runState == Failed; } - bool TrackerBase::isSuccessfullyCompleted() const { - return m_runState == CompletedSuccessfully; - } - bool TrackerBase::isOpen() const { - return m_runState != NotStarted && !isComplete(); - } - - ITracker& TrackerBase::parent() { - assert( m_parent ); // Should always be non-null except for root - return *m_parent; - } - - void TrackerBase::openChild() { - if( m_runState != ExecutingChildren ) { - m_runState = ExecutingChildren; - if( m_parent ) - m_parent->openChild(); - } - } - - bool TrackerBase::isSectionTracker() const { return false; } - bool TrackerBase::isGeneratorTracker() const { return false; } void TrackerBase::open() { m_runState = Executing; @@ -158,9 +160,6 @@ namespace TestCaseTracking { moveToParent(); m_ctx.completeCycle(); } - void TrackerBase::markAsNeedingAnotherRun() { - m_runState = NeedsAnotherRun; - } void TrackerBase::moveToParent() { assert( m_parent ); @@ -176,7 +175,7 @@ namespace TestCaseTracking { { if( parent ) { while( !parent->isSectionTracker() ) - parent = &parent->parent(); + parent = parent->parent(); SectionTracker& parentSection = static_cast<SectionTracker&>( *parent ); addNextFilters( parentSection.m_filters ); @@ -187,7 +186,7 @@ namespace TestCaseTracking { bool complete = true; if (m_filters.empty() - || m_filters[0] == "" + || m_filters[0].empty() || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) { complete = TrackerBase::isComplete(); } @@ -209,7 +208,7 @@ namespace TestCaseTracking { auto newSection = Catch::Detail::make_unique<SectionTracker>( nameAndLocation, ctx, ¤tTracker ); section = newSection.get(); - currentTracker.addChild( std::move( newSection ) ); + currentTracker.addChild( CATCH_MOVE( newSection ) ); } if( !ctx.completedCycle() ) section->tryOpen(); @@ -224,30 +223,26 @@ namespace TestCaseTracking { void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) { if( !filters.empty() ) { m_filters.reserve( m_filters.size() + filters.size() + 2 ); - m_filters.emplace_back(""); // Root - should never be consulted - m_filters.emplace_back(""); // Test Case - not a section filter + m_filters.emplace_back(StringRef{}); // Root - should never be consulted + m_filters.emplace_back(StringRef{}); // Test Case - not a section filter m_filters.insert( m_filters.end(), filters.begin(), filters.end() ); } } - void SectionTracker::addNextFilters( std::vector<std::string> const& filters ) { + void SectionTracker::addNextFilters( std::vector<StringRef> const& filters ) { if( filters.size() > 1 ) m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() ); } - std::vector<std::string> const& SectionTracker::getFilters() const { + std::vector<StringRef> const& SectionTracker::getFilters() const { return m_filters; } - std::string const& SectionTracker::trimmedName() const { + StringRef SectionTracker::trimmedName() const { return m_trimmed_name; } } // namespace TestCaseTracking -using TestCaseTracking::ITracker; -using TestCaseTracking::TrackerContext; -using TestCaseTracking::SectionTracker; - } // namespace Catch #if defined(__clang__) diff --git a/packages/Catch2/src/catch2/internal/catch_test_case_tracker.hpp b/packages/Catch2/src/catch2/internal/catch_test_case_tracker.hpp index c3ed1ae0950bb88402d7b44c36e97d03b0625625..0355f195cd006f83fbf712b4c935c87dea2e958e 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_case_tracker.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_case_tracker.hpp @@ -10,6 +10,7 @@ #include <catch2/internal/catch_source_line_info.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_stringref.hpp> #include <string> #include <vector> @@ -32,17 +33,29 @@ namespace TestCaseTracking { using ITrackerPtr = Catch::Detail::unique_ptr<ITracker>; - class ITracker { + class ITracker { NameAndLocation m_nameAndLocation; using Children = std::vector<ITrackerPtr>; protected: + enum CycleState { + NotStarted, + Executing, + ExecutingChildren, + NeedsAnotherRun, + CompletedSuccessfully, + Failed + }; + + ITracker* m_parent = nullptr; Children m_children; + CycleState m_runState = NotStarted; public: - ITracker(NameAndLocation const& nameAndLoc) : - m_nameAndLocation(nameAndLoc) + ITracker( NameAndLocation const& nameAndLoc, ITracker* parent ): + m_nameAndLocation( nameAndLoc ), + m_parent( parent ) {} @@ -50,22 +63,28 @@ namespace TestCaseTracking { NameAndLocation const& nameAndLocation() const { return m_nameAndLocation; } + ITracker* parent() const { + return m_parent; + } - virtual ~ITracker(); + virtual ~ITracker(); // = default // dynamic queries - virtual bool isComplete() const = 0; // Successfully completed or failed - virtual bool isSuccessfullyCompleted() const = 0; - virtual bool isOpen() const = 0; // Started but not complete - virtual bool hasStarted() const = 0; - virtual ITracker& parent() = 0; + //! Returns true if tracker run to completion (successfully or not) + virtual bool isComplete() const = 0; + //! Returns true if tracker run to completion succesfully + bool isSuccessfullyCompleted() const; + //! Returns true if tracker has started but hasn't been completed + bool isOpen() const; + //! Returns true iff tracker has started + bool hasStarted() const; // actions virtual void close() = 0; // Successfully complete virtual void fail() = 0; - virtual void markAsNeedingAnotherRun() = 0; + void markAsNeedingAnotherRun(); //! Register a nested ITracker void addChild( ITrackerPtr&& child ); @@ -81,11 +100,23 @@ namespace TestCaseTracking { } - virtual void openChild() = 0; + //! Marks tracker as executing a child, doing se recursively up the tree + void openChild(); - // Debug/ checking - virtual bool isSectionTracker() const = 0; - virtual bool isGeneratorTracker() const = 0; + /** + * Returns true if the instance is a section tracker + * + * Subclasses should override to true if they are, replaces RTTI + * for internal debug checks. + */ + virtual bool isSectionTracker() const; + /** + * Returns true if the instance is a generator tracker + * + * Subclasses should override to true if they are, replaces RTTI + * for internal debug checks. + */ + virtual bool isGeneratorTracker() const; }; class TrackerContext { @@ -115,41 +146,18 @@ namespace TestCaseTracking { class TrackerBase : public ITracker { protected: - enum CycleState { - NotStarted, - Executing, - ExecutingChildren, - NeedsAnotherRun, - CompletedSuccessfully, - Failed - }; TrackerContext& m_ctx; - ITracker* m_parent; - CycleState m_runState = NotStarted; public: TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); bool isComplete() const override; - bool isSuccessfullyCompleted() const override; - bool isOpen() const override; - bool hasStarted() const override { - return m_runState != NotStarted; - } - - ITracker& parent() override; - - void openChild() override; - - bool isSectionTracker() const override; - bool isGeneratorTracker() const override; void open(); void close() override; void fail() override; - void markAsNeedingAnotherRun() override; private: void moveToParent(); @@ -157,7 +165,7 @@ namespace TestCaseTracking { }; class SectionTracker : public TrackerBase { - std::vector<std::string> m_filters; + std::vector<StringRef> m_filters; std::string m_trimmed_name; public: SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ); @@ -171,11 +179,11 @@ namespace TestCaseTracking { void tryOpen(); void addInitialFilters( std::vector<std::string> const& filters ); - void addNextFilters( std::vector<std::string> const& filters ); + void addNextFilters( std::vector<StringRef> const& filters ); //! Returns filters active in this tracker - std::vector<std::string> const& getFilters() const; + std::vector<StringRef> const& getFilters() const; //! Returns whitespace-trimmed name of the tracked section - std::string const& trimmedName() const; + StringRef trimmedName() const; }; } // namespace TestCaseTracking diff --git a/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp b/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp index 9ceb03ab096985c960ca170673cf3a82f01e8d23..357e114dd25a4ddf1bd4bd852cea4fbce6340f59 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_macro_impl.hpp @@ -11,6 +11,7 @@ #include <catch2/internal/catch_assertion_handler.hpp> #include <catch2/interfaces/catch_interfaces_capture.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <catch2/internal/catch_source_line_info.hpp> // We need this suppression to leak, because it took until GCC 9 // for the front end to handle local suppression via _Pragma properly diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp index c4f26181b0497d0be4a57f5cc36ead093ccd11bc..d33ba27abeb77ae15b59fb6b3f7bb264f2c7fffb 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.cpp @@ -10,14 +10,32 @@ #include <catch2/catch_test_case_info.hpp> #include <catch2/internal/catch_test_case_registry_impl.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/internal/catch_string_manip.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { + namespace { + std::string extractClassName( StringRef classOrQualifiedMethodName ) { + std::string className( classOrQualifiedMethodName ); + if ( startsWith( className, '&' ) ) { + std::size_t lastColons = className.rfind( "::" ); + std::size_t penultimateColons = + className.rfind( "::", lastColons - 1 ); + if ( penultimateColons == std::string::npos ) + penultimateColons = 1; + className = className.substr( penultimateColons, + lastColons - penultimateColons ); + } + return className; + } + } // namespace + Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) { - return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsFunction( testAsFunction )); + return Detail::make_unique<TestInvokerAsFunction>( testAsFunction ); } - AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept { + AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept { CATCH_TRY { getMutableRegistryHub() .registerTest( @@ -25,7 +43,7 @@ namespace Catch { extractClassName( classOrMethod ), nameAndTags, lineInfo), - std::move(invoker) + CATCH_MOVE(invoker) ); } CATCH_CATCH_ALL { // Do not throw when constructing global objects, instead register the exception to be processed later diff --git a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp index 0f5ec48837bc407d4110a868e36e9f02badda5be..9a03e6dbfa4043508ada321f043e139b9c636c9c 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_registry.hpp +++ b/packages/Catch2/src/catch2/internal/catch_test_registry.hpp @@ -13,6 +13,7 @@ #include <catch2/interfaces/catch_interfaces_testcase.hpp> #include <catch2/internal/catch_stringref.hpp> #include <catch2/internal/catch_unique_ptr.hpp> +#include <catch2/internal/catch_unique_name.hpp> // GCC 5 and older do not properly handle disabling unused-variable warning // with a _Pragma. This means that we have to leak the suppression to the @@ -41,19 +42,19 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ); template<typename C> Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) { - return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsMethod<C>(testAsMethod) ); + return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod ); } struct NameAndTags { - NameAndTags(StringRef const& name_ = StringRef(), - StringRef const& tags_ = StringRef()) noexcept: - name(name_), tags(tags_) {} + constexpr NameAndTags( StringRef name_ = StringRef(), + StringRef tags_ = StringRef() ) noexcept: + name( name_ ), tags( tags_ ) {} StringRef name; StringRef tags; }; struct AutoReg : Detail::NonCopyable { - AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept; + AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept; }; } // end namespace Catch @@ -79,7 +80,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ static void TestName() #define INTERNAL_CATCH_TESTCASE( ... ) \ - INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ ) + INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \ @@ -101,7 +102,7 @@ struct AutoReg : Detail::NonCopyable { CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \ void TestName::test() #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \ - INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ ) + INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \ diff --git a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp index e9d77e74fc98a9a1aba0ee3d0599a3d4613ce8c9..86b25bfa607036fe928081fc2fb7b57611c35c5d 100644 --- a/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp +++ b/packages/Catch2/src/catch2/internal/catch_test_spec_parser.cpp @@ -9,6 +9,7 @@ #include <catch2/internal/catch_string_manip.hpp> #include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { @@ -35,7 +36,7 @@ namespace Catch { } TestSpec TestSpecParser::testSpec() { addFilter(); - return std::move(m_testSpec); + return CATCH_MOVE(m_testSpec); } bool TestSpecParser::visitChar( char c ) { if( (m_mode != EscapedName) && (c == '\\') ) { @@ -151,7 +152,7 @@ namespace Catch { void TestSpecParser::addFilter() { if( !m_currentFilter.m_required.empty() || !m_currentFilter.m_forbidden.empty() ) { - m_testSpec.m_filters.push_back( std::move(m_currentFilter) ); + m_testSpec.m_filters.push_back( CATCH_MOVE(m_currentFilter) ); m_currentFilter = TestSpec::Filter(); } } diff --git a/packages/Catch2/src/catch2/internal/catch_unique_name.hpp b/packages/Catch2/src/catch2/internal/catch_unique_name.hpp new file mode 100644 index 0000000000000000000000000000000000000000..31ab91268416035c74ec0a1b66ff1a2625ac6f23 --- /dev/null +++ b/packages/Catch2/src/catch2/internal/catch_unique_name.hpp @@ -0,0 +1,20 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED +#define CATCH_UNIQUE_NAME_HPP_INCLUDED + +#include <catch2/internal/catch_config_counter.hpp> +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#endif // CATCH_UNIQUE_NAME_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp b/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp index 758b22da63045a7572064ee3f2de85fa961ba031..d3bc8417de3a9435bf257ba9b1ad7da3630b1c06 100644 --- a/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp +++ b/packages/Catch2/src/catch2/internal/catch_unique_ptr.hpp @@ -64,7 +64,11 @@ namespace Detail { assert(m_ptr); return *m_ptr; } - T* operator->() const noexcept { + T* operator->() noexcept { + assert(m_ptr); + return m_ptr; + } + T const* operator->() const noexcept { assert(m_ptr); return m_ptr; } diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp index f69256cf4ef90a9d059f67dd9fdd4d4751196a8e..b8635f7f2bd2760e3662931e6ce7e2badcfbf80e 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.cpp @@ -5,9 +5,11 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include <catch2/internal/catch_xmlwriter.hpp> - +// Note: swapping these two includes around causes MSVC to error out +// while in /permissive- mode. No, I don't know why. +// Tested on VS 2019, 18.{3, 4}.x #include <catch2/internal/catch_enforce.hpp> +#include <catch2/internal/catch_xmlwriter.hpp> #include <iomanip> #include <type_traits> @@ -75,7 +77,7 @@ namespace { } - XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat ) + XmlEncode::XmlEncode( StringRef str, ForWhat forWhat ) : m_str( str ), m_forWhat( forWhat ) {} @@ -209,11 +211,20 @@ namespace { } } - XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, XmlFormatting fmt ) { + XmlWriter::ScopedElement& + XmlWriter::ScopedElement::writeText( StringRef text, XmlFormatting fmt ) { m_writer->writeText( text, fmt ); return *this; } + XmlWriter::ScopedElement& + XmlWriter::ScopedElement::writeAttribute( StringRef name, + StringRef attribute ) { + m_writer->writeAttribute( name, attribute ); + return *this; + } + + XmlWriter::XmlWriter( std::ostream& os ) : m_os( os ) { writeDeclaration(); @@ -265,18 +276,25 @@ namespace { return *this; } - XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) { + XmlWriter& XmlWriter::writeAttribute( StringRef name, + StringRef attribute ) { if( !name.empty() && !attribute.empty() ) m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"'; return *this; } - XmlWriter& XmlWriter::writeAttribute( std::string const& name, bool attribute ) { - m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"'; + XmlWriter& XmlWriter::writeAttribute( StringRef name, bool attribute ) { + writeAttribute(name, (attribute ? "true"_sr : "false"_sr)); + return *this; + } + + XmlWriter& XmlWriter::writeAttribute( StringRef name, + char const* attribute ) { + writeAttribute( name, StringRef( attribute ) ); return *this; } - XmlWriter& XmlWriter::writeText( std::string const& text, XmlFormatting fmt) { + XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); @@ -289,7 +307,7 @@ namespace { return *this; } - XmlWriter& XmlWriter::writeComment( std::string const& text, XmlFormatting fmt) { + XmlWriter& XmlWriter::writeComment( StringRef text, XmlFormatting fmt ) { ensureTagClosed(); if (shouldIndent(fmt)) { m_os << m_indent; @@ -299,8 +317,8 @@ namespace { return *this; } - void XmlWriter::writeStylesheetRef( std::string const& url ) { - m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n"; + void XmlWriter::writeStylesheetRef( StringRef url ) { + m_os << R"(<?xml-stylesheet type="text/xsl" href=")" << url << R"("?>)" << '\n'; } XmlWriter& XmlWriter::writeBlankLine() { @@ -322,12 +340,12 @@ namespace { } void XmlWriter::writeDeclaration() { - m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; + m_os << R"(<?xml version="1.0" encoding="UTF-8"?>)" << '\n'; } void XmlWriter::newlineIfNecessary() { if( m_needsNewline ) { - m_os << std::endl; + m_os << '\n' << std::flush; m_needsNewline = false; } } diff --git a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp index c2e7473e1fa8c59877fc09bc731a08c5dc8f9072..3ba8c08ecb60a93dbbd1c383cd308581e7b9bbeb 100644 --- a/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp +++ b/packages/Catch2/src/catch2/internal/catch_xmlwriter.hpp @@ -9,13 +9,7 @@ #define CATCH_XMLWRITER_HPP_INCLUDED #include <catch2/internal/catch_stream.hpp> - -// FixMe: Without this include (and something inside it), MSVC goes crazy -// and reports that calls to XmlEncode's op << are ambiguous between -// the declaration and definition. -// It also has to be in the header. -#include <catch2/internal/catch_source_line_info.hpp> - +#include <catch2/internal/catch_stringref.hpp> #include <vector> @@ -29,18 +23,24 @@ namespace Catch { XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs); XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs); + /** + * Helper for XML-encoding text (escaping angle brackets, quotes, etc) + * + * Note: doesn't take ownership of passed strings, and thus the + * encoded string must outlive the encoding instance. + */ class XmlEncode { public: enum ForWhat { ForTextNodes, ForAttributes }; - XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ); + XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes ); void encodeTo( std::ostream& os ) const; friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ); private: - std::string m_str; + StringRef m_str; ForWhat m_forWhat; }; @@ -56,10 +56,22 @@ namespace Catch { ~ScopedElement(); - ScopedElement& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent ); - - template<typename T> - ScopedElement& writeAttribute( std::string const& name, T const& attribute ) { + ScopedElement& + writeText( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); + + ScopedElement& writeAttribute( StringRef name, + StringRef attribute ); + template <typename T, + // Without this SFINAE, this overload is a better match + // for `std::string`, `char const*`, `char const[N]` args. + // 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>> + ScopedElement& writeAttribute( StringRef name, + T const& attribute ) { m_writer->writeAttribute( name, attribute ); return *this; } @@ -81,22 +93,39 @@ namespace Catch { XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent); - XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ); - - XmlWriter& writeAttribute( std::string const& name, bool attribute ); - - template<typename T> - XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { + //! The attribute content is XML-encoded + XmlWriter& writeAttribute( StringRef name, StringRef attribute ); + + //! Writes the attribute as "true/false" + XmlWriter& writeAttribute( StringRef name, bool attribute ); + + //! The attribute content is XML-encoded + XmlWriter& writeAttribute( StringRef name, char const* attribute ); + + //! The attribute value must provide op<<(ostream&, T). The resulting + //! serialization is XML-encoded + template <typename T, + // Without this SFINAE, this overload is a better match + // for `std::string`, `char const*`, `char const[N]` args. + // 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>> + XmlWriter& writeAttribute( StringRef name, T const& attribute ) { ReusableStringStream rss; rss << attribute; return writeAttribute( name, rss.str() ); } - XmlWriter& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent); + XmlWriter& writeText( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); - XmlWriter& writeComment(std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent); + XmlWriter& writeComment( StringRef text, + XmlFormatting fmt = XmlFormatting::Newline | + XmlFormatting::Indent ); - void writeStylesheetRef( std::string const& url ); + void writeStylesheetRef( StringRef url ); XmlWriter& writeBlankLine(); diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers.hpp index fe8f48c4b71ca45d2e362375cdddc3115db3d20b..86f63bee5e41e9678523c1eaeb9f307488e23223 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers.hpp @@ -9,6 +9,7 @@ #define CATCH_MATCHERS_HPP_INCLUDED #include <catch2/matchers/internal/catch_matchers_impl.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <string> #include <vector> @@ -87,11 +88,11 @@ namespace Matchers { friend MatchAllOf operator&& (MatchAllOf&& lhs, MatcherBase<ArgT> const& rhs) { lhs.m_matchers.push_back(&rhs); - return std::move(lhs); + return CATCH_MOVE(lhs); } friend MatchAllOf operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf&& rhs) { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); - return std::move(rhs); + return CATCH_MOVE(rhs); } private: @@ -140,11 +141,11 @@ namespace Matchers { friend MatchAnyOf operator|| (MatchAnyOf&& lhs, MatcherBase<ArgT> const& rhs) { lhs.m_matchers.push_back(&rhs); - return std::move(lhs); + return CATCH_MOVE(lhs); } friend MatchAnyOf operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf&& rhs) { rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs); - return std::move(rhs); + return CATCH_MOVE(rhs); } private: diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp index 81273995538dc576176eb16321cc02041ba2d3e4..082f834f281a694f240f68305d1e7c83e9728d66 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_container_properties.hpp @@ -10,6 +10,7 @@ #include <catch2/matchers/catch_matchers_templated.hpp> #include <catch2/internal/catch_container_nonmembers.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { namespace Matchers { @@ -55,7 +56,7 @@ namespace Catch { Matcher m_matcher; public: explicit SizeMatchesMatcher(Matcher m): - m_matcher(std::move(m)) + m_matcher(CATCH_MOVE(m)) {} template <typename RangeLike> @@ -81,7 +82,7 @@ namespace Catch { template <typename Matcher> std::enable_if_t<Detail::is_matcher<Matcher>::value, SizeMatchesMatcher<Matcher>> SizeIs(Matcher&& m) { - return SizeMatchesMatcher<Matcher>{std::forward<Matcher>(m)}; + return SizeMatchesMatcher<Matcher>{CATCH_FORWARD(m)}; } } // end namespace Matchers diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_contains.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_contains.hpp index be1b9379ff53b3afaa4063fb7948a06e15599da2..239aa80b96f71b855e69177b5950790793a2ce9e 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_contains.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_contains.hpp @@ -9,10 +9,10 @@ #define CATCH_MATCHERS_CONTAINS_HPP_INCLUDED #include <catch2/matchers/catch_matchers_templated.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <algorithm> #include <functional> -#include <utility> namespace Catch { namespace Matchers { @@ -24,8 +24,8 @@ namespace Catch { public: template <typename T2, typename Equality2> ContainsElementMatcher(T2&& target, Equality2&& predicate): - m_desired(std::forward<T2>(target)), - m_eq(std::forward<Equality2>(predicate)) + m_desired(CATCH_FORWARD(target)), + m_eq(CATCH_FORWARD(predicate)) {} std::string describe() const override { @@ -52,12 +52,11 @@ namespace Catch { // constructor (and also avoid some perfect forwarding failure // cases) ContainsMatcherMatcher(Matcher matcher): - m_matcher(std::move(matcher)) + m_matcher(CATCH_MOVE(matcher)) {} template <typename RangeLike> bool match(RangeLike&& rng) const { - using std::begin; using std::endl; for (auto&& elem : rng) { if (m_matcher.match(elem)) { return true; @@ -79,14 +78,14 @@ namespace Catch { template <typename T> std::enable_if_t<!Detail::is_matcher<T>::value, ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) { - return { std::forward<T>(elem), std::equal_to<>{} }; + return { CATCH_FORWARD(elem), std::equal_to<>{} }; } //! Creates a matcher that checks whether a range contains element matching a matcher template <typename Matcher> std::enable_if_t<Detail::is_matcher<Matcher>::value, ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) { - return { std::forward<Matcher>(matcher) }; + return { CATCH_FORWARD(matcher) }; } /** @@ -96,7 +95,7 @@ namespace Catch { */ template <typename T, typename Equality> ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) { - return { std::forward<T>(elem), std::forward<Equality>(eq) }; + return { CATCH_FORWARD(elem), CATCH_FORWARD(eq) }; } } diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp index fc5d916525251bdcb6c5d0e800e975813f928da2..ad0fd378c5aff1aa43a4e0b312d812ed03cf39d5 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_floating_point.cpp @@ -10,12 +10,12 @@ #include <catch2/internal/catch_polyfills.hpp> #include <catch2/internal/catch_to_string.hpp> #include <catch2/catch_tostring.hpp> +#include <catch2/internal/catch_floating_point_helpers.hpp> #include <algorithm> #include <cmath> #include <cstdlib> #include <cstdint> -#include <cstring> #include <sstream> #include <iomanip> #include <limits> @@ -24,20 +24,6 @@ namespace Catch { namespace { - int32_t convert(float f) { - static_assert(sizeof(float) == sizeof(int32_t), "Important ULP matcher assumption violated"); - int32_t i; - std::memcpy(&i, &f, sizeof(f)); - return i; - } - - int64_t convert(double d) { - static_assert(sizeof(double) == sizeof(int64_t), "Important ULP matcher assumption violated"); - int64_t i; - std::memcpy(&i, &d, sizeof(d)); - return i; - } - template <typename FP> bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) { // Comparison with NaN should always be false. @@ -46,16 +32,10 @@ namespace { return false; } - auto lc = convert(lhs); - auto rc = convert(rhs); - - if ((lc < 0) != (rc < 0)) { - // Potentially we can have +0 and -0 - return lhs == rhs; - } + // This should also handle positive and negative zeros, infinities + const auto ulpDist = ulpDistance(lhs, rhs); - auto ulpDiff = std::abs(lc - rc); - return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff; + return ulpDist <= maxUlpDiff; } #if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) @@ -130,6 +110,9 @@ namespace Detail { CATCH_ENFORCE(m_type == Detail::FloatingPointKind::Double || m_ulps < (std::numeric_limits<uint32_t>::max)(), "Provided ULP is impossibly large for a float comparison."); + CATCH_ENFORCE( std::numeric_limits<double>::is_iec559, + "WithinUlp matcher only supports platforms with " + "IEEE-754 compatible floating point representation" ); } #if defined(__clang__) diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.hpp index 99a01a4edb594a7d0d45dafc6d0d9570f52e2ca2..5f5cea590137927288b535c432a6ebe8685980f1 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_predicate.hpp @@ -10,9 +10,9 @@ #include <catch2/matchers/catch_matchers.hpp> #include <catch2/internal/catch_meta.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <string> -#include <utility> namespace Catch { namespace Matchers { @@ -28,7 +28,7 @@ class PredicateMatcher final : public MatcherBase<T> { public: PredicateMatcher(Predicate&& elem, std::string const& descr) - :m_predicate(std::forward<Predicate>(elem)), + :m_predicate(CATCH_FORWARD(elem)), m_description(Detail::finalizeDescription(descr)) {} @@ -50,7 +50,7 @@ public: 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"); - return PredicateMatcher<T, Pred>(std::forward<Pred>(predicate), description); + return PredicateMatcher<T, Pred>(CATCH_FORWARD(predicate), description); } } // namespace Matchers diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp index 09a8c1280e53daef26a6cfc439a234eb8f37a55b..e0e1a62d702794e5c4dcaf35e2bb4b7a6175bac1 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_quantifiers.hpp @@ -9,8 +9,7 @@ #define CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED #include <catch2/matchers/catch_matchers_templated.hpp> - -#include <utility> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { namespace Matchers { @@ -20,7 +19,7 @@ namespace Catch { Matcher m_matcher; public: AllMatchMatcher(Matcher matcher): - m_matcher(std::move(matcher)) + m_matcher(CATCH_MOVE(matcher)) {} std::string describe() const override { @@ -44,7 +43,7 @@ namespace Catch { Matcher m_matcher; public: NoneMatchMatcher(Matcher matcher): - m_matcher(std::move(matcher)) + m_matcher(CATCH_MOVE(matcher)) {} std::string describe() const override { @@ -68,7 +67,7 @@ namespace Catch { Matcher m_matcher; public: AnyMatchMatcher(Matcher matcher): - m_matcher(std::move(matcher)) + m_matcher(CATCH_MOVE(matcher)) {} std::string describe() const override { @@ -89,19 +88,19 @@ namespace Catch { // Creates a matcher that checks whether a range contains element matching a matcher template <typename Matcher> AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) { - return { std::forward<Matcher>(matcher) }; + return { CATCH_FORWARD(matcher) }; } // Creates a matcher that checks whether no element in a range matches a matcher. template <typename Matcher> NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) { - return { std::forward<Matcher>(matcher) }; + return { CATCH_FORWARD(matcher) }; } // Creates a matcher that checks whether any element in a range matches a matcher. template <typename Matcher> AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) { - return { std::forward<Matcher>(matcher) }; + return { CATCH_FORWARD(matcher) }; } } } diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp b/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp index a81baddd599c1ce3f642290333edb5a585809a4b..ee082d2c06e12b86509a3c3ee7e00902b86a1976 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_string.cpp @@ -8,6 +8,7 @@ #include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/internal/catch_string_manip.hpp> #include <catch2/catch_tostring.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <regex> @@ -76,7 +77,7 @@ namespace Matchers { - RegexMatcher::RegexMatcher(std::string regex, CaseSensitive caseSensitivity): m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {} + RegexMatcher::RegexMatcher(std::string regex, CaseSensitive caseSensitivity): m_regex(CATCH_MOVE(regex)), m_caseSensitivity(caseSensitivity) {} bool RegexMatcher::match(std::string const& matchee) const { auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway diff --git a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp index 544a2a5bedddedc54f04fb578a4972f6fdd10871..200ca74bf9e919462163580b945cbfb45ebcbd44 100644 --- a/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp +++ b/packages/Catch2/src/catch2/matchers/catch_matchers_templated.hpp @@ -10,12 +10,12 @@ #include <catch2/matchers/catch_matchers.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <array> #include <algorithm> #include <string> #include <type_traits> -#include <utility> namespace Catch { namespace Matchers { @@ -55,11 +55,11 @@ namespace Matchers { return arr; } - #ifdef CATCH_CPP17_OR_GREATER +#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510 using std::conjunction; - #else // CATCH_CPP17_OR_GREATER +#else // __cpp_lib_logical_traits template<typename... Cond> struct conjunction : std::true_type {}; @@ -67,7 +67,7 @@ namespace Matchers { template<typename Cond, typename... Rest> struct conjunction<Cond, Rest...> : std::integral_constant<bool, Cond::value && conjunction<Rest...>::value> {}; - #endif // CATCH_CPP17_OR_GREATER +#endif // __cpp_lib_logical_traits template<typename T> using is_generic_matcher = std::is_base_of< @@ -145,7 +145,7 @@ namespace Matchers { MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator && ( MatchAllOfGeneric<MatcherTs...>&& lhs, MatchAllOfGeneric<MatchersRHS...>&& rhs) { - return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(std::move(lhs.m_matchers), std::move(rhs.m_matchers))}; + return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))}; } //! Avoids type nesting for `GenericAllOf && some matcher` case @@ -154,7 +154,7 @@ namespace Matchers { MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && ( MatchAllOfGeneric<MatcherTs...>&& lhs, MatcherRHS const& rhs) { - return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(std::move(lhs.m_matchers), static_cast<void const*>(&rhs))}; + return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(&rhs))}; } //! Avoids type nesting for `some matcher && GenericAllOf` case @@ -163,7 +163,7 @@ namespace Matchers { MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && ( MatcherLHS const& lhs, MatchAllOfGeneric<MatcherTs...>&& rhs) { - return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), std::move(rhs.m_matchers))}; + return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))}; } }; @@ -194,7 +194,7 @@ namespace Matchers { friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator || ( MatchAnyOfGeneric<MatcherTs...>&& lhs, MatchAnyOfGeneric<MatchersRHS...>&& rhs) { - return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(std::move(lhs.m_matchers), std::move(rhs.m_matchers))}; + return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))}; } //! Avoids type nesting for `GenericAnyOf || some matcher` case @@ -203,7 +203,7 @@ namespace Matchers { MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || ( MatchAnyOfGeneric<MatcherTs...>&& lhs, MatcherRHS const& rhs) { - return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(std::move(lhs.m_matchers), static_cast<void const*>(std::addressof(rhs)))}; + return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(std::addressof(rhs)))}; } //! Avoids type nesting for `some matcher || GenericAnyOf` case @@ -212,7 +212,7 @@ namespace Matchers { MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || ( MatcherLHS const& lhs, MatchAnyOfGeneric<MatcherTs...>&& rhs) { - return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), std::move(rhs.m_matchers))}; + return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))}; } }; diff --git a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp index 7104e4c8412f84256c51480e9f211f921c5722c7..4fab1b52f84cf5c04273b79ce9600bf2eae5977e 100644 --- a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp +++ b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_combined_tu.cpp @@ -23,15 +23,16 @@ #include <catch2/matchers/internal/catch_matchers_impl.hpp> #include <catch2/matchers/catch_matchers.hpp> #include <catch2/interfaces/catch_interfaces_registry_hub.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { // This is the general overload that takes a any string matcher // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers // the Equals matcher (so the header does not mention matchers) - void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) { + void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) { std::string exceptionMessage = Catch::translateActiveException(); - MatchExpr<std::string, StringMatcher const&> expr( std::move(exceptionMessage), matcher, matcherString ); + MatchExpr<std::string, StringMatcher const&> expr( CATCH_MOVE(exceptionMessage), matcher, matcherString ); handler.handleExpr( expr ); } diff --git a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp index 5a5448da560ede59b8fec946c9bdda58c3bbe53f..2acbec1f3014796c335279ddb52840e320d81fe6 100644 --- a/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp +++ b/packages/Catch2/src/catch2/matchers/internal/catch_matchers_impl.hpp @@ -10,6 +10,7 @@ #include <catch2/internal/catch_test_macro_impl.hpp> #include <catch2/internal/catch_stringref.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> namespace Catch { @@ -19,20 +20,17 @@ namespace Catch { MatcherT const& m_matcher; StringRef m_matcherString; public: - MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef const& matcherString ) + MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose - m_arg( std::forward<ArgT>(arg) ), + m_arg( CATCH_FORWARD(arg) ), m_matcher( matcher ), m_matcherString( matcherString ) {} - void streamReconstructedExpression( std::ostream &os ) const override { - auto matcherAsString = m_matcher.toString(); - os << Catch::Detail::stringify( m_arg ) << ' '; - if( matcherAsString == Detail::unprintableString ) - os << m_matcherString; - else - os << matcherAsString; + void streamReconstructedExpression( std::ostream& os ) const override { + os << Catch::Detail::stringify( m_arg ) + << ' ' + << m_matcher.toString(); } }; @@ -43,11 +41,11 @@ namespace Catch { using StringMatcher = Matchers::MatcherBase<std::string>; - void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ); + void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ); template<typename ArgT, typename MatcherT> - auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, MatcherT> { - return MatchExpr<ArgT, MatcherT>( std::forward<ArgT>(arg), matcher, matcherString ); + auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) -> MatchExpr<ArgT, MatcherT> { + return MatchExpr<ArgT, MatcherT>( CATCH_FORWARD(arg), matcher, matcherString ); } } // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp index 209729c11b22f2502df4b98e54cf5540300cc95d..84fad79027e1ebec9a22dea4810f7aa27a275f6e 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_automake.hpp @@ -12,7 +12,7 @@ namespace Catch { - struct AutomakeReporter : StreamingReporterBase { + struct AutomakeReporter final : StreamingReporterBase { AutomakeReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ) {} @@ -24,12 +24,7 @@ namespace Catch { return "Reports test results in the format of Automake .trs files"s; } - void assertionStarting( AssertionInfo const& ) override {} - - bool assertionEnded( AssertionStats const& /*_assertionStats*/ ) override { return true; } - void testCaseEnded(TestCaseStats const& _testCaseStats) override; - void skipTest(TestCaseInfo const& testInfo) override; }; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp index 25a52e9dacd2327767b3ed3b00c06a02e2694e4e..2ca76c9351c3c4024e3d0e418ef235e75f31ea14 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_combined_tu.cpp @@ -69,11 +69,13 @@ namespace Catch { // Save previous errno, to prevent sprintf from overwriting it ErrnoGuard guard; #ifdef _MSC_VER - sprintf_s( buffer, "%.3f", duration ); + size_t printedLength = static_cast<size_t>( + sprintf_s( buffer, "%.3f", duration ) ); #else - std::snprintf( buffer, maxDoubleSize, "%.3f", duration ); + size_t printedLength = static_cast<size_t>( + std::snprintf( buffer, maxDoubleSize, "%.3f", duration ) ); #endif - return std::string( buffer ); + return std::string( buffer, printedLength ); } bool shouldShowDuration( IConfig const& config, double duration ) { @@ -169,7 +171,7 @@ namespace Catch { .width( CATCH_CONFIG_CONSOLE_WIDTH - 10 ); out << str << wrapper << '\n'; } - out << pluralise( tags.size(), "tag" ) << '\n' << std::endl; + out << pluralise(tags.size(), "tag"_sr) << "\n\n" << std::flush; } void defaultListTests(std::ostream& out, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) { @@ -196,7 +198,7 @@ namespace Catch { out << TextFlow::Column(testCaseInfo.name).initialIndent(2).indent(4) << '\n'; if (verbosity >= Verbosity::High) { - out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl; + out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << '\n'; } if (!testCaseInfo.tags.empty() && verbosity > Verbosity::Quiet) { @@ -205,10 +207,11 @@ namespace Catch { } if (isFiltered) { - out << pluralise(tests.size(), "matching test case") << '\n' << std::endl; + out << pluralise(tests.size(), "matching test case"_sr); } else { - out << pluralise(tests.size(), "test case") << '\n' << std::endl; + out << pluralise(tests.size(), "test case"_sr); } + out << "\n\n" << std::flush; } } // namespace Catch @@ -217,23 +220,30 @@ namespace Catch { #include <catch2/reporters/catch_reporter_event_listener.hpp> namespace Catch { + + void EventListenerBase::fatalErrorEncountered( StringRef ) {} + + void EventListenerBase::benchmarkPreparing( StringRef ) {} + void EventListenerBase::benchmarkStarting( BenchmarkInfo const& ) {} + void EventListenerBase::benchmarkEnded( BenchmarkStats<> const& ) {} + void EventListenerBase::benchmarkFailed( StringRef ) {} + void EventListenerBase::assertionStarting( AssertionInfo const& ) {} - bool EventListenerBase::assertionEnded( AssertionStats const& ) { - return false; - } + void EventListenerBase::assertionEnded( AssertionStats const& ) {} void EventListenerBase::listReporters( std::vector<ReporterDescription> const& ) {} void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {} void EventListenerBase::listTags( std::vector<TagInfo> const& ) {} - void EventListenerBase::noMatchingTestCases( std::string const& ) {} + void EventListenerBase::noMatchingTestCases( StringRef ) {} + void EventListenerBase::reportInvalidArguments( StringRef ) {} void EventListenerBase::testRunStarting( TestRunInfo const& ) {} - void EventListenerBase::testGroupStarting( GroupInfo const& ) {} void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {} + void EventListenerBase::testCasePartialStarting(TestCaseInfo const&, uint64_t) {} void EventListenerBase::sectionStarting( SectionInfo const& ) {} void EventListenerBase::sectionEnded( SectionStats const& ) {} + void EventListenerBase::testCasePartialEnded(TestCaseStats const&, uint64_t) {} void EventListenerBase::testCaseEnded( TestCaseStats const& ) {} - void EventListenerBase::testGroupEnded( TestGroupStats const& ) {} void EventListenerBase::testRunEnded( TestRunStats const& ) {} void EventListenerBase::skipTest( TestCaseInfo const& ) {} } // namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp index d59cb5a5c72ea4881c22a7ce18d609b9765fee6b..1bd997bdc70f19bfe7ca48af9031b981b620a95a 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.cpp @@ -19,9 +19,9 @@ namespace { // Colour::LightGrey - Catch::Colour::Code dimColour() { return Catch::Colour::FileName; } + constexpr Catch::Colour::Code dimColour() { return Catch::Colour::FileName; } - Catch::StringRef bothOrAll( std::size_t count ) { + constexpr Catch::StringRef bothOrAll( std::size_t count ) { switch (count) { case 1: return Catch::StringRef{}; @@ -62,25 +62,25 @@ void printTotals(std::ostream& out, const Totals& totals) { bothOrAll(totals.assertions.failed) : StringRef{}; out << "Failed " << bothOrAll(totals.testCases.failed) - << pluralise(totals.testCases.failed, "test case") << ", " + << pluralise(totals.testCases.failed, "test case"_sr) << ", " "failed " << qualify_assertions_failed << - pluralise(totals.assertions.failed, "assertion") << '.'; + pluralise(totals.assertions.failed, "assertion"_sr) << '.'; } else if (totals.assertions.total() == 0) { out << "Passed " << bothOrAll(totals.testCases.total()) - << pluralise(totals.testCases.total(), "test case") + << pluralise(totals.testCases.total(), "test case"_sr) << " (no assertions)."; } else if (totals.assertions.failed) { Colour colour(Colour::ResultError); out << - "Failed " << pluralise(totals.testCases.failed, "test case") << ", " - "failed " << pluralise(totals.assertions.failed, "assertion") << '.'; + "Failed " << pluralise(totals.testCases.failed, "test case"_sr) << ", " + "failed " << pluralise(totals.assertions.failed, "assertion"_sr) << '.'; } else { Colour colour(Colour::ResultSuccess); out << "Passed " << bothOrAll(totals.testCases.passed) - << pluralise(totals.testCases.passed, "test case") << - " with " << pluralise(totals.assertions.passed, "assertion") << '.'; + << pluralise(totals.testCases.passed, "test case"_sr) << + " with " << pluralise(totals.assertions.passed, "assertion"_sr) << '.'; } } @@ -227,7 +227,7 @@ private: { Colour colourGuard(colour); - stream << " with " << pluralise(N, "message") << ':'; + stream << " with " << pluralise(N, "message"_sr) << ':'; } while (itMessage != itEnd) { @@ -258,13 +258,11 @@ private: return "Reports test results on a single line, suitable for IDEs"; } - void CompactReporter::noMatchingTestCases( std::string const& spec ) { - stream << "No test cases matched '" << spec << '\'' << std::endl; + void CompactReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + stream << "No test cases matched '" << unmatchedSpec << "'\n"; } - void CompactReporter::assertionStarting( AssertionInfo const& ) {} - - bool CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { + void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) { AssertionResult const& result = _assertionStats.assertionResult; bool printInfoMessages = true; @@ -272,27 +270,26 @@ private: // Drop out if result was successful and we're not printing those if( !m_config->includeSuccessfulResults() && result.isOk() ) { if( result.getResultType() != ResultWas::Warning ) - return false; + return; printInfoMessages = false; } AssertionPrinter printer( stream, _assertionStats, printInfoMessages ); printer.print(); - stream << std::endl; - return true; + stream << '\n' << std::flush; } void CompactReporter::sectionEnded(SectionStats const& _sectionStats) { double dur = _sectionStats.durationInSeconds; if ( shouldShowDuration( *m_config, dur ) ) { - stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl; + stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } } void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) { printTotals( stream, _testRunStats.totals ); - stream << '\n' << std::endl; + stream << "\n\n" << std::flush; StreamingReporterBase::testRunEnded( _testRunStats ); } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp index 15f9531759d603f4ce30cdcad0ac539928f383fc..b39bd18ae264e890416cad430a9852614efc1eb9 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_compact.hpp @@ -14,7 +14,7 @@ namespace Catch { - struct CompactReporter : StreamingReporterBase { + struct CompactReporter final : StreamingReporterBase { using StreamingReporterBase::StreamingReporterBase; @@ -22,11 +22,9 @@ namespace Catch { static std::string getDescription(); - void noMatchingTestCases(std::string const& spec) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; - void assertionStarting(AssertionInfo const&) override; - - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void sectionEnded(SectionStats const& _sectionStats) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp index e89702142251584c1b00b2a2b382aa9351e392d9..d7c2dd5953cd51dc145131d668015caf9650c733 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_console.cpp @@ -18,8 +18,8 @@ #include <catch2/catch_test_case_info.hpp> #include <catch2/internal/catch_console_width.hpp> #include <catch2/reporters/catch_reporter_helpers.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> -#include <cfloat> #include <cstdio> #if defined(_MSC_VER) @@ -56,7 +56,7 @@ public: switch (result.getResultType()) { case ResultWas::Ok: colour = Colour::Success; - passOrFail = "PASSED"; + passOrFail = "PASSED"_sr; //if( result.hasMessage() ) if (_stats.infoMessages.size() == 1) messageLabel = "with message"; @@ -66,10 +66,10 @@ public: case ResultWas::ExpressionFailed: if (result.isOk()) { colour = Colour::Success; - passOrFail = "FAILED - but was ok"; + passOrFail = "FAILED - but was ok"_sr; } else { colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; } if (_stats.infoMessages.size() == 1) messageLabel = "with message"; @@ -78,7 +78,7 @@ public: break; case ResultWas::ThrewException: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "due to unexpected exception with "; if (_stats.infoMessages.size() == 1) messageLabel += "message"; @@ -87,12 +87,12 @@ public: break; case ResultWas::FatalErrorCondition: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "due to a fatal error condition"; break; case ResultWas::DidntThrowException: colour = Colour::Error; - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; messageLabel = "because no exception was thrown where one was expected"; break; case ResultWas::Info: @@ -102,7 +102,7 @@ public: messageLabel = "warning"; break; case ResultWas::ExplicitFailure: - passOrFail = "FAILED"; + passOrFail = "FAILED"_sr; colour = Colour::Error; if (_stats.infoMessages.size() == 1) messageLabel = "explicitly with message"; @@ -113,7 +113,7 @@ public: case ResultWas::Unknown: case ResultWas::FailureBit: case ResultWas::Exception: - passOrFail = "** internal error **"; + passOrFail = "** internal error **"_sr; colour = Colour::Error; break; } @@ -171,7 +171,7 @@ private: AssertionStats const& stats; AssertionResult const& result; Colour::Code colour; - std::string passOrFail; + StringRef passOrFail; std::string messageLabel; std::string message; std::vector<MessageInfo> messages; @@ -285,7 +285,7 @@ class TablePrinter { public: TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos ) : m_os( os ), - m_columnInfos( std::move( columnInfos ) ) {} + m_columnInfos( CATCH_MOVE( columnInfos ) ) {} auto columnInfos() const -> std::vector<ColumnInfo> const& { return m_columnInfos; @@ -310,7 +310,7 @@ public: void close() { if (m_isOpen) { *this << RowBreak(); - m_os << std::endl; + m_os << '\n' << std::flush; m_isOpen = false; } } @@ -354,7 +354,7 @@ public: ConsoleReporter::ConsoleReporter(ReporterConfig const& config) : StreamingReporterBase(config), - m_tablePrinter(new TablePrinter(config.stream(), + m_tablePrinter(Detail::make_unique<TablePrinter>(config.stream(), [&config]() -> std::vector<ColumnInfo> { if (config.fullConfig()->benchmarkNoAnalysis()) { @@ -381,31 +381,30 @@ std::string ConsoleReporter::getDescription() { return "Reports test results as plain lines of text"; } -void ConsoleReporter::noMatchingTestCases(std::string const& spec) { - stream << "No test cases matched '" << spec << '\'' << std::endl; +void ConsoleReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + stream << "No test cases matched '" << unmatchedSpec << "'\n"; } -void ConsoleReporter::reportInvalidArguments(std::string const&arg){ - stream << "Invalid Filter: " << arg << std::endl; +void ConsoleReporter::reportInvalidArguments( StringRef arg ) { + stream << "Invalid Filter: " << arg << '\n'; } void ConsoleReporter::assertionStarting(AssertionInfo const&) {} -bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { +void ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) { AssertionResult const& result = _assertionStats.assertionResult; bool includeResults = m_config->includeSuccessfulResults() || !result.isOk(); // Drop out if result was successful but we're not printing them. if (!includeResults && result.getResultType() != ResultWas::Warning) - return false; + return; lazyPrint(); ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults); printer.print(); - stream << std::endl; - return true; + stream << '\n' << std::flush; } void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) { @@ -422,11 +421,11 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { stream << "\nNo assertions in section"; else stream << "\nNo assertions in test case"; - stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl; + stream << " '" << _sectionStats.sectionInfo.name << "'\n\n" << std::flush; } double dur = _sectionStats.durationInSeconds; if (shouldShowDuration(*m_config, dur)) { - stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl; + stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush; } if (m_headerPrinted) { m_headerPrinted = false; @@ -434,10 +433,12 @@ void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) { StreamingReporterBase::sectionEnded(_sectionStats); } -void ConsoleReporter::benchmarkPreparing(std::string const& name) { +void ConsoleReporter::benchmarkPreparing( StringRef name ) { lazyPrintWithoutClosingBenchmarkTable(); - auto nameCol = TextFlow::Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2)); + auto nameCol = TextFlow::Column( static_cast<std::string>( name ) ) + .width( static_cast<std::size_t>( + m_tablePrinter->columnInfos()[0].width - 2 ) ); bool firstLine = true; for (auto line : nameCol) { @@ -473,7 +474,7 @@ void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) { } } -void ConsoleReporter::benchmarkFailed(std::string const& error) { +void ConsoleReporter::benchmarkFailed( StringRef error ) { Colour colour(Colour::Red); (*m_tablePrinter) << "Benchmark failed (" << error << ')' @@ -485,19 +486,10 @@ void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) { StreamingReporterBase::testCaseEnded(_testCaseStats); m_headerPrinted = false; } -void ConsoleReporter::testGroupEnded(TestGroupStats const& _testGroupStats) { - if (currentGroupInfo.used) { - printSummaryDivider(); - stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n"; - printTotals(_testGroupStats.totals); - stream << '\n' << std::endl; - } - StreamingReporterBase::testGroupEnded(_testGroupStats); -} void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) { printTotalsDivider(_testRunStats.totals); printTotals(_testRunStats.totals); - stream << std::endl; + stream << '\n' << std::flush; StreamingReporterBase::testRunEnded(_testRunStats); } void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) { @@ -513,11 +505,9 @@ void ConsoleReporter::lazyPrint() { void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() { - if (!currentTestRunInfo.used) + if ( !currentTestRunInfo.used ) { lazyPrintRunInfo(); - if (!currentGroupInfo.used) - lazyPrintGroupInfo(); - + } if (!m_headerPrinted) { printTestCaseAndSectionHeader(); m_headerPrinted = true; @@ -535,12 +525,6 @@ void ConsoleReporter::lazyPrintRunInfo() { currentTestRunInfo.used = true; } -void ConsoleReporter::lazyPrintGroupInfo() { - if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) { - printClosedHeader("Group: " + currentGroupInfo->name); - currentGroupInfo.used = true; - } -} void ConsoleReporter::printTestCaseAndSectionHeader() { assert(!m_sectionStack.empty()); printOpenHeader(currentTestCaseInfo->name); @@ -561,7 +545,7 @@ void ConsoleReporter::printTestCaseAndSectionHeader() { stream << lineOfChars('-') << '\n'; Colour colourGuard(Colour::FileName); stream << lineInfo << '\n'; - stream << lineOfChars('.') << '\n' << std::endl; + stream << lineOfChars('.') << "\n\n" << std::flush; } void ConsoleReporter::printClosedHeader(std::string const& _name) { @@ -590,7 +574,7 @@ void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t struct SummaryColumn { SummaryColumn( std::string _label, Colour::Code _colour ) - : label( std::move( _label ) ), + : label( CATCH_MOVE( _label ) ), colour( _colour ) {} SummaryColumn addRow( std::size_t count ) { ReusableStringStream rss; @@ -618,8 +602,8 @@ void ConsoleReporter::printTotals( Totals const& totals ) { } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) { stream << Colour(Colour::ResultSuccess) << "All tests passed"; stream << " (" - << pluralise(totals.assertions.passed, "assertion") << " in " - << pluralise(totals.testCases.passed, "test case") << ')' + << pluralise(totals.assertions.passed, "assertion"_sr) << " in " + << pluralise(totals.testCases.passed, "test case"_sr) << ')' << '\n'; } else { @@ -637,11 +621,11 @@ void ConsoleReporter::printTotals( Totals const& totals ) { .addRow(totals.testCases.failedButOk) .addRow(totals.assertions.failedButOk)); - printSummaryRow("test cases", columns, 0); - printSummaryRow("assertions", columns, 1); + printSummaryRow("test cases"_sr, columns, 0); + printSummaryRow("assertions"_sr, columns, 1); } } -void ConsoleReporter::printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row) { +void ConsoleReporter::printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row) { for (auto col : cols) { std::string value = col.rows[row]; if (col.label.empty()) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp index e446d8cc385f12de5517550155121ecb8cbc0c4e..ec7430935205769d18d36d91c82394c209d59bfa 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_console.hpp @@ -11,44 +11,34 @@ #include <catch2/reporters/catch_reporter_streaming_base.hpp> #include <catch2/internal/catch_unique_ptr.hpp> -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch - // Note that 4062 (not all labels are handled - // and default is missing) is enabled -#endif - - namespace Catch { // Fwd decls struct SummaryColumn; class TablePrinter; - struct ConsoleReporter : StreamingReporterBase { + struct ConsoleReporter final : StreamingReporterBase { Detail::unique_ptr<TablePrinter> m_tablePrinter; ConsoleReporter(ReporterConfig const& config); ~ConsoleReporter() override; static std::string getDescription(); - void noMatchingTestCases(std::string const& spec) override; - - void reportInvalidArguments(std::string const&arg) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; + void reportInvalidArguments( StringRef arg ) override; void assertionStarting(AssertionInfo const&) override; - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void sectionStarting(SectionInfo const& _sectionInfo) override; void sectionEnded(SectionStats const& _sectionStats) override; - void benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting(BenchmarkInfo const& info) override; void benchmarkEnded(BenchmarkStats<> const& stats) override; - void benchmarkFailed(std::string const& error) override; + void benchmarkFailed( StringRef error ) override; void testCaseEnded(TestCaseStats const& _testCaseStats) override; - void testGroupEnded(TestGroupStats const& _testGroupStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; void testRunStarting(TestRunInfo const& _testRunInfo) override; private: @@ -57,7 +47,6 @@ namespace Catch { void lazyPrintWithoutClosingBenchmarkTable(); void lazyPrintRunInfo(); - void lazyPrintGroupInfo(); void printTestCaseAndSectionHeader(); void printClosedHeader(std::string const& _name); @@ -69,7 +58,7 @@ namespace Catch { void printTotals(Totals const& totals); - void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row); + void printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row); void printTotalsDivider(Totals const& totals); void printSummaryDivider(); @@ -81,8 +70,4 @@ namespace Catch { } // end namespace Catch -#if defined(_MSC_VER) -#pragma warning(pop) -#endif - #endif // CATCH_REPORTER_CONSOLE_HPP_INCLUDED diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp index a83a9ad0abd55b89373766327b77a96732aa593a..64afac18c93d8303919eba2208b76acfb72dac9c 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -54,7 +54,7 @@ namespace Catch { auto newNode = Detail::make_unique<SectionNode>( incompleteStats ); node = newNode.get(); - parentNode.childSections.push_back( std::move( newNode ) ); + parentNode.childSections.push_back( CATCH_MOVE( newNode ) ); } else { node = it->get(); } @@ -64,7 +64,7 @@ namespace Catch { m_sectionStack.push_back( node ); } - bool CumulativeReporterBase::assertionEnded( + void CumulativeReporterBase::assertionEnded( AssertionStats const& assertionStats ) { assert( !m_sectionStack.empty() ); // AssertionResult holds a pointer to a temporary DecomposedExpression, @@ -76,7 +76,6 @@ namespace Catch { assertionStats.assertionResult.getExpandedExpression() ); SectionNode& sectionNode = *m_sectionStack.back(); sectionNode.assertions.push_back( assertionStats ); - return true; } void CumulativeReporterBase::sectionEnded( SectionStats const& sectionStats ) { @@ -90,24 +89,19 @@ namespace Catch { TestCaseStats const& testCaseStats ) { auto node = Detail::make_unique<TestCaseNode>( testCaseStats ); assert( m_sectionStack.size() == 0 ); - node->children.push_back( std::move(m_rootSection) ); - m_testCases.push_back( std::move(node) ); + node->children.push_back( CATCH_MOVE(m_rootSection) ); + m_testCases.push_back( CATCH_MOVE(node) ); assert( m_deepestSection ); m_deepestSection->stdOut = testCaseStats.stdOut; m_deepestSection->stdErr = testCaseStats.stdErr; } - void CumulativeReporterBase::testGroupEnded( - TestGroupStats const& testGroupStats ) { - auto node = Detail::make_unique<TestGroupNode>( testGroupStats ); - node->children.swap( m_testCases ); - m_testGroups.push_back( std::move(node) ); - } void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) { - m_testRuns.emplace_back( testRunStats ); - m_testRuns.back().children.swap( m_testGroups ); + assert(!m_testRun && "CumulativeReporterBase assumes there can only be one test run"); + m_testRun = Detail::make_unique<TestRunNode>( testRunStats ); + m_testRun->children.swap( m_testCases ); testRunEndedCumulative(); } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp index 2820e9f6223022850513bc199254dc7110523a1a..a6acc54f75b9c3750c9b9c66ed5d05608260f8cf 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -42,27 +42,35 @@ namespace Catch { using TestCaseNode = Node<TestCaseStats, SectionNode>; - using TestGroupNode = Node<TestGroupStats, TestCaseNode>; - using TestRunNode = Node<TestRunStats, TestGroupNode>; + using TestRunNode = Node<TestRunStats, TestCaseNode>; CumulativeReporterBase( ReporterConfig const& _config ): IStreamingReporter( _config.fullConfig() ), stream( _config.stream() ) {} ~CumulativeReporterBase() override; + void benchmarkPreparing( StringRef ) override {} + void benchmarkStarting( BenchmarkInfo const& ) override {} + void benchmarkEnded( BenchmarkStats<> const& ) override {} + void benchmarkFailed( StringRef ) override {} + + void noMatchingTestCases( StringRef ) override {} + void reportInvalidArguments( StringRef ) override {} + void fatalErrorEncountered( StringRef /*error*/ ) override {} + + void testRunStarting( TestRunInfo const& ) override {} - void testGroupStarting( GroupInfo const& ) override {} void testCaseStarting( TestCaseInfo const& ) override {} - + void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {} void sectionStarting( SectionInfo const& sectionInfo ) override; void assertionStarting( AssertionInfo const& ) override {} - bool assertionEnded( AssertionStats const& assertionStats ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {} void testCaseEnded( TestCaseStats const& testCaseStats ) override; - void testGroupEnded( TestGroupStats const& testGroupStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; //! Customization point: called after last test finishes (testRunEnded has been handled) virtual void testRunEndedCumulative() = 0; @@ -73,14 +81,14 @@ namespace Catch { void listTests( std::vector<TestCaseHandle> const& tests ) override; void listTags( std::vector<TagInfo> const& tags ) override; - + protected: std::ostream& stream; // Note: We rely on pointer identity being stable, which is why - // which is why we store around pointers rather than values. + // we store pointers to the nodes rather than the values. std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases; - std::vector<Detail::unique_ptr<TestGroupNode>> m_testGroups; - - std::vector<TestRunNode> m_testRuns; + // We need lazy construction here. We should probably refactor it + // later, after the events are redone. + Detail::unique_ptr<TestRunNode> m_testRun; Detail::unique_ptr<SectionNode> m_rootSection; SectionNode* m_deepestSection = nullptr; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp index ee65eebdfae30d4863315872d88e01488f59c715..d2cccb6be0cc8f58bcdc1db9cb2f52825ddec587 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_event_listener.hpp @@ -15,7 +15,7 @@ namespace Catch { /** * Base class identifying listeners. * - * Provides default implementation for all IStreamingReporter member + * Provides empty default implementation for all IStreamingReporter member * functions, so that listeners implementations can pick which * member functions it actually cares about. */ @@ -24,24 +24,35 @@ namespace Catch { EventListenerBase( ReporterConfig const& config ): IStreamingReporter( config.fullConfig() ) {} + void reportInvalidArguments( StringRef unmatchedSpec ) override; + void fatalErrorEncountered( StringRef error ) override; + + void benchmarkPreparing( StringRef name ) override; + void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; + void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; + void benchmarkFailed( StringRef error ) override; + void assertionStarting( AssertionInfo const& assertionInfo ) override; - bool assertionEnded( AssertionStats const& assertionStats ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; void listReporters( std::vector<ReporterDescription> const& descriptions ) override; void listTests( std::vector<TestCaseHandle> const& tests ) override; void listTags( std::vector<TagInfo> const& tagInfos ) override; - void noMatchingTestCases( std::string const& spec ) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; void testRunStarting( TestRunInfo const& testRunInfo ) override; - void testGroupStarting( GroupInfo const& groupInfo ) override; void testCaseStarting( TestCaseInfo const& testInfo ) override; + void testCasePartialStarting( TestCaseInfo const& testInfo, + uint64_t partNumber ) override; void sectionStarting( SectionInfo const& sectionInfo ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded( TestCaseStats const& testCaseStats, + uint64_t partNumber ) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; - void testGroupEnded( TestGroupStats const& testGroupStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; void skipTest( TestCaseInfo const& testInfo ) override; + }; } // end namespace Catch diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp index cff5d7d7caf939dcd1f60155267dd85b9e785648..f7420b7ada063b1b48a8d9f68eeb65015fd86a09 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.cpp @@ -26,7 +26,7 @@ namespace Catch { std::time(&rawtime); std::tm timeInfo = {}; -#ifdef _MSC_VER +#if defined (_MSC_VER) || defined (__MINGW32__) gmtime_s(&timeInfo, &rawtime); #else gmtime_r(&rawtime, &timeInfo); @@ -38,7 +38,7 @@ namespace Catch { std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); - return std::string(timeStamp); + return std::string(timeStamp, timeStampSize - 1); } std::string fileNameTag(std::vector<Tag> const& tags) { @@ -64,35 +64,27 @@ namespace Catch { m_preferences.shouldReportAllAssertions = true; } - JunitReporter::~JunitReporter() {} - std::string JunitReporter::getDescription() { return "Reports test results in an XML format that looks like Ant's junitreport target"; } - void JunitReporter::noMatchingTestCases( std::string const& /*spec*/ ) {} - void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) { CumulativeReporterBase::testRunStarting( runInfo ); xml.startElement( "testsuites" ); - } - - void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) { suiteTimer.start(); stdOutForSuite.clear(); stdErrForSuite.clear(); unexpectedExceptions = 0; - CumulativeReporterBase::testGroupStarting( groupInfo ); } void JunitReporter::testCaseStarting( TestCaseInfo const& testCaseInfo ) { m_okToFail = testCaseInfo.okToFail(); } - bool JunitReporter::assertionEnded( AssertionStats const& assertionStats ) { + void JunitReporter::assertionEnded( AssertionStats const& assertionStats ) { if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail ) unexpectedExceptions++; - return CumulativeReporterBase::assertionEnded( assertionStats ); + CumulativeReporterBase::assertionEnded( assertionStats ); } void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { @@ -101,48 +93,44 @@ namespace Catch { CumulativeReporterBase::testCaseEnded( testCaseStats ); } - void JunitReporter::testGroupEnded( TestGroupStats const& testGroupStats ) { - double suiteTime = suiteTimer.getElapsedSeconds(); - CumulativeReporterBase::testGroupEnded( testGroupStats ); - writeGroup( *m_testGroups.back(), suiteTime ); - } - void JunitReporter::testRunEndedCumulative() { + const auto suiteTime = suiteTimer.getElapsedSeconds(); + writeRun( *m_testRun, suiteTime ); xml.endElement(); } - void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) { + void JunitReporter::writeRun( TestRunNode const& testRunNode, double suiteTime ) { XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" ); - TestGroupStats const& stats = groupNode.value; - xml.writeAttribute( "name", stats.groupInfo.name ); - xml.writeAttribute( "errors", unexpectedExceptions ); - xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions ); - xml.writeAttribute( "tests", stats.totals.assertions.total() ); - xml.writeAttribute( "hostname", "tbd" ); // !TBD + TestRunStats const& stats = testRunNode.value; + xml.writeAttribute( "name"_sr, stats.runInfo.name ); + xml.writeAttribute( "errors"_sr, unexpectedExceptions ); + xml.writeAttribute( "failures"_sr, stats.totals.assertions.failed-unexpectedExceptions ); + xml.writeAttribute( "tests"_sr, stats.totals.assertions.total() ); + xml.writeAttribute( "hostname"_sr, "tbd"_sr ); // !TBD if( m_config->showDurations() == ShowDurations::Never ) - xml.writeAttribute( "time", "" ); + xml.writeAttribute( "time"_sr, ""_sr ); else - xml.writeAttribute( "time", suiteTime ); - xml.writeAttribute( "timestamp", getCurrentTimestamp() ); + xml.writeAttribute( "time"_sr, suiteTime ); + xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() ); // Write properties if there are any if (m_config->hasTestFilters() || m_config->rngSeed() != 0) { auto properties = xml.scopedElement("properties"); if (m_config->hasTestFilters()) { xml.scopedElement("property") - .writeAttribute("name", "filters") - .writeAttribute("value", serializeFilters(m_config->getTestsOrTags())); + .writeAttribute("name"_sr, "filters"_sr) + .writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags())); } if (m_config->rngSeed() != 0) { xml.scopedElement("property") - .writeAttribute("name", "random-seed") - .writeAttribute("value", m_config->rngSeed()); + .writeAttribute("name"_sr, "random-seed"_sr) + .writeAttribute("value"_sr, m_config->rngSeed()); } } // Write test cases - for( auto const& child : groupNode.children ) + for( auto const& child : testRunNode.children ) writeTestCase( *child ); xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline ); @@ -183,19 +171,19 @@ namespace Catch { !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); if( className.empty() ) { - xml.writeAttribute( "classname", name ); - xml.writeAttribute( "name", "root" ); + xml.writeAttribute( "classname"_sr, name ); + xml.writeAttribute( "name"_sr, "root"_sr ); } else { - xml.writeAttribute( "classname", className ); - xml.writeAttribute( "name", name ); + xml.writeAttribute( "classname"_sr, className ); + xml.writeAttribute( "name"_sr, name ); } - xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); + xml.writeAttribute( "time"_sr, ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) ); // This is not ideal, but it should be enough to mimic gtest's // junit output. // Ideally the JUnit reporter would also handle `skipTest` // events and write those out appropriately. - xml.writeAttribute( "status", "run" ); + xml.writeAttribute( "status"_sr, "run"_sr ); writeAssertions( sectionNode ); @@ -244,8 +232,8 @@ namespace Catch { XmlWriter::ScopedElement e = xml.scopedElement( elementName ); - xml.writeAttribute( "message", result.getExpression() ); - xml.writeAttribute( "type", result.getTestMacroName() ); + xml.writeAttribute( "message"_sr, result.getExpression() ); + xml.writeAttribute( "type"_sr, result.getTestMacroName() ); ReusableStringStream rss; if (stats.totals.assertions.total() > 0) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp index c76ddddefd1f6bd91fe3939299db47c8f06cc4e6..6665663cee03082d05cf3b7a4d8b29c9f85c5916 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_junit.hpp @@ -15,36 +15,31 @@ namespace Catch { - class JunitReporter : public CumulativeReporterBase { + class JunitReporter final : public CumulativeReporterBase { public: JunitReporter(ReporterConfig const& _config); - ~JunitReporter() override; + ~JunitReporter() override = default; static std::string getDescription(); - void noMatchingTestCases(std::string const& /*spec*/) override; - void testRunStarting(TestRunInfo const& runInfo) override; - void testGroupStarting(GroupInfo const& groupInfo) override; - void testCaseStarting(TestCaseInfo const& testCaseInfo) override; - bool assertionEnded(AssertionStats const& assertionStats) override; + void assertionEnded(AssertionStats const& assertionStats) override; void testCaseEnded(TestCaseStats const& testCaseStats) override; - void testGroupEnded(TestGroupStats const& testGroupStats) override; - void testRunEndedCumulative() override; - void writeGroup(TestGroupNode const& groupNode, double suiteTime); + private: + void writeRun(TestRunNode const& testRunNode, double suiteTime); void writeTestCase(TestCaseNode const& testCaseNode); - void writeSection(std::string const& className, - std::string const& rootName, - SectionNode const& sectionNode); + void writeSection( std::string const& className, + std::string const& rootName, + SectionNode const& sectionNode ); void writeAssertions(SectionNode const& sectionNode); void writeAssertion(AssertionStats const& stats); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp index d189388b1c140f99a42d2632ee3c3fe23016dbdd..f233b0a2ec3f97d67e4d6e11d3c82688b35f0964 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_listening.cpp @@ -6,128 +6,138 @@ // SPDX-License-Identifier: BSL-1.0 #include <catch2/reporters/catch_reporter_listening.hpp> +#include <catch2/internal/catch_move_and_forward.hpp> #include <cassert> namespace Catch { void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) { - m_listeners.push_back( std::move( listener ) ); + m_listeners.push_back( CATCH_MOVE( listener ) ); } void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) { assert(!m_reporter && "Listening reporter can wrap only 1 real reporter"); - m_reporter = std::move( reporter ); + m_reporter = CATCH_MOVE( reporter ); m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut; } - void ListeningReporter::noMatchingTestCases( std::string const& spec ) { - for ( auto const& listener : m_listeners ) { - listener->noMatchingTestCases( spec ); + void ListeningReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + for ( auto& listener : m_listeners ) { + listener->noMatchingTestCases( unmatchedSpec ); } - m_reporter->noMatchingTestCases( spec ); + m_reporter->noMatchingTestCases( unmatchedSpec ); } - void ListeningReporter::reportInvalidArguments(std::string const&arg){ - for ( auto const& listener : m_listeners ) { + void ListeningReporter::fatalErrorEncountered( StringRef error ) { + for ( auto& listener : m_listeners ) { + listener->fatalErrorEncountered( error ); + } + m_reporter->fatalErrorEncountered( error ); + } + + void ListeningReporter::reportInvalidArguments( StringRef arg ) { + for ( auto& listener : m_listeners ) { listener->reportInvalidArguments( arg ); } m_reporter->reportInvalidArguments( arg ); } - void ListeningReporter::benchmarkPreparing( std::string const& name ) { - for (auto const& listener : m_listeners) { + void ListeningReporter::benchmarkPreparing( StringRef name ) { + for (auto& listener : m_listeners) { listener->benchmarkPreparing(name); } m_reporter->benchmarkPreparing(name); } void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->benchmarkStarting( benchmarkInfo ); } m_reporter->benchmarkStarting( benchmarkInfo ); } void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->benchmarkEnded( benchmarkStats ); } m_reporter->benchmarkEnded( benchmarkStats ); } - void ListeningReporter::benchmarkFailed( std::string const& error ) { - for (auto const& listener : m_listeners) { + void ListeningReporter::benchmarkFailed( StringRef error ) { + for (auto& listener : m_listeners) { listener->benchmarkFailed(error); } m_reporter->benchmarkFailed(error); } void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->testRunStarting( testRunInfo ); } m_reporter->testRunStarting( testRunInfo ); } - void ListeningReporter::testGroupStarting( GroupInfo const& groupInfo ) { - for ( auto const& listener : m_listeners ) { - listener->testGroupStarting( groupInfo ); - } - m_reporter->testGroupStarting( groupInfo ); - } - - void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->testCaseStarting( testInfo ); } m_reporter->testCaseStarting( testInfo ); } + void + ListeningReporter::testCasePartialStarting( TestCaseInfo const& testInfo, + uint64_t partNumber ) { + for ( auto& listener : m_listeners ) { + listener->testCasePartialStarting( testInfo, partNumber ); + } + m_reporter->testCasePartialStarting( testInfo, partNumber ); + } + void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->sectionStarting( sectionInfo ); } m_reporter->sectionStarting( sectionInfo ); } void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->assertionStarting( assertionInfo ); } m_reporter->assertionStarting( assertionInfo ); } // The return value indicates if the messages buffer should be cleared: - bool ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) { - for( auto const& listener : m_listeners ) { - static_cast<void>( listener->assertionEnded( assertionStats ) ); + void ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) { + for( auto& listener : m_listeners ) { + listener->assertionEnded( assertionStats ); } - return m_reporter->assertionEnded( assertionStats ); + m_reporter->assertionEnded( assertionStats ); } void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->sectionEnded( sectionStats ); } m_reporter->sectionEnded( sectionStats ); } - void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { - for ( auto const& listener : m_listeners ) { - listener->testCaseEnded( testCaseStats ); + void ListeningReporter::testCasePartialEnded( TestCaseStats const& testInfo, + uint64_t partNumber ) { + for ( auto& listener : m_listeners ) { + listener->testCasePartialEnded( testInfo, partNumber ); } - m_reporter->testCaseEnded( testCaseStats ); + m_reporter->testCasePartialEnded( testInfo, partNumber ); } - void ListeningReporter::testGroupEnded( TestGroupStats const& testGroupStats ) { - for ( auto const& listener : m_listeners ) { - listener->testGroupEnded( testGroupStats ); + void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { + for ( auto& listener : m_listeners ) { + listener->testCaseEnded( testCaseStats ); } - m_reporter->testGroupEnded( testGroupStats ); + m_reporter->testCaseEnded( testCaseStats ); } void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->testRunEnded( testRunStats ); } m_reporter->testRunEnded( testRunStats ); @@ -135,28 +145,28 @@ namespace Catch { void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) { - for ( auto const& listener : m_listeners ) { + for ( auto& listener : m_listeners ) { listener->skipTest( testInfo ); } m_reporter->skipTest( testInfo ); } void ListeningReporter::listReporters(std::vector<ReporterDescription> const& descriptions) { - for (auto const& listener : m_listeners) { + for (auto& listener : m_listeners) { listener->listReporters(descriptions); } m_reporter->listReporters(descriptions); } void ListeningReporter::listTests(std::vector<TestCaseHandle> const& tests) { - for (auto const& listener : m_listeners) { + for (auto& listener : m_listeners) { listener->listTests(tests); } m_reporter->listTests(tests); } void ListeningReporter::listTags(std::vector<TagInfo> const& tags) { - for (auto const& listener : m_listeners) { + for (auto& listener : m_listeners) { listener->listTags(tags); } m_reporter->listTags(tags); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp index 88234cdc334bd2007f6cf1cbe9e60d71948c771e..caa5c1a84540ce176cd8bd313b28a102546a2545 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_listening.hpp @@ -30,26 +30,25 @@ namespace Catch { public: // IStreamingReporter - void noMatchingTestCases( std::string const& spec ) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; + void fatalErrorEncountered( StringRef error ) override; + void reportInvalidArguments( StringRef arg ) override; - void reportInvalidArguments(std::string const&arg) override; - - void benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override; void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override; - void benchmarkFailed(std::string const&) override; + void benchmarkFailed( StringRef error ) override; void testRunStarting( TestRunInfo const& testRunInfo ) override; - void testGroupStarting( GroupInfo const& groupInfo ) override; void testCaseStarting( TestCaseInfo const& testInfo ) override; + void testCasePartialStarting(TestCaseInfo const& testInfo, uint64_t partNumber) override; void sectionStarting( SectionInfo const& sectionInfo ) override; void assertionStarting( AssertionInfo const& assertionInfo ) override; - // The return value indicates if the messages buffer should be cleared: - bool assertionEnded( AssertionStats const& assertionStats ) override; + void assertionEnded( AssertionStats const& assertionStats ) override; void sectionEnded( SectionStats const& sectionStats ) override; + void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override; void testCaseEnded( TestCaseStats const& testCaseStats ) override; - void testGroupEnded( TestGroupStats const& testGroupStats ) override; void testRunEnded( TestRunStats const& testRunStats ) override; void skipTest( TestCaseInfo const& testInfo ) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp index 18ab3134eea90368184dcd2bc1c2193a2fae59c7..e09b51090491372899d7aa4b0fef3da448d19e52 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.cpp @@ -14,33 +14,28 @@ namespace Catch { - SonarQubeReporter::~SonarQubeReporter() {} - void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) { CumulativeReporterBase::testRunStarting(testRunInfo); xml.startElement("testExecutions"); - xml.writeAttribute("version", '1'); - } - - void SonarQubeReporter::testGroupEnded(TestGroupStats const& testGroupStats) { - CumulativeReporterBase::testGroupEnded(testGroupStats); - writeGroup(*m_testGroups.back()); + xml.writeAttribute("version"_sr, '1'); } - void SonarQubeReporter::writeGroup(TestGroupNode const& groupNode) { + void SonarQubeReporter::writeRun( TestRunNode const& runNode ) { std::map<std::string, std::vector<TestCaseNode const*>> testsPerFile; - for ( auto const& child : groupNode.children ) { + + for ( auto const& child : runNode.children ) { testsPerFile[child->value.testInfo->lineInfo.file].push_back( child.get() ); } - for (auto const& kv : testsPerFile) - writeTestFile(kv.first, kv.second); + for ( auto const& kv : testsPerFile ) { + writeTestFile( kv.first, kv.second ); + } } void SonarQubeReporter::writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes) { XmlWriter::ScopedElement e = xml.scopedElement("file"); - xml.writeAttribute("path", filename); + xml.writeAttribute("path"_sr, filename); for (auto const& child : testCaseNodes) writeTestCase(*child); @@ -61,8 +56,8 @@ namespace Catch { if (!sectionNode.assertions.empty() || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty()) { XmlWriter::ScopedElement e = xml.scopedElement("testCase"); - xml.writeAttribute("name", name); - xml.writeAttribute("duration", static_cast<long>(sectionNode.stats.durationInSeconds * 1000)); + xml.writeAttribute("name"_sr, name); + xml.writeAttribute("duration"_sr, static_cast<long>(sectionNode.stats.durationInSeconds * 1000)); writeAssertions(sectionNode, okToFail); } @@ -113,26 +108,26 @@ namespace Catch { XmlWriter::ScopedElement e = xml.scopedElement(elementName); ReusableStringStream messageRss; - messageRss << result.getTestMacroName() << "(" << result.getExpression() << ")"; - xml.writeAttribute("message", messageRss.str()); + messageRss << result.getTestMacroName() << '(' << result.getExpression() << ')'; + xml.writeAttribute("message"_sr, messageRss.str()); ReusableStringStream textRss; if (stats.totals.assertions.total() > 0) { textRss << "FAILED:\n"; if (result.hasExpression()) { - textRss << "\t" << result.getExpressionInMacro() << "\n"; + textRss << '\t' << result.getExpressionInMacro() << '\n'; } if (result.hasExpandedExpression()) { - textRss << "with expansion:\n\t" << result.getExpandedExpression() << "\n"; + textRss << "with expansion:\n\t" << result.getExpandedExpression() << '\n'; } } if (!result.getMessage().empty()) - textRss << result.getMessage() << "\n"; + textRss << result.getMessage() << '\n'; for (auto const& msg : stats.infoMessages) if (msg.type == ResultWas::Info) - textRss << msg.message << "\n"; + textRss << msg.message << '\n'; textRss << "at " << result.getSourceInfo(); xml.writeText(textRss.str(), XmlFormatting::Newline); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp index d46cb422d797876201d922dab03402cf63b8dc82..720c0ea0fb4f7b63c899cfa4b2c2ad11a9989686 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_sonarqube.hpp @@ -14,7 +14,7 @@ namespace Catch { - struct SonarQubeReporter : CumulativeReporterBase { + struct SonarQubeReporter final : CumulativeReporterBase { SonarQubeReporter(ReporterConfig const& config) : CumulativeReporterBase(config) @@ -23,24 +23,21 @@ namespace Catch { m_preferences.shouldReportAllAssertions = true; } - ~SonarQubeReporter() override; + ~SonarQubeReporter() override = default; static std::string getDescription() { using namespace std::string_literals; return "Reports test results in the Generic Test Data SonarQube XML format"s; } - void noMatchingTestCases(std::string const& /*spec*/) override {} - - void testRunStarting(TestRunInfo const& testRunInfo) override; - - void testGroupEnded(TestGroupStats const& testGroupStats) override; + void testRunStarting( TestRunInfo const& testRunInfo ) override; void testRunEndedCumulative() override { + writeRun( *m_testRun ); xml.endElement(); } - void writeGroup(TestGroupNode const& groupNode); + void writeRun( TestRunNode const& groupNode ); void writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes); diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp index d0b8ae9491d23778bde4a26f283ce2f70356aea5..1c2787ca01c31c23e5fdbde7739da2ac88b2784c 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.cpp @@ -17,18 +17,8 @@ namespace Catch { currentTestRunInfo = _testRunInfo; } - void - StreamingReporterBase::testGroupStarting( GroupInfo const& _groupInfo ) { - currentGroupInfo = _groupInfo; - } - - void StreamingReporterBase::testGroupEnded( TestGroupStats const& ) { - currentGroupInfo.reset(); - } - void StreamingReporterBase::testRunEnded( TestRunStats const& ) { currentTestCaseInfo = nullptr; - currentGroupInfo.reset(); currentTestRunInfo.reset(); } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp index b0f1dd4969700c8e06045a0462915392fdabb2d0..e7b6e5b3a61e761a35ac0ec7bea5fd9ee6ebec06 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_streaming_base.hpp @@ -42,28 +42,35 @@ namespace Catch { ~StreamingReporterBase() override; - void noMatchingTestCases(std::string const&) override {} + void benchmarkPreparing( StringRef ) override {} + void benchmarkStarting( BenchmarkInfo const& ) override {} + void benchmarkEnded( BenchmarkStats<> const& ) override {} + void benchmarkFailed( StringRef ) override {} - void reportInvalidArguments(std::string const&) override {} + void fatalErrorEncountered( StringRef /*error*/ ) override {} + void noMatchingTestCases( StringRef /*unmatchedSpec*/ ) override {} + void reportInvalidArguments( StringRef /*invalidArgument*/ ) override {} void testRunStarting( TestRunInfo const& _testRunInfo ) override; - void testGroupStarting( GroupInfo const& _groupInfo ) override; - void testCaseStarting(TestCaseInfo const& _testInfo) override { currentTestCaseInfo = &_testInfo; } + void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {} void sectionStarting(SectionInfo const& _sectionInfo) override { m_sectionStack.push_back(_sectionInfo); } + void assertionStarting( AssertionInfo const& ) override {} + void assertionEnded( AssertionStats const& ) override {} + void sectionEnded(SectionStats const& /* _sectionStats */) override { m_sectionStack.pop_back(); } + void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {} void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override { currentTestCaseInfo = nullptr; } - void testGroupEnded( TestGroupStats const& ) override; void testRunEnded( TestRunStats const& /* _testRunStats */ ) override; void skipTest(TestCaseInfo const&) override { @@ -78,7 +85,6 @@ namespace Catch { std::ostream& stream; LazyStat<TestRunInfo> currentTestRunInfo; - LazyStat<GroupInfo> currentGroupInfo; TestCaseInfo const* currentTestCaseInfo = nullptr; std::vector<SectionInfo> m_sectionStack; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp index 6b0d5f42025b0fb01f8a4c5fe1909819ddde05a7..46a0994da8dbd420aea42e7135c7dc17c9947af8 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.cpp @@ -168,7 +168,7 @@ namespace Catch { { Colour colourGuard(colour); - stream << " with " << pluralise(N, "message") << ':'; + stream << " with " << pluralise(N, "message"_sr) << ':'; } for (; itMessage != itEnd; ) { @@ -194,13 +194,11 @@ namespace Catch { } // End anonymous namespace - TAPReporter::~TAPReporter() {} - - void TAPReporter::noMatchingTestCases(std::string const& spec) { - stream << "# No test cases matched '" << spec << "'\n"; + void TAPReporter::noMatchingTestCases( StringRef unmatchedSpec ) { + stream << "# No test cases matched '" << unmatchedSpec << "'\n"; } - bool TAPReporter::assertionEnded(AssertionStats const& _assertionStats) { + void TAPReporter::assertionEnded(AssertionStats const& _assertionStats) { ++counter; stream << "# " << currentTestCaseInfo->name << '\n'; @@ -208,7 +206,6 @@ namespace Catch { printer.print(); stream << '\n' << std::flush; - return true; } void TAPReporter::testRunEnded(TestRunStats const& _testRunStats) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp index d8d3e9a4e1caa4e336b2809c0c1f91d723190173..e7c22cfa9c04147b2a5c6ae46de2e79711befb4a 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_tap.hpp @@ -12,24 +12,22 @@ namespace Catch { - struct TAPReporter : StreamingReporterBase { + struct TAPReporter final : StreamingReporterBase { TAPReporter( ReporterConfig const& config ): StreamingReporterBase( config ) { m_preferences.shouldReportAllAssertions = true; } - ~TAPReporter() override; + ~TAPReporter() override = default; static std::string getDescription() { using namespace std::string_literals; return "Reports test results in TAP format, suitable for test harnesses"s; } - void noMatchingTestCases(std::string const& spec) override; + void noMatchingTestCases( StringRef unmatchedSpec ) override; - void assertionStarting( AssertionInfo const& ) override {} - - bool assertionEnded(AssertionStats const& _assertionStats) override; + void assertionEnded(AssertionStats const& _assertionStats) override; void testRunEnded(TestRunStats const& _testRunStats) override; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp index 3a417bd48c9598f72dea5fe5ab553a90f556dc93..1972b8c49ffc60402e22484424bfe6a6a5ac0bc4 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.cpp @@ -31,8 +31,8 @@ namespace Catch { .initialIndent(indent) << '\n'; } - std::string escape(std::string const& str) { - std::string escaped = str; + std::string escape(StringRef str) { + std::string escaped = static_cast<std::string>(str); replaceInPlace(escaped, "|", "||"); replaceInPlace(escaped, "'", "|'"); replaceInPlace(escaped, "\n", "|n"); @@ -46,19 +46,17 @@ namespace Catch { TeamCityReporter::~TeamCityReporter() {} - void TeamCityReporter::testGroupStarting(GroupInfo const& groupInfo) { - StreamingReporterBase::testGroupStarting(groupInfo); - stream << "##teamcity[testSuiteStarted name='" - << escape(groupInfo.name) << "']\n"; + void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) { + stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name ) + << "']\n"; } - void TeamCityReporter::testGroupEnded(TestGroupStats const& testGroupStats) { - StreamingReporterBase::testGroupEnded(testGroupStats); + void TeamCityReporter::testRunEnded( TestRunStats const& runStats ) { stream << "##teamcity[testSuiteFinished name='" - << escape(testGroupStats.groupInfo.name) << "']\n"; + << escape( runStats.runInfo.name ) << "']\n"; } - bool TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { + void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { AssertionResult const& result = assertionStats.assertionResult; if (!result.isOk()) { @@ -126,7 +124,6 @@ namespace Catch { } } stream.flush(); - return true; } void TeamCityReporter::testCaseStarting(TestCaseInfo const& testInfo) { diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp index 300a1e9329765c09244db0b18081f77a5306ae28..7abe8185301f124640e3e71ccbabf1d3f54c5ced 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_teamcity.hpp @@ -20,7 +20,7 @@ namespace Catch { - struct TeamCityReporter : StreamingReporterBase { + struct TeamCityReporter final : StreamingReporterBase { TeamCityReporter( ReporterConfig const& _config ) : StreamingReporterBase( _config ) { @@ -34,17 +34,11 @@ namespace Catch { return "Reports test results as TeamCity service messages"s; } - void skipTest( TestCaseInfo const& /* testInfo */ ) override {} + void testRunStarting( TestRunInfo const& groupInfo ) override; + void testRunEnded( TestRunStats const& testGroupStats ) override; - void noMatchingTestCases( std::string const& /* spec */ ) override {} - void testGroupStarting(GroupInfo const& groupInfo) override; - void testGroupEnded(TestGroupStats const& testGroupStats) override; - - - void assertionStarting(AssertionInfo const&) override {} - - bool assertionEnded(AssertionStats const& assertionStats) override; + void assertionEnded(AssertionStats const& assertionStats) override; void sectionStarting(SectionInfo const& sectionInfo) override { m_headerPrintedForThisSection = false; diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp index 273a9689dc35c11b53c4506b2bb856436b00715c..4e2a9a34fc9ddb16aacb0206563f6db6e9eefc9f 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.cpp @@ -42,12 +42,8 @@ namespace Catch { void XmlReporter::writeSourceInfo( SourceLineInfo const& sourceInfo ) { m_xml - .writeAttribute( "filename", sourceInfo.file ) - .writeAttribute( "line", sourceInfo.line ); - } - - void XmlReporter::noMatchingTestCases( std::string const& s ) { - StreamingReporterBase::noMatchingTestCases( s ); + .writeAttribute( "filename"_sr, sourceInfo.file ) + .writeAttribute( "line"_sr, sourceInfo.line ); } void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) { @@ -55,27 +51,21 @@ namespace Catch { std::string stylesheetRef = getStylesheetRef(); if( !stylesheetRef.empty() ) m_xml.writeStylesheetRef( stylesheetRef ); - m_xml.startElement( "Catch" ); + m_xml.startElement( "Catch2TestRun" ); if( !m_config->name().empty() ) - m_xml.writeAttribute( "name", m_config->name() ); + m_xml.writeAttribute( "name"_sr, m_config->name() ); if (m_config->testSpec().hasFilters()) - m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) ); + m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) ); if( m_config->rngSeed() != 0 ) m_xml.scopedElement( "Randomness" ) - .writeAttribute( "seed", m_config->rngSeed() ); - } - - void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) { - StreamingReporterBase::testGroupStarting( groupInfo ); - m_xml.startElement( "Group" ) - .writeAttribute( "name", groupInfo.name ); + .writeAttribute( "seed"_sr, m_config->rngSeed() ); } void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) { StreamingReporterBase::testCaseStarting(testInfo); m_xml.startElement( "TestCase" ) - .writeAttribute( "name", trim( testInfo.name ) ) - .writeAttribute( "tags", testInfo.tagsAsString() ); + .writeAttribute( "name"_sr, trim( testInfo.name ) ) + .writeAttribute( "tags"_sr, testInfo.tagsAsString() ); writeSourceInfo( testInfo.lineInfo ); @@ -88,7 +78,7 @@ namespace Catch { StreamingReporterBase::sectionStarting( sectionInfo ); if( m_sectionDepth++ > 0 ) { m_xml.startElement( "Section" ) - .writeAttribute( "name", trim( sectionInfo.name ) ); + .writeAttribute( "name"_sr, trim( sectionInfo.name ) ); writeSourceInfo( sectionInfo.lineInfo ); m_xml.ensureTagClosed(); } @@ -96,7 +86,7 @@ namespace Catch { void XmlReporter::assertionStarting( AssertionInfo const& ) { } - bool XmlReporter::assertionEnded( AssertionStats const& assertionStats ) { + void XmlReporter::assertionEnded( AssertionStats const& assertionStats ) { AssertionResult const& result = assertionStats.assertionResult; @@ -117,14 +107,14 @@ namespace Catch { // Drop out if result was successful but we're not printing them. if( !includeResults && result.getResultType() != ResultWas::Warning ) - return true; + return; // Print the expression if there is one. if( result.hasExpression() ) { m_xml.startElement( "Expression" ) - .writeAttribute( "success", result.succeeded() ) - .writeAttribute( "type", result.getTestMacroName() ); + .writeAttribute( "success"_sr, result.succeeded() ) + .writeAttribute( "type"_sr, result.getTestMacroName() ); writeSourceInfo( result.getSourceInfo() ); @@ -150,7 +140,7 @@ namespace Catch { break; case ResultWas::Info: m_xml.scopedElement( "Info" ) - .writeText( result.getMessage() ); + .writeText( result.getMessage() ); break; case ResultWas::Warning: // Warning will already have been written @@ -167,20 +157,18 @@ namespace Catch { if( result.hasExpression() ) m_xml.endElement(); - - return true; } void XmlReporter::sectionEnded( SectionStats const& sectionStats ) { StreamingReporterBase::sectionEnded( sectionStats ); if( --m_sectionDepth > 0 ) { XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" ); - e.writeAttribute( "successes", sectionStats.assertions.passed ); - e.writeAttribute( "failures", sectionStats.assertions.failed ); - e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk ); + e.writeAttribute( "successes"_sr, sectionStats.assertions.passed ); + e.writeAttribute( "failures"_sr, sectionStats.assertions.failed ); + e.writeAttribute( "expectedFailures"_sr, sectionStats.assertions.failedButOk ); if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds ); + e.writeAttribute( "durationInSeconds"_sr, sectionStats.durationInSeconds ); m_xml.endElement(); } @@ -189,10 +177,10 @@ namespace Catch { void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) { StreamingReporterBase::testCaseEnded( testCaseStats ); XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" ); - e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() ); + e.writeAttribute( "success"_sr, testCaseStats.totals.assertions.allOk() ); if ( m_config->showDurations() == ShowDurations::Always ) - e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); + e.writeAttribute( "durationInSeconds"_sr, m_testCaseTimer.getElapsedSeconds() ); if( !testCaseStats.stdOut.empty() ) m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline ); @@ -202,73 +190,59 @@ namespace Catch { m_xml.endElement(); } - void XmlReporter::testGroupEnded( TestGroupStats const& testGroupStats ) { - StreamingReporterBase::testGroupEnded( testGroupStats ); - // TODO: Check testGroupStats.aborting and act accordingly. - m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testGroupStats.totals.assertions.passed ) - .writeAttribute( "failures", testGroupStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk ); - m_xml.scopedElement( "OverallResultsCases") - .writeAttribute( "successes", testGroupStats.totals.testCases.passed ) - .writeAttribute( "failures", testGroupStats.totals.testCases.failed ) - .writeAttribute( "expectedFailures", testGroupStats.totals.testCases.failedButOk ); - m_xml.endElement(); - } - void XmlReporter::testRunEnded( TestRunStats const& testRunStats ) { StreamingReporterBase::testRunEnded( testRunStats ); m_xml.scopedElement( "OverallResults" ) - .writeAttribute( "successes", testRunStats.totals.assertions.passed ) - .writeAttribute( "failures", testRunStats.totals.assertions.failed ) - .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk ); + .writeAttribute( "successes"_sr, testRunStats.totals.assertions.passed ) + .writeAttribute( "failures"_sr, testRunStats.totals.assertions.failed ) + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.assertions.failedButOk ); m_xml.scopedElement( "OverallResultsCases") - .writeAttribute( "successes", testRunStats.totals.testCases.passed ) - .writeAttribute( "failures", testRunStats.totals.testCases.failed ) - .writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk ); + .writeAttribute( "successes"_sr, testRunStats.totals.testCases.passed ) + .writeAttribute( "failures"_sr, testRunStats.totals.testCases.failed ) + .writeAttribute( "expectedFailures"_sr, testRunStats.totals.testCases.failedButOk ); m_xml.endElement(); } - void XmlReporter::benchmarkPreparing(std::string const& name) { + void XmlReporter::benchmarkPreparing( StringRef name ) { m_xml.startElement("BenchmarkResults") - .writeAttribute("name", name); + .writeAttribute("name"_sr, name); } void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) { - m_xml.writeAttribute("samples", info.samples) - .writeAttribute("resamples", info.resamples) - .writeAttribute("iterations", info.iterations) - .writeAttribute("clockResolution", info.clockResolution) - .writeAttribute("estimatedDuration", info.estimatedDuration) - .writeComment("All values in nano seconds"); + m_xml.writeAttribute("samples"_sr, info.samples) + .writeAttribute("resamples"_sr, info.resamples) + .writeAttribute("iterations"_sr, info.iterations) + .writeAttribute("clockResolution"_sr, info.clockResolution) + .writeAttribute("estimatedDuration"_sr, info.estimatedDuration) + .writeComment("All values in nano seconds"_sr); } void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) { m_xml.startElement("mean") - .writeAttribute("value", benchmarkStats.mean.point.count()) - .writeAttribute("lowerBound", benchmarkStats.mean.lower_bound.count()) - .writeAttribute("upperBound", benchmarkStats.mean.upper_bound.count()) - .writeAttribute("ci", benchmarkStats.mean.confidence_interval); + .writeAttribute("value"_sr, benchmarkStats.mean.point.count()) + .writeAttribute("lowerBound"_sr, benchmarkStats.mean.lower_bound.count()) + .writeAttribute("upperBound"_sr, benchmarkStats.mean.upper_bound.count()) + .writeAttribute("ci"_sr, benchmarkStats.mean.confidence_interval); m_xml.endElement(); m_xml.startElement("standardDeviation") - .writeAttribute("value", benchmarkStats.standardDeviation.point.count()) - .writeAttribute("lowerBound", benchmarkStats.standardDeviation.lower_bound.count()) - .writeAttribute("upperBound", benchmarkStats.standardDeviation.upper_bound.count()) - .writeAttribute("ci", benchmarkStats.standardDeviation.confidence_interval); + .writeAttribute("value"_sr, benchmarkStats.standardDeviation.point.count()) + .writeAttribute("lowerBound"_sr, benchmarkStats.standardDeviation.lower_bound.count()) + .writeAttribute("upperBound"_sr, benchmarkStats.standardDeviation.upper_bound.count()) + .writeAttribute("ci"_sr, benchmarkStats.standardDeviation.confidence_interval); m_xml.endElement(); m_xml.startElement("outliers") - .writeAttribute("variance", benchmarkStats.outlierVariance) - .writeAttribute("lowMild", benchmarkStats.outliers.low_mild) - .writeAttribute("lowSevere", benchmarkStats.outliers.low_severe) - .writeAttribute("highMild", benchmarkStats.outliers.high_mild) - .writeAttribute("highSevere", benchmarkStats.outliers.high_severe); + .writeAttribute("variance"_sr, benchmarkStats.outlierVariance) + .writeAttribute("lowMild"_sr, benchmarkStats.outliers.low_mild) + .writeAttribute("lowSevere"_sr, benchmarkStats.outliers.low_severe) + .writeAttribute("highMild"_sr, benchmarkStats.outliers.high_mild) + .writeAttribute("highSevere"_sr, benchmarkStats.outliers.high_severe); m_xml.endElement(); m_xml.endElement(); } - void XmlReporter::benchmarkFailed(std::string const &error) { + void XmlReporter::benchmarkFailed(StringRef error) { m_xml.scopedElement("failed"). - writeAttribute("message", error); + writeAttribute("message"_sr, error); m_xml.endElement(); } @@ -320,7 +294,7 @@ namespace Catch { auto aliasTag = m_xml.scopedElement("Aliases"); for (auto const& alias : tag.spellings) { m_xml.startElement("Alias", XmlFormatting::Indent) - .writeText(static_cast<std::string>(alias), XmlFormatting::None) + .writeText(alias, XmlFormatting::None) .endElement(XmlFormatting::Newline); } } diff --git a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp index dbcaaa93221a8ae8c04b3e2d14d40ff4fa2380e3..46dd667a90d0d6e4ca300cc9470696fcf30bd245 100644 --- a/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp +++ b/packages/Catch2/src/catch2/reporters/catch_reporter_xml.hpp @@ -29,32 +29,26 @@ namespace Catch { public: // StreamingReporterBase - void noMatchingTestCases(std::string const& s) override; - void testRunStarting(TestRunInfo const& testInfo) override; - void testGroupStarting(GroupInfo const& groupInfo) override; - void testCaseStarting(TestCaseInfo const& testInfo) override; void sectionStarting(SectionInfo const& sectionInfo) override; void assertionStarting(AssertionInfo const&) override; - bool assertionEnded(AssertionStats const& assertionStats) override; + void assertionEnded(AssertionStats const& assertionStats) override; void sectionEnded(SectionStats const& sectionStats) override; void testCaseEnded(TestCaseStats const& testCaseStats) override; - void testGroupEnded(TestGroupStats const& testGroupStats) override; - void testRunEnded(TestRunStats const& testRunStats) override; - void benchmarkPreparing(std::string const& name) override; + void benchmarkPreparing( StringRef name ) override; void benchmarkStarting(BenchmarkInfo const&) override; void benchmarkEnded(BenchmarkStats<> const&) override; - void benchmarkFailed(std::string const&) override; + void benchmarkFailed( StringRef error ) override; void listReporters(std::vector<ReporterDescription> const& descriptions) override; void listTests(std::vector<TestCaseHandle> const& tests) override; diff --git a/packages/Catch2/tests/CMakeLists.txt b/packages/Catch2/tests/CMakeLists.txt index f8bdb3b4d05978beb03b853e2ab88ca4b766b1a8..7f7c32fe7e37d2aa477ee491ca414e2fc52f92ac 100644 --- a/packages/Catch2/tests/CMakeLists.txt +++ b/packages/Catch2/tests/CMakeLists.txt @@ -1,5 +1,66 @@ include(MiscFunctions) +if (CATCH_BUILD_SURROGATES) + message(STATUS "Configuring targets for surrogate TUs") + + # If the folder does not exist before we ask for output redirect to + # a file, it won't work. + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/surrogates) + + # Creates target to generate the surrogate TU for provided header. + # Returns the path to the generated file. + function(createSurrogateFileTarget sourceHeader pathToFile) + set(pathPrefix ${PROJECT_SOURCE_DIR}/src) + + file(RELATIVE_PATH includePath ${pathPrefix} ${sourceHeader}) + + get_filename_component(basicFileName "${sourceHeader}" NAME_WE) + + set(surrogateFilePath ${CMAKE_CURRENT_BINARY_DIR}/surrogates/surrogate_${basicFileName}.cpp) + + add_custom_command( + OUTPUT ${surrogateFilePath} + COMMAND cmake -E echo "\#include <${includePath}>" > "${surrogateFilePath}" + VERBATIM + ) + + set(${pathToFile} ${surrogateFilePath} PARENT_SCOPE) + endfunction() + + # Extracts all non-helper (e.g. catch_all.hpp) headers from the + # Catch2 target, and returns them through the argument. + function(ExtractCatch2Headers OutArg) + get_target_property(targetSources Catch2 SOURCES) + foreach(Source ${targetSources}) + string(REGEX MATCH "^.*\\.hpp$" isHeader ${Source}) + string(REGEX MATCH "_all.hpp" isAllHeader ${Source}) + if(isHeader AND NOT isAllHeader) + list(APPEND AllHeaders ${Source}) + endif() + endforeach() + set(${OutArg} ${AllHeaders} PARENT_SCOPE) + endfunction() + + + ExtractCatch2Headers(mainHeaders) + + if (NOT mainHeaders) + message(FATAL_ERROR "No headers in the main target were detected. Something is broken.") + endif() + + foreach(header ${mainHeaders}) + createSurrogateFileTarget(${header} pathToGeneratedFile) + list(APPEND surrogateFiles ${pathToGeneratedFile}) + endforeach() + + + add_executable(Catch2SurrogateTarget + ${surrogateFiles} + ) + target_link_libraries(Catch2SurrogateTarget PRIVATE Catch2WithMain) + +endif(CATCH_BUILD_SURROGATES) + #### # Temporary workaround for VS toolset changes in 2017 # We need to disable <UseFullPaths> property, but CMake doesn't support it @@ -19,6 +80,7 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/IntrospectiveTests/Clara.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/CmdLine.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Details.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/FloatingPoint.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/GeneratorsImpl.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/InternalBenchmark.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/PartTracker.tests.cpp @@ -253,6 +315,60 @@ add_test(NAME CheckConvenienceHeaders ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tools/scripts/checkConvenienceHeaders.py ) + +add_test(NAME "Benchmarking::FailureReporting::OptimizedOut" + COMMAND + $<TARGET_FILE:SelfTest> "Failing benchmarks" -c "empty" -r xml + # This test only makes sense with the optimizer being enabled when + # the tests are being compiled. + CONFIGURATIONS Release +) +set_tests_properties("Benchmarking::FailureReporting::OptimizedOut" + PROPERTIES + PASS_REGULAR_EXPRESSION "could not measure benchmark\, maybe it was optimized away" + FAIL_REGULAR_EXPRESSION "successes=\"1\"" +) + +add_test(NAME "Benchmarking::FailureReporting::ThrowingBenchmark" + COMMAND + $<TARGET_FILE:SelfTest> "Failing benchmarks" -c "throw" -r xml +) +set_tests_properties("Benchmarking::FailureReporting::ThrowingBenchmark" + PROPERTIES + PASS_REGULAR_EXPRESSION "<failed message=\"just a plain literal" + FAIL_REGULAR_EXPRESSION "successes=\"1\"" +) + +add_test(NAME "Benchmarking::FailureReporting::FailedAssertion" + COMMAND + $<TARGET_FILE:SelfTest> "Failing benchmarks" -c "assert" -r xml +) +set_tests_properties("Benchmarking::FailureReporting::FailedAssertion" + PROPERTIES + PASS_REGULAR_EXPRESSION "<Expression success=\"false\"" + FAIL_REGULAR_EXPRESSION "successes=\"1\"" +) + +add_test(NAME "Benchmarking::FailureReporting::FailMacro" + COMMAND + $<TARGET_FILE:SelfTest> "Failing benchmarks" -c "fail" -r xml +) +set_tests_properties("Benchmarking::FailureReporting::FailMacro" + PROPERTIES + PASS_REGULAR_EXPRESSION "This benchmark only fails\, nothing else" + FAIL_REGULAR_EXPRESSION "successes=\"1\"" +) + +add_test(NAME "Benchmarking::FailureReporting::ShouldFailIsRespected" + COMMAND + $<TARGET_FILE:SelfTest> "Failing benchmark respects should-fail" +) +set_tests_properties("Benchmarking::FailureReporting::ShouldFailIsRespected" + PROPERTIES + PASS_REGULAR_EXPRESSION "1 failed as expected" +) + + if (CATCH_USE_VALGRIND) add_test(NAME ValgrindRunTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest>) add_test(NAME ValgrindListTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest> --list-tests --verbosity high) diff --git a/packages/Catch2/tests/ExtraTests/CMakeLists.txt b/packages/Catch2/tests/ExtraTests/CMakeLists.txt index 62319b380b9ecb4a5b9b33c3e2fab3f38a79b44d..bce10df5b284b070a86270b324a25a44189b60b2 100644 --- a/packages/Catch2/tests/ExtraTests/CMakeLists.txt +++ b/packages/Catch2/tests/ExtraTests/CMakeLists.txt @@ -11,11 +11,11 @@ message( STATUS "Extra tests included" ) # The MinDuration reporting tests do not need separate compilation, but # they have non-trivial execution time, so they are categorized as # extra tests, so that they are run less. -add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.245 [min_duration_test]) +add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.950 [min_duration_test]) set_tests_properties( MinDuration::SimpleThreshold PROPERTIES - PASS_REGULAR_EXPRESSION "s: sleep_for_250ms" + PASS_REGULAR_EXPRESSION "s: sleep_for_1000ms" FAIL_REGULAR_EXPRESSION "sleep_for_100ms" RUN_SERIAL ON # The test is timing sensitive, so we want to run it # serially to avoid false positives on oversubscribed machines @@ -172,6 +172,63 @@ if (MSVC) list(APPEND CATCH_WARNING_TARGETS ${EXTRA_TEST_BINARIES} WindowsHeader) endif() + +add_executable(PartialTestCaseEvents ${TESTS_DIR}/X21-PartialTestCaseEvents.cpp) +target_link_libraries(PartialTestCaseEvents PRIVATE Catch2WithMain) +add_test( + NAME PartialTestCaseEvents + COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tests/TestScripts/testPartialTestCaseEvent.py $<TARGET_FILE:PartialTestCaseEvents> +) + + +add_executable(DuplicatedTestCases-SameNameAndTags ${TESTS_DIR}/X31-DuplicatedTestCases.cpp) +target_link_libraries(DuplicatedTestCases-SameNameAndTags PRIVATE Catch2::Catch2WithMain) +add_test( + NAME DuplicatedTestCases::SameNameAndTags + COMMAND $<TARGET_FILE:DuplicatedTestCases-SameNameAndTags> +) +set_tests_properties( + DuplicatedTestCases::SameNameAndTags + PROPERTIES + PASS_REGULAR_EXPRESSION "error: .* already defined\\." +) + +add_executable(DuplicatedTestCases-SameNameDifferentTags ${TESTS_DIR}/X32-DuplicatedTestCasesDifferentTags.cpp) +target_link_libraries(DuplicatedTestCases-SameNameDifferentTags PRIVATE Catch2::Catch2WithMain) +add_test( + NAME DuplicatedTestCases::SameNameDifferentTags + COMMAND $<TARGET_FILE:DuplicatedTestCases-SameNameDifferentTags> +) +set_tests_properties( + DuplicatedTestCases::SameNameDifferentTags + PROPERTIES + FAIL_REGULAR_EXPRESSION "error: .* already defined\\." +) + +add_executable(DuplicatedTestCases-DuplicatedTestCaseMethods ${TESTS_DIR}/X33-DuplicatedTestCaseMethods.cpp) +target_link_libraries(DuplicatedTestCases-DuplicatedTestCaseMethods PRIVATE Catch2::Catch2WithMain) +add_test( + NAME DuplicatedTestCases::DuplicatedTestCaseMethods + COMMAND $<TARGET_FILE:DuplicatedTestCases-DuplicatedTestCaseMethods> +) +set_tests_properties( + DuplicatedTestCases::DuplicatedTestCaseMethods + PROPERTIES + PASS_REGULAR_EXPRESSION "error: .* already defined\\." +) + +add_executable(DuplicatedTestCases-DifferentFixtures ${TESTS_DIR}/X34-DuplicatedTestCaseMethodsDifferentFixtures.cpp) +target_link_libraries(DuplicatedTestCases-DifferentFixtures PRIVATE Catch2::Catch2WithMain) +add_test( + NAME DuplicatedTestCases::DuplicatedTestCaseMethodsDifferentFixtures + COMMAND $<TARGET_FILE:DuplicatedTestCases-DifferentFixtures> +) +set_tests_properties( + DuplicatedTestCases::DuplicatedTestCaseMethodsDifferentFixtures + PROPERTIES + FAIL_REGULAR_EXPRESSION "error: .* already defined\\." +) + #add_executable(DebugBreakMacros ${TESTS_DIR}/X12-CustomDebugBreakMacro.cpp) #target_link_libraries(DebugBreakMacros Catch2) #add_test(NAME DebugBreakMacros COMMAND DebugBreakMacros --break) @@ -188,6 +245,10 @@ set( EXTRA_TEST_BINARIES DisabledExceptions-CustomHandler FallbackStringifier DisableStringification + PartialTestCaseEvents + DuplicatedTestCases-SameNameAndTags + DuplicatedTestCases-SameNameDifferentTags + DuplicatedTestCases-DuplicatedTestCaseMethods # DebugBreakMacros ) diff --git a/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp b/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp new file mode 100644 index 0000000000000000000000000000000000000000..997b9b9f3cf23739b08fc27be460fe0de9beefcf --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X21-PartialTestCaseEvents.cpp @@ -0,0 +1,74 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Registers custom reporter that reports testCase* events + * + * The resulting executable can then be used by an external Python script + * to verify that testCase{Starting,Ended} and testCasePartial{Starting,Ended} + * events are properly nested. + */ + + +#include <catch2/catch_test_macros.hpp> +#include <catch2/reporters/catch_reporter_streaming_base.hpp> +#include <catch2/catch_test_case_info.hpp> +#include <catch2/catch_reporter_registrars.hpp> +#include <catch2/generators/catch_generators.hpp> + + +#include <iostream> + +using Catch::TestCaseInfo; +using Catch::TestCaseStats; + +class PartialReporter : public Catch::StreamingReporterBase { +public: + using StreamingReporterBase::StreamingReporterBase; + + ~PartialReporter() override; // = default + + static std::string getDescription() { + return "Special reporter for testing TestCasePartialStarting/Ended events"; + } + + //! Called _once_ for each TEST_CASE, no matter how many times it is entered + void testCaseStarting(TestCaseInfo const& testInfo) override { + std::cout << "TestCaseStarting: " << testInfo.name << '\n'; + } + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + void testCasePartialStarting(TestCaseInfo const& testInfo, uint64_t partNumber) override { + std::cout << "TestCaseStartingPartial: " << testInfo.name << '#' << partNumber << '\n'; + } + + + //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections) + void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber) override { + std::cout << "TestCasePartialEnded: " << testCaseStats.testInfo->name << '#' << partNumber << '\n'; + } + //! Called _once_ for each TEST_CASE, no matter how many times it is entered + void testCaseEnded(TestCaseStats const& testCaseStats) override { + std::cout << "TestCaseEnded: " << testCaseStats.testInfo->name << '\n'; + } +}; +PartialReporter::~PartialReporter() = default; + + +CATCH_REGISTER_REPORTER("partial", PartialReporter) + +TEST_CASE("section") { + SECTION("A") {} + SECTION("B") {} + SECTION("C") {} + SECTION("D") {} +} + +TEST_CASE("generator") { + auto _ = GENERATE(1, 2, 3, 4); + (void)_; +} diff --git a/packages/Catch2/tests/ExtraTests/X31-DuplicatedTestCases.cpp b/packages/Catch2/tests/ExtraTests/X31-DuplicatedTestCases.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2235ca8396d57363625ae5e831fc8bea50489139 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X31-DuplicatedTestCases.cpp @@ -0,0 +1,16 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that test cases with identical name and tags are reported as error + */ + +#include <catch2/catch_test_macros.hpp> + +TEST_CASE("A test case with duplicated name and tags", "[tag1][tag2]") {} +TEST_CASE("A test case with duplicated name and tags", "[tag1][tag2]") {} diff --git a/packages/Catch2/tests/ExtraTests/X32-DuplicatedTestCasesDifferentTags.cpp b/packages/Catch2/tests/ExtraTests/X32-DuplicatedTestCasesDifferentTags.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a4246be51be9bc2549c58f71c113693b8485cd4 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X32-DuplicatedTestCasesDifferentTags.cpp @@ -0,0 +1,17 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that test cases with identical name but different tags are + * not reported as an error. + */ + +#include <catch2/catch_test_macros.hpp> + +TEST_CASE("A test case with duplicated name but different tags", "[tag1]") {} +TEST_CASE("A test case with duplicated name but different tags", "[tag2]") {} diff --git a/packages/Catch2/tests/ExtraTests/X33-DuplicatedTestCaseMethods.cpp b/packages/Catch2/tests/ExtraTests/X33-DuplicatedTestCaseMethods.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff6660a8a1c478f279a6611d8ffec2b6a64cac10 --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X33-DuplicatedTestCaseMethods.cpp @@ -0,0 +1,22 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that test case methods with identical class, name and tags are + * reported as error. + */ + +#include <catch2/catch_test_macros.hpp> + +class TestCaseFixture { +public: + int m_a; +}; + +TEST_CASE_METHOD(TestCaseFixture, "A test case with duplicated name and tags", "[tag1]") {} +TEST_CASE_METHOD(TestCaseFixture, "A test case with duplicated name and tags", "[tag1]") {} diff --git a/packages/Catch2/tests/ExtraTests/X34-DuplicatedTestCaseMethodsDifferentFixtures.cpp b/packages/Catch2/tests/ExtraTests/X34-DuplicatedTestCaseMethodsDifferentFixtures.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2021f5fbff85fa564d82d138c8bb298969f456c --- /dev/null +++ b/packages/Catch2/tests/ExtraTests/X34-DuplicatedTestCaseMethodsDifferentFixtures.cpp @@ -0,0 +1,27 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +/**\file + * Checks that test case methods with different class, but same name and + * tags name and tags are not reported as error. + */ + +#include <catch2/catch_test_macros.hpp> + +class TestCaseFixture1 { +public: + int m_a; +}; + +class TestCaseFixture2 { +public: + int m_a; +}; + +TEST_CASE_METHOD(TestCaseFixture1, "A test case with duplicated name and tags", "[tag1]") {} +TEST_CASE_METHOD(TestCaseFixture2, "A test case with duplicated name and tags", "[tag1]") {} diff --git a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt index 983d97648460c4d43cb32b32b0150f6cedf0ca06..5d599b6efac9828ca918af303ab3c4a2140c945f 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -24,6 +24,8 @@ Nor would this :test-result: PASS #1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0 :test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0 :test-result: PASS #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 +:test-result: PASS #2152 - ULP checks between differently signed values were wrong - double +:test-result: PASS #2152 - ULP checks between differently signed values were wrong - float :test-result: XFAIL #748 - captures with unexpected exceptions :test-result: PASS #809 :test-result: PASS #833 @@ -205,6 +207,9 @@ Message from section two :test-result: PASS String matchers :test-result: PASS StringRef :test-result: PASS StringRef at compilation time +:test-result: PASS Stringifying char arrays with statically known sizes - char +:test-result: PASS Stringifying char arrays with statically known sizes - signed char +:test-result: PASS Stringifying char arrays with statically known sizes - unsigned char :test-result: PASS Stringifying std::chrono::duration helpers :test-result: PASS Stringifying std::chrono::duration with weird ratios :test-result: PASS Stringifying std::chrono::time_point<system_clock> @@ -231,6 +236,9 @@ Message from section two :test-result: PASS Test case with one argument :test-result: PASS Test enum bit values :test-result: PASS Test with special, characters "in name +:test-result: PASS Testing checked-if +:test-result: XFAIL Testing checked-if 2 +:test-result: XFAIL Testing checked-if 3 :test-result: FAIL The NO_FAIL macro reports a failure but does not fail the test :test-result: PASS The default listing implementation write to provided stream :test-result: FAIL This test 'should' fail but doesn't @@ -263,6 +271,7 @@ Message from section two :test-result: PASS X/level/1/a :test-result: PASS X/level/1/b :test-result: PASS XmlEncode +:test-result: PASS XmlWriter writes boolean attributes as true/false :test-result: PASS analyse no analysis :test-result: PASS array<int, N> -> toString :test-result: PASS atomic if @@ -275,6 +284,8 @@ Message from section two :test-result: PASS classify_outliers :test-result: PASS comparisons between const int variables :test-result: PASS comparisons between int variables +:test-result: PASS convertToBits +:test-result: PASS empty tags are not allowed :test-result: PASS erfc_inv :test-result: PASS estimate_clock_resolution :test-result: PASS even more nested SECTION tests @@ -336,6 +347,7 @@ loose text artifact :test-result: PASS stringify( vectors<has_operator> ) :test-result: PASS strlen3 :test-result: PASS tables +:test-result: PASS tags with dots in later positions are not parsed as hidden :test-result: FAIL thrown std::strings are translated :test-result: PASS toString on const wchar_t const pointer returns the string contents :test-result: PASS toString on const wchar_t pointer returns the string contents diff --git a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt index 3b19a962d734709564684e6491a3ce42bbad944a..556db26166f4eb203ca15903d7f08e132e6002f8 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -80,6 +80,10 @@ PartTracker.tests.cpp:<line number>: passed: n for: 3 Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) +Matchers.tests.cpp:<line number>: passed: smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42' with 1 message: 'expected exception' Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'answer := 42'; expression was: thisThrows() with 1 message: 'expected exception' Exception.tests.cpp:<line number>: passed: thisThrows() with 1 message: 'answer := 42' @@ -290,10 +294,10 @@ Approx.tests.cpp:<line number>: passed: 0 == Approx( dZero) for: 0 == Approx( 0. Approx.tests.cpp:<line number>: passed: 0 == Approx( dSmall ).margin( 0.001 ) for: 0 == Approx( 0.00001 ) Approx.tests.cpp:<line number>: passed: 1.234f == Approx( dMedium ) for: 1.234f == Approx( 1.234 ) Approx.tests.cpp:<line number>: passed: dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 ) -Matchers.tests.cpp:<line number>: passed: 1, Predicate<int>(alwaysTrue, "always true") for: 1 matches predicate: "always true" -Matchers.tests.cpp:<line number>: passed: 1, !Predicate<int>(alwaysFalse, "always false") for: 1 not matches predicate: "always false" -Matchers.tests.cpp:<line number>: passed: "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") for: "Hello olleH" matches predicate: "First and last character should be equal" -Matchers.tests.cpp:<line number>: passed: "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate +Matchers.tests.cpp:<line number>: passed: 1, Predicate<int>( alwaysTrue, "always true" ) for: 1 matches predicate: "always true" +Matchers.tests.cpp:<line number>: passed: 1, !Predicate<int>( alwaysFalse, "always false" ) for: 1 not matches predicate: "always false" +Matchers.tests.cpp:<line number>: passed: "Hello olleH", Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); }, "First and last character should be equal" ) for: "Hello olleH" matches predicate: "First and last character should be equal" +Matchers.tests.cpp:<line number>: passed: "This wouldn't pass", !Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate Compilation.tests.cpp:<line number>: passed: lhs | rhs for: Val: 1 | Val: 2 Compilation.tests.cpp:<line number>: passed: !(lhs & rhs) for: !(Val: 1 & Val: 2) Compilation.tests.cpp:<line number>: passed: HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1 @@ -346,41 +350,41 @@ ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 4 == 4 ToStringGeneral.tests.cpp:<line number>: passed: c == i for: 5 == 5 Clara.tests.cpp:<line number>: passed: name.empty() for: true Clara.tests.cpp:<line number>: passed: name == "foo" for: "foo" == "foo" -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: 1, (MatcherA() && MatcherB()) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, MatcherA() && (MatcherB() && MatcherC()) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, (MatcherA() && MatcherB()) && (MatcherC() && MatcherD()) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, (MatcherA() || MatcherB()) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, MatcherA() || (MatcherB() || MatcherC()) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, (MatcherA() || MatcherB()) || (MatcherC() || MatcherD()) for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' +Matchers.tests.cpp:<line number>: passed: 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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: 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f -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<decltype( !!MatcherA() ), MatcherA const&>::value' Matchers.tests.cpp:<line number>: passed: 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f -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< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' Matchers.tests.cpp:<line number>: passed: 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f -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<decltype( !!!!MatcherA() ), MatcherA const&>::value' Matchers.tests.cpp:<line number>: passed: 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f -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<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: 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f 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<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' Matchers.tests.cpp:<line number>: passed: 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f 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" ) -Matchers.tests.cpp:<line number>: passed: str, StartsWith("foo") && !EqualsRange(bad_arr) && EndsWith("bar") for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) -Matchers.tests.cpp:<line number>: passed: str, EqualsRange(arr) && StartsWith("foo") && EndsWith("bar") for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) -Matchers.tests.cpp:<line number>: passed: str, !EqualsRange(bad_arr) && StartsWith("foo") && EndsWith("bar") for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) -Matchers.tests.cpp:<line number>: passed: str, EqualsRange(bad_arr) || (StartsWith("foo") && EndsWith("bar")) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) -Matchers.tests.cpp:<line number>: passed: str, (StartsWith("foo") && EndsWith("bar")) || EqualsRange(bad_arr) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) -Matchers.tests.cpp:<line number>: passed: container, EqualsRange(a) || EqualsRange(b) || EqualsRange(c) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) +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" ) +Matchers.tests.cpp:<line number>: passed: str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +Matchers.tests.cpp:<line number>: passed: str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) +Matchers.tests.cpp:<line number>: passed: str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) +Matchers.tests.cpp:<line number>: passed: container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) Tricky.tests.cpp:<line number>: passed: std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} Tricky.tests.cpp:<line number>: passed: std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} Tricky.tests.cpp:<line number>: passed: std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} @@ -434,7 +438,7 @@ Condition.tests.cpp:<line number>: passed: (std::numeric_limits<uint32_t>::max)( Matchers.tests.cpp:<line number>: passed: !(matcher.match( 1 )) for: !false Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true -Matchers.tests.cpp:<line number>: passed: matcher.match(1) for: true +Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true Matchers.tests.cpp:<line number>: passed: !(matcher.match( 1 )) for: !false @@ -443,8 +447,8 @@ Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true Matchers.tests.cpp:<line number>: passed: matcher.match( 1 ) for: true Matchers.tests.cpp:<line number>: passed: first.matchCalled for: true Matchers.tests.cpp:<line number>: passed: !second.matchCalled for: true -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains("STRING") for: "this string contains 'abc' as a substring" contains: "STRING" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Contains( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1 Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1 Generators.tests.cpp:<line number>: passed: elem % 2 == 1 for: 1 == 1 @@ -469,8 +473,8 @@ ToString.tests.cpp:<line number>: passed: enumInfo->lookup(1) == "Value2" for: V ToString.tests.cpp:<line number>: passed: enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **} == "{** unexpected enum value **}" -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith("Substring") for: "this string contains 'abc' as a substring" ends with: "Substring" -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1" EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value2 ) == "Value2" for: "Value2" == "Value2" EnumToString.tests.cpp:<line number>: passed: stringify( EnumClass3::Value3 ) == "Value3" for: "Value3" == "Value3" @@ -501,10 +505,10 @@ Condition.tests.cpp:<line number>: passed: data.str_hello == "hello" for: "hello Condition.tests.cpp:<line number>: passed: "hello" == data.str_hello for: "hello" == "hello" Condition.tests.cpp:<line number>: passed: data.str_hello.size() == 5 for: 5 == 5 Condition.tests.cpp:<line number>: passed: x == Approx( 1.3 ) for: 1.3 == Approx( 1.3 ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this string contains 'abc' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("this string contains 'ABC' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method" == "This exception has overridden what() method" @@ -512,24 +516,24 @@ ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(Oper ToStringGeneral.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" for: "StringMakerException" == "StringMakerException" -Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1} -Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1} -Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1} -Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1} -Matchers.tests.cpp:<line number>: failed: throwsSpecialException(3), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 -Matchers.tests.cpp:<line number>: failed: throwsSpecialException(4), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 -Matchers.tests.cpp:<line number>: passed: throwsSpecialException(1), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 -Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, ExceptionMatcher{2} for: SpecialException::what special exception has value of 2 +Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } +Matchers.tests.cpp:<line number>: failed: expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } +Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } +Matchers.tests.cpp:<line number>: failed: unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } +Matchers.tests.cpp:<line number>: failed: throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +Matchers.tests.cpp:<line number>: failed: throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 +Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } for: SpecialException::what special exception has value of 2 Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" Exception.tests.cpp:<line number>: passed: thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) for: "expected exception" equals: "expected exception" (case insensitive) Exception.tests.cpp:<line number>: passed: thisThrows(), StartsWith( "expected" ) for: "expected exception" starts with: "expected" Exception.tests.cpp:<line number>: passed: thisThrows(), EndsWith( "exception" ) for: "expected exception" ends with: "exception" Exception.tests.cpp:<line number>: passed: thisThrows(), Contains( "except" ) for: "expected exception" contains: "except" Exception.tests.cpp:<line number>: passed: thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) -Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, Message("DerivedException::what") for: DerivedException::what exception message matches "DerivedException::what" -Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, !Message("derivedexception::what") for: DerivedException::what not exception message matches "derivedexception::what" -Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, !Message("DerivedException::what") for: SpecialException::what not exception message matches "DerivedException::what" -Matchers.tests.cpp:<line number>: passed: throwsSpecialException(2), SpecialException, Message("SpecialException::what") for: SpecialException::what exception message matches "SpecialException::what" +Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" +Matchers.tests.cpp:<line number>: passed: throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what" +Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what" +Matchers.tests.cpp:<line number>: passed: throwsSpecialException( 2 ), SpecialException, Message( "SpecialException::what" ) for: SpecialException::what exception message matches "SpecialException::what" Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows(), std::string Exception.tests.cpp:<line number>: failed: expected exception, got none; expression was: thisDoesntThrow(), std::domain_error Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'expected exception'; expression was: thisThrows() @@ -542,66 +546,67 @@ Misc.tests.cpp:<line number>: passed: Factorial(1) == 1 for: 1 == 1 Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2 Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6 Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) -Matchers.tests.cpp:<line number>: passed: 10., WithinRel(11.1, 0.1) for: 10.0 and 11.1 are within 10% of each other -Matchers.tests.cpp:<line number>: passed: 10., !WithinRel(11.2, 0.1) for: 10.0 not and 11.2 are within 10% of each other -Matchers.tests.cpp:<line number>: passed: 1., !WithinRel(0., 0.99) for: 1.0 not and 0 are within 99% of each other -Matchers.tests.cpp:<line number>: passed: -0., WithinRel(0.) for: -0.0 and 0 are within 2.22045e-12% of each other -Matchers.tests.cpp:<line number>: passed: v1, WithinRel(v2) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other -Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(1., 0) for: 1.0 is within 0.0 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0., WithinAbs(1., 1) for: 0.0 is within 1.0 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0 -Matchers.tests.cpp:<line number>: passed: 11., !WithinAbs(10., 0.5) for: 11.0 not is within 0.5 of 10.0 -Matchers.tests.cpp:<line number>: passed: 10., !WithinAbs(11., 0.5) for: 10.0 not is within 0.5 of 11.0 -Matchers.tests.cpp:<line number>: passed: -10., WithinAbs(-10., 0.5) for: -10.0 is within 0.5 of -10.0 -Matchers.tests.cpp:<line number>: passed: -10., WithinAbs(-9.6, 0.5) for: -10.0 is within 0.5 of -9.6 -Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) -Matchers.tests.cpp:<line number>: passed: nextafter(1., 2.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) -Matchers.tests.cpp:<line number>: passed: 0., WithinULP(nextafter(0., 1.), 1) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) -Matchers.tests.cpp:<line number>: passed: 1., WithinULP(nextafter(1., 0.), 1) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) -Matchers.tests.cpp:<line number>: passed: 1., !WithinULP(nextafter(1., 2.), 0) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) -Matchers.tests.cpp:<line number>: passed: 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) -Matchers.tests.cpp:<line number>: passed: -0., WithinULP(0., 0) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) -Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(1., 0.5) || WithinULP(2., 1) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) -Matchers.tests.cpp:<line number>: passed: 1., WithinAbs(2., 0.5) || WithinULP(1., 0) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) -Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) -Matchers.tests.cpp:<line number>: passed: WithinAbs(1., 0.) -Matchers.tests.cpp:<line number>: passed: WithinAbs(1., -1.), std::domain_error -Matchers.tests.cpp:<line number>: passed: WithinULP(1., 0) -Matchers.tests.cpp:<line number>: passed: WithinRel(1., 0.) -Matchers.tests.cpp:<line number>: passed: WithinRel(1., -0.2), std::domain_error -Matchers.tests.cpp:<line number>: passed: WithinRel(1., 1.), std::domain_error -Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel(11.1f, 0.1f) for: 10.0f and 11.1 are within 10% of each other -Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel(11.2f, 0.1f) for: 10.0f not and 11.2 are within 10% of each other -Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel(0.f, 0.99f) for: 1.0f not and 0 are within 99% of each other -Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel(0.f) for: -0.0f and 0 are within 0.00119209% of each other -Matchers.tests.cpp:<line number>: passed: v1, WithinRel(v2) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other -Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(1.f, 0) for: 1.0f is within 0.0 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs(1.f, 1) for: 0.0f is within 1.0 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0 -Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs(-0.f, 0) for: 0.0f is within 0.0 of -0.0 -Matchers.tests.cpp:<line number>: passed: 11.f, !WithinAbs(10.f, 0.5f) for: 11.0f not is within 0.5 of 10.0 -Matchers.tests.cpp:<line number>: passed: 10.f, !WithinAbs(11.f, 0.5f) for: 10.0f not is within 0.5 of 11.0 -Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs(-10.f, 0.5f) for: -10.0f is within 0.5 of -10.0 -Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs(-9.6f, 0.5f) for: -10.0f is within 0.5 of -9.6000003815 -Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) -Matchers.tests.cpp:<line number>: passed: nextafter(1.f, 2.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) -Matchers.tests.cpp:<line number>: passed: 0.f, WithinULP(nextafter(0.f, 1.f), 1) for: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) -Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(nextafter(1.f, 0.f), 1) for: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) -Matchers.tests.cpp:<line number>: passed: 1.f, !WithinULP(nextafter(1.f, 2.f), 0) for: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) -Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) -Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP(0.f, 0) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) -Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) -Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) -Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) -Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, 0.f) -Matchers.tests.cpp:<line number>: passed: WithinAbs(1.f, -1.f), std::domain_error -Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, 0) -Matchers.tests.cpp:<line number>: passed: WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error -Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, 0.f) -Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, -0.2f), std::domain_error -Matchers.tests.cpp:<line number>: passed: WithinRel(1.f, 1.f), std::domain_error +Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 +Matchers.tests.cpp:<line number>: passed: 11., !WithinAbs( 10., 0.5 ) for: 11.0 not is within 0.5 of 10.0 +Matchers.tests.cpp:<line number>: passed: 10., !WithinAbs( 11., 0.5 ) for: 10.0 not is within 0.5 of 11.0 +Matchers.tests.cpp:<line number>: passed: -10., WithinAbs( -10., 0.5 ) for: -10.0 is within 0.5 of -10.0 +Matchers.tests.cpp:<line number>: passed: -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.6 +Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) +Matchers.tests.cpp:<line number>: passed: 0., WithinULP( nextafter( 0., 1. ), 1 ) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) +Matchers.tests.cpp:<line number>: passed: 1., WithinULP( nextafter( 1., 0. ), 1 ) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: 1., !WithinULP( nextafter( 1., 2. ), 0 ) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) +Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) +Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) +Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) +Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., 0. ) +Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., -1. ), std::domain_error +Matchers.tests.cpp:<line number>: passed: WithinULP( 1., 0 ) +Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 0. ) +Matchers.tests.cpp:<line number>: passed: WithinRel( 1., -0.2 ), std::domain_error +Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 1. ), std::domain_error +Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other +Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other +Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other +Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 +Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs( -0.f, 0 ) for: 0.0f is within 0.0 of -0.0 +Matchers.tests.cpp:<line number>: passed: 11.f, !WithinAbs( 10.f, 0.5f ) for: 11.0f not is within 0.5 of 10.0 +Matchers.tests.cpp:<line number>: passed: 10.f, !WithinAbs( 11.f, 0.5f ) for: 10.0f not is within 0.5 of 11.0 +Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs( -10.f, 0.5f ) for: -10.0f is within 0.5 of -10.0 +Matchers.tests.cpp:<line number>: passed: -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.6000003815 +Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +Matchers.tests.cpp:<line number>: passed: -1.f, WithinULP( -1.f, 0 ) for: -1.0f is within 0 ULPs of -1.00000000e+00f ([-1.00000000e+00, -1.00000000e+00]) +Matchers.tests.cpp:<line number>: passed: nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) +Matchers.tests.cpp:<line number>: passed: 0.f, WithinULP( nextafter( 0.f, 1.f ), 1 ) for: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) +Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( nextafter( 1.f, 0.f ), 1 ) for: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) +Matchers.tests.cpp:<line number>: passed: 1.f, !WithinULP( nextafter( 1.f, 2.f ), 0 ) for: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) +Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) +Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) +Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) +Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, 0.f ) +Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, -1.f ), std::domain_error +Matchers.tests.cpp:<line number>: passed: WithinULP( 1.f, 0 ) +Matchers.tests.cpp:<line number>: passed: WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error +Matchers.tests.cpp:<line number>: passed: WithinRel( 1.f, 0.f ) +Matchers.tests.cpp:<line number>: passed: WithinRel( 1.f, -0.2f ), std::domain_error +Matchers.tests.cpp:<line number>: passed: WithinRel( 1.f, 1.f ), std::domain_error Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0 @@ -899,13 +904,13 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.23 ) for: 1.23 <= Approx( Approx.tests.cpp:<line number>: passed: !(d <= Approx( 1.22 )) for: !(1.23 <= Approx( 1.22 )) Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) Misc.tests.cpp:<line number>: passed: with 1 message: 'was called' -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") || Contains("different") || Contains("random") for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains("different") for: "this string contains 'abc' as a substring" not contains: "different" -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), !Contains( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), !Contains( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" Exception.tests.cpp:<line number>: passed: thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" Exception.tests.cpp:<line number>: failed: thisThrows(), "should fail" for: "expected exception" equals: "should fail" Generators.tests.cpp:<line number>: passed: values > -6 for: 3 > -6 @@ -1014,10 +1019,10 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: rng() == 0x<hex digits> 4261393167 (0x<hex digits>) Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Message from section one' Message.tests.cpp:<line number>: failed: explicitly with 1 message: 'Message from section two' -Matchers.tests.cpp:<line number>: passed: (EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed +Matchers.tests.cpp:<line number>: passed: ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed Matchers.tests.cpp:<line number>: passed: &EvilMatcher(), EvilAddressOfOperatorUsed -Matchers.tests.cpp:<line number>: passed: EvilMatcher() || (EvilMatcher() && !EvilMatcher()) -Matchers.tests.cpp:<line number>: passed: (EvilMatcher() && EvilMatcher()) || !EvilMatcher() +Matchers.tests.cpp:<line number>: passed: EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) +Matchers.tests.cpp:<line number>: passed: ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() CmdLine.tests.cpp:<line number>: passed: spec.hasFilters() == false for: false == false CmdLine.tests.cpp:<line number>: passed: spec.matches( *tcA ) == false for: false == false CmdLine.tests.cpp:<line number>: passed: spec.matches( *tcB ) == false for: false == false @@ -1181,7 +1186,7 @@ ToStringGeneral.tests.cpp:<line number>: passed: str1.size() == 3 + 5 for: 8 == ToStringGeneral.tests.cpp:<line number>: passed: str2.size() == 3 + 10 for: 13 == 13 ToStringGeneral.tests.cpp:<line number>: passed: str1.size() == 2 + 5 for: 7 == 7 ToStringGeneral.tests.cpp:<line number>: passed: str2.size() == 2 + 15 for: 17 == 17 -Matchers.tests.cpp:<line number>: passed: "foo", Predicate<const char*>([] (const char* const&) { return true; }) for: "foo" matches undescribed predicate +Matchers.tests.cpp:<line number>: passed: "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) for: "foo" matches undescribed predicate CmdLine.tests.cpp:<line number>: passed: result for: {?} CmdLine.tests.cpp:<line number>: passed: config.processName == "" for: "" == "" CmdLine.tests.cpp:<line number>: passed: result for: {?} @@ -1269,10 +1274,10 @@ Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: Misc.tests.cpp:<line number>: passed: std::tuple_size<TestType>::value >= 1 for: 1 >= 1 ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }" Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy! -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches("this string contains 'abc' as a") for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively -Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals(expected) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively +Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false Reporters.tests.cpp:<line number>: passed: listingString, Contains("fakeTag"s) for: "All available tags: 1 [fakeTag] @@ -1464,46 +1469,40 @@ Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.22 for: Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 Message from section one Message from section two -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith("This String") for: "this string contains 'abc' as a substring" starts with: "This String" -Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith( "This String" ) for: "this string contains 'abc' as a substring" starts with: "This String" +Matchers.tests.cpp:<line number>: failed: testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(singular) == "{ 1 }" for: "{ 1 }" == "{ 1 }" ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, 1 }" == "{ 3, 2, 1 }" ToStringGeneral.tests.cpp:<line number>: passed: Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" for: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" == "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string") for: "this string contains 'abc' as a substring" contains: "string" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("abc") for: "this string contains 'abc' as a substring" contains: "abc" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith("this") for: "this string contains 'abc' as a substring" starts with: "this" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith("substring") for: "this string contains 'abc' as a substring" ends with: "substring" -Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "string" ) for: "this string contains 'abc' as a substring" contains: "string" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring" +Matchers.tests.cpp:<line number>: passed: testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) String.tests.cpp:<line number>: passed: empty.empty() for: true String.tests.cpp:<line number>: passed: empty.size() == 0 for: 0 == 0 -String.tests.cpp:<line number>: passed: empty.isNullTerminated() for: true -String.tests.cpp:<line number>: passed: std::strcmp( empty.c_str(), "" ) == 0 for: 0 == 0 +String.tests.cpp:<line number>: passed: std::strcmp( empty.data(), "" ) == 0 for: 0 == 0 String.tests.cpp:<line number>: passed: s.empty() == false for: false == false String.tests.cpp:<line number>: passed: s.size() == 5 for: 5 == 5 -String.tests.cpp:<line number>: passed: s.isNullTerminated() for: true String.tests.cpp:<line number>: passed: std::strcmp( rawChars, "hello" ) == 0 for: 0 == 0 -String.tests.cpp:<line number>: passed: s.c_str() -String.tests.cpp:<line number>: passed: s.c_str() == rawChars for: "hello" == "hello" String.tests.cpp:<line number>: passed: s.data() == rawChars for: "hello" == "hello" String.tests.cpp:<line number>: passed: original == "original" -String.tests.cpp:<line number>: passed: !(original.isNullTerminated()) for: !false -String.tests.cpp:<line number>: passed: original.c_str() String.tests.cpp:<line number>: passed: original.data() String.tests.cpp:<line number>: passed: ss.empty() == false for: false == false String.tests.cpp:<line number>: passed: ss.size() == 5 for: 5 == 5 String.tests.cpp:<line number>: passed: std::strncmp( ss.data(), "hello", 5 ) == 0 for: 0 == 0 String.tests.cpp:<line number>: passed: ss == "hello" for: hello == "hello" String.tests.cpp:<line number>: passed: ss.size() == 6 for: 6 == 6 -String.tests.cpp:<line number>: passed: std::strcmp( ss.c_str(), "world!" ) == 0 for: 0 == 0 +String.tests.cpp:<line number>: passed: std::strcmp( ss.data(), "world!" ) == 0 for: 0 == 0 String.tests.cpp:<line number>: passed: s.data() == s2.data() for: "hello world!" == "hello world!" String.tests.cpp:<line number>: passed: s.data() == ss.data() for: "hello world!" == "hello world!" String.tests.cpp:<line number>: passed: s.substr(s.size() + 1, 123).empty() for: true -String.tests.cpp:<line number>: passed: std::strcmp(ss.c_str(), "world!") == 0 for: 0 == 0 +String.tests.cpp:<line number>: passed: std::strcmp(ss.data(), "world!") == 0 for: 0 == 0 String.tests.cpp:<line number>: passed: s.substr(1'000'000, 1).empty() for: true String.tests.cpp:<line number>: passed: reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) for: "Hello" != "Hello" String.tests.cpp:<line number>: passed: left == right for: Hello == Hello @@ -1525,7 +1524,6 @@ String.tests.cpp:<line number>: passed: together == "abrakadabra" for: "abrakada String.tests.cpp:<line number>: passed: with 1 message: 'empty.size() == 0' String.tests.cpp:<line number>: passed: with 1 message: 'empty.begin() == empty.end()' String.tests.cpp:<line number>: passed: with 1 message: 'stringref.size() == 3' -String.tests.cpp:<line number>: passed: with 1 message: 'stringref.isNullTerminated()' String.tests.cpp:<line number>: passed: with 1 message: 'stringref.data() == abc' String.tests.cpp:<line number>: passed: with 1 message: 'stringref.begin() == abc' String.tests.cpp:<line number>: passed: with 1 message: 'stringref.begin() != stringref.end()' @@ -1535,14 +1533,16 @@ String.tests.cpp:<line number>: passed: with 1 message: 'stringref[1] == 'b'' String.tests.cpp:<line number>: passed: with 1 message: 'shortened.size() == 2' String.tests.cpp:<line number>: passed: with 1 message: 'shortened.data() == abc' String.tests.cpp:<line number>: passed: with 1 message: 'shortened.begin() != shortened.end()' -String.tests.cpp:<line number>: passed: with 1 message: '!(shortened.isNullTerminated())' -String.tests.cpp:<line number>: passed: with 1 message: '!(shortened.substr(1, 3).isNullTerminated())' String.tests.cpp:<line number>: passed: with 1 message: '!(sr1.empty())' String.tests.cpp:<line number>: passed: with 1 message: 'sr1.size() == 3' -String.tests.cpp:<line number>: passed: with 1 message: 'sr1.isNullTerminated()' String.tests.cpp:<line number>: passed: with 1 message: 'sr2.empty()' String.tests.cpp:<line number>: passed: with 1 message: 'sr2.size() == 0' -String.tests.cpp:<line number>: passed: with 1 message: 'sr2.isNullTerminated()' +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +ToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" ToStringChrono.tests.cpp:<line number>: passed: minute == seconds for: 1 m == 60 s ToStringChrono.tests.cpp:<line number>: passed: hour != seconds for: 1 h != 60 s ToStringChrono.tests.cpp:<line number>: passed: micro != milli for: 1 us != 1 ms @@ -1725,6 +1725,16 @@ Misc.tests.cpp:<line number>: passed: v.capacity() >= V for: 15 >= 15 VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions' Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 CmdLine.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: passed: +Misc.tests.cpp:<line number>: passed: true +Misc.tests.cpp:<line number>: failed: explicitly +Misc.tests.cpp:<line number>: failed - but was ok: false +Misc.tests.cpp:<line number>: failed: explicitly Message.tests.cpp:<line number>: failed - but was ok: 1 == 2 Reporters.tests.cpp:<line number>: passed: listingString, Contains("[fakeTag]"s) for: "All available tags: 1 [fakeTag] @@ -1900,53 +1910,53 @@ Approx.tests.cpp:<line number>: passed: approx( d ) == 1.22 for: Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: approx( d ) == 1.24 for: Approx( 1.23 ) == 1.24 Approx.tests.cpp:<line number>: passed: approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25 VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions' -Matchers.tests.cpp:<line number>: passed: empty, Approx(empty) for: { } is approx: { } -Matchers.tests.cpp:<line number>: passed: v1, Approx(v1) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } -Matchers.tests.cpp:<line number>: passed: v1, Approx<double>({ 1., 2., 3. }) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } -Matchers.tests.cpp:<line number>: passed: v1, !Approx(temp) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } -Matchers.tests.cpp:<line number>: passed: v1, !Approx(v2) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } -Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).margin(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } -Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).epsilon(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } -Matchers.tests.cpp:<line number>: passed: v1, Approx(v2).epsilon(0.1).scale(500) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } -Matchers.tests.cpp:<line number>: failed: empty, Approx(t1) for: { } is approx: { 1.0, 2.0 } -Matchers.tests.cpp:<line number>: failed: v1, Approx(v2) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } -Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) for: { 1, 2, 3 } Contains: 1 -Matchers.tests.cpp:<line number>: passed: v, VectorContains(2) for: { 1, 2, 3 } Contains: 2 -Matchers.tests.cpp:<line number>: passed: v5, (VectorContains<int, CustomAllocator<int>>(2)) for: { 1, 2, 3 } Contains: 2 -Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2 } -Matchers.tests.cpp:<line number>: passed: v, Contains<int>({ 1, 2 }) for: { 1, 2, 3 } Contains: { 1, 2 } -Matchers.tests.cpp:<line number>: passed: v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2 } -Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v, Contains(empty) for: { 1, 2, 3 } Contains: { } -Matchers.tests.cpp:<line number>: passed: empty, Contains(empty) for: { } Contains: { } -Matchers.tests.cpp:<line number>: passed: v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v5, Contains(v6) for: { 1, 2, 3 } Contains: { 1, 2 } -Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) && VectorContains(2) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) -Matchers.tests.cpp:<line number>: passed: v, Equals(v) for: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: empty, Equals(empty) for: { } Equals: { } -Matchers.tests.cpp:<line number>: passed: v, Equals<int>({ 1, 2, 3 }) for: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v5, Equals(v6) for: { 1, 2, 3 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals(v) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals<int>({ 3, 2, 1 }) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } -Matchers.tests.cpp:<line number>: passed: empty, UnorderedEquals(empty) for: { } UnorderedEquals: { } -Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: passed: v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } -Matchers.tests.cpp:<line number>: passed: v5_permuted, UnorderedEquals(v5) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: v, VectorContains(-1) for: { 1, 2, 3 } Contains: -1 -Matchers.tests.cpp:<line number>: failed: empty, VectorContains(1) for: { } Contains: 1 -Matchers.tests.cpp:<line number>: failed: empty, Contains(v) for: { } Contains: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 4 } -Matchers.tests.cpp:<line number>: failed: v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2 } -Matchers.tests.cpp:<line number>: failed: v2, Equals(v) for: { 1, 2 } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: empty, Equals(v) for: { } Equals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: v, Equals(empty) for: { 1, 2, 3 } Equals: { } -Matchers.tests.cpp:<line number>: failed: v, UnorderedEquals(empty) for: { 1, 2, 3 } UnorderedEquals: { } -Matchers.tests.cpp:<line number>: failed: empty, UnorderedEquals(v) for: { } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals(v) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 } -Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals(v) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: empty, Approx( empty ) for: { } is approx: { } +Matchers.tests.cpp:<line number>: passed: v1, Approx( v1 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +Matchers.tests.cpp:<line number>: passed: v1, Approx<double>( { 1., 2., 3. } ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +Matchers.tests.cpp:<line number>: passed: v1, !Approx( temp ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } +Matchers.tests.cpp:<line number>: passed: v1, !Approx( v2 ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } +Matchers.tests.cpp:<line number>: passed: v1, Approx( v2 ).margin( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +Matchers.tests.cpp:<line number>: passed: v1, Approx( v2 ).epsilon( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +Matchers.tests.cpp:<line number>: passed: v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +Matchers.tests.cpp:<line number>: failed: empty, Approx( t1 ) for: { } is approx: { 1.0, 2.0 } +Matchers.tests.cpp:<line number>: failed: v1, Approx( v2 ) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } +Matchers.tests.cpp:<line number>: passed: v, VectorContains( 1 ) for: { 1, 2, 3 } Contains: 1 +Matchers.tests.cpp:<line number>: passed: v, VectorContains( 2 ) for: { 1, 2, 3 } Contains: 2 +Matchers.tests.cpp:<line number>: passed: v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) for: { 1, 2, 3 } Contains: 2 +Matchers.tests.cpp:<line number>: passed: v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2 } +Matchers.tests.cpp:<line number>: passed: v, Contains<int>( { 1, 2 } ) for: { 1, 2, 3 } Contains: { 1, 2 } +Matchers.tests.cpp:<line number>: passed: v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2 } +Matchers.tests.cpp:<line number>: passed: v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v, Contains( empty ) for: { 1, 2, 3 } Contains: { } +Matchers.tests.cpp:<line number>: passed: empty, Contains( empty ) for: { } Contains: { } +Matchers.tests.cpp:<line number>: passed: v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, Contains( v6 ) for: { 1, 2, 3 } Contains: { 1, 2 } +Matchers.tests.cpp:<line number>: passed: v, VectorContains( 1 ) && VectorContains( 2 ) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) +Matchers.tests.cpp:<line number>: passed: v, Equals( v ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: empty, Equals( empty ) for: { } Equals: { } +Matchers.tests.cpp:<line number>: passed: v, Equals<int>( { 1, 2, 3 } ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, Equals( v6 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals( v ) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals<int>( { 3, 2, 1 } ) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } +Matchers.tests.cpp:<line number>: passed: empty, UnorderedEquals( empty ) for: { } UnorderedEquals: { } +Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals( v ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals( v ) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: passed: v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } +Matchers.tests.cpp:<line number>: passed: v5_permuted, UnorderedEquals( v5 ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: v, VectorContains( -1 ) for: { 1, 2, 3 } Contains: -1 +Matchers.tests.cpp:<line number>: failed: empty, VectorContains( 1 ) for: { } Contains: 1 +Matchers.tests.cpp:<line number>: failed: empty, Contains( v ) for: { } Contains: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 4 } +Matchers.tests.cpp:<line number>: failed: v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2 } +Matchers.tests.cpp:<line number>: failed: v2, Equals( v ) for: { 1, 2 } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: empty, Equals( v ) for: { } Equals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: v, Equals( empty ) for: { 1, 2, 3 } Equals: { } +Matchers.tests.cpp:<line number>: failed: v, UnorderedEquals( empty ) for: { 1, 2, 3 } UnorderedEquals: { } +Matchers.tests.cpp:<line number>: failed: empty, UnorderedEquals( v ) for: { } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals( v ) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 } +Matchers.tests.cpp:<line number>: failed: permuted, UnorderedEquals( v ) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 } Exception.tests.cpp:<line number>: passed: thisThrows(), std::domain_error Exception.tests.cpp:<line number>: passed: thisDoesntThrow() Exception.tests.cpp:<line number>: passed: thisThrows() @@ -1977,6 +1987,9 @@ Xml.tests.cpp:<line number>: passed: encode( stringWithQuotes, Catch::XmlEncode: "don't "quote" me on that" Xml.tests.cpp:<line number>: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" Xml.tests.cpp:<line number>: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" +Xml.tests.cpp:<line number>: passed: stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> +<Element1 attr1="true" attr2="false"/> +" ( contains: "attr1="true"" and contains: "attr2="false"" ) InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.point.count() == 23 for: 23.0 == 23 InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.lower_bound.count() == 23 for: 23.0 == 23 InternalBenchmark.tests.cpp:<line number>: passed: analysis.mean.upper_bound.count() == 23 for: 23.0 == 23 @@ -2007,11 +2020,11 @@ InternalBenchmark.tests.cpp:<line number>: passed: called == 1 for: 1 == 1 Tricky.tests.cpp:<line number>: passed: obj.prop != 0 for: 0x<hex digits> != 0 Misc.tests.cpp:<line number>: passed: flag for: true Misc.tests.cpp:<line number>: passed: testCheckedElse( true ) for: true -Misc.tests.cpp:<line number>: failed: flag for: false +Misc.tests.cpp:<line number>: failed - but was ok: flag for: false Misc.tests.cpp:<line number>: failed: testCheckedElse( false ) for: false Misc.tests.cpp:<line number>: passed: flag for: true Misc.tests.cpp:<line number>: passed: testCheckedIf( true ) for: true -Misc.tests.cpp:<line number>: failed: flag for: false +Misc.tests.cpp:<line number>: failed - but was ok: flag for: false Misc.tests.cpp:<line number>: failed: testCheckedIf( false ) for: false InternalBenchmark.tests.cpp:<line number>: passed: o.samples_seen == static_cast<int>(x.size()) for: 6 == 6 InternalBenchmark.tests.cpp:<line number>: passed: o.low_severe == los for: 0 == 0 @@ -2057,6 +2070,17 @@ Condition.tests.cpp:<line number>: passed: long_var == unsigned_char_var for: 1 Condition.tests.cpp:<line number>: passed: long_var == unsigned_short_var for: 1 == 1 Condition.tests.cpp:<line number>: passed: long_var == unsigned_int_var for: 1 == 1 Condition.tests.cpp:<line number>: passed: long_var == unsigned_long_var for: 1 == 1 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( 0.f ) == 0 for: 0 == 0 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( -0.f ) == ( 1ULL << 31 ) for: 2147483648 (0x<hex digits>) +== +2147483648 (0x<hex digits>) +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( 0. ) == 0 for: 0 == 0 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( -0. ) == ( 1ULL << 63 ) for: 9223372036854775808 (0x<hex digits>) +== +9223372036854775808 (0x<hex digits>) +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 for: 1 == 1 +FloatingPoint.tests.cpp:<line number>: passed: convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.0920368762 == Approx( -0.0920368762 ) InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(1.067400) == Approx(-0.05980291115763361) for: -0.0598029112 == Approx( -0.0598029112 ) InternalBenchmark.tests.cpp:<line number>: passed: erfc_inv(0.050000) == Approx(1.38590382434967796) for: 1.3859038243 == Approx( 1.3859038243 ) @@ -2254,6 +2278,8 @@ Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_ Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 Generators.tests.cpp:<line number>: passed: strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 +Tag.tests.cpp:<line number>: passed: testcase.tags.size() == 1 for: 1 == 1 +Tag.tests.cpp:<line number>: passed: testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag Exception.tests.cpp:<line number>: failed: unexpected exception with message: 'Why would you throw a std::string?' Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" Misc.tests.cpp:<line number>: passed: result == "\"wide load\"" for: ""wide load"" == ""wide load"" @@ -2353,5 +2379,5 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: passed: -Failed 86 test cases, failed 148 assertions. +Failed 86 test cases, failed 146 assertions. diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt index d781a60e316cc38de07ed386f0f6acb40c282ba7..8704f8b373385c0d6b778d9b731a3bc19844e0aa 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.std.approved.txt @@ -332,13 +332,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("STRING") ) + CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -381,12 +381,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) + CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "Substring" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) @@ -469,13 +469,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) @@ -488,11 +488,11 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) because no exception was thrown where one was expected: Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) because no exception was thrown where one was expected: ------------------------------------------------------------------------------- @@ -503,12 +503,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) due to unexpected exception with message: Unknown exception Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) due to unexpected exception with message: Unknown exception @@ -520,12 +520,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 @@ -678,7 +678,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") ) + CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -690,7 +690,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), !Contains("substring") ) + CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" @@ -865,19 +865,19 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) + CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) ) with expansion: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively @@ -894,12 +894,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("This String") ) + CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "This String" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) @@ -922,6 +922,22 @@ with expansion: } " +------------------------------------------------------------------------------- +Testing checked-if 2 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Testing checked-if 3 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: FAILED: + ------------------------------------------------------------------------------- Thrown string literals are translated ------------------------------------------------------------------------------- @@ -950,7 +966,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Approx(t1) ) + CHECK_THAT( empty, Approx( t1 ) ) with expansion: { } is approx: { 1.0, 2.0 } @@ -962,7 +978,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v1, Approx(v2) ) + CHECK_THAT( v1, Approx( v2 ) ) with expansion: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } @@ -974,12 +990,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, VectorContains(-1) ) + CHECK_THAT( v, VectorContains( -1 ) ) with expansion: { 1, 2, 3 } Contains: -1 Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, VectorContains(1) ) + CHECK_THAT( empty, VectorContains( 1 ) ) with expansion: { } Contains: 1 @@ -991,12 +1007,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Contains(v) ) + CHECK_THAT( empty, Contains( v ) ) with expansion: { } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 4 } @@ -1008,22 +1024,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Equals(v2) ) + CHECK_THAT( v, Equals( v2 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v2, Equals(v) ) + CHECK_THAT( v2, Equals( v ) ) with expansion: { 1, 2 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Equals(v) ) + CHECK_THAT( empty, Equals( v ) ) with expansion: { } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Equals(empty) ) + CHECK_THAT( v, Equals( empty ) ) with expansion: { 1, 2, 3 } Equals: { } @@ -1035,22 +1051,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, UnorderedEquals(empty) ) + CHECK_THAT( v, UnorderedEquals( empty ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, UnorderedEquals(v) ) + CHECK_THAT( empty, UnorderedEquals( v ) ) with expansion: { } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 1, 3 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 3, 1 } UnorderedEquals: { 1, 2, 3 } @@ -1135,11 +1151,6 @@ checkedElse, failing Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: FAILED: - CHECKED_ELSE( flag ) -with expansion: - false - Misc.tests.cpp:<line number>: FAILED: REQUIRE( testCheckedElse( false ) ) with expansion: @@ -1151,11 +1162,6 @@ checkedIf, failing Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: FAILED: - CHECKED_IF( flag ) -with expansion: - false - Misc.tests.cpp:<line number>: FAILED: REQUIRE( testCheckedIf( false ) ) with expansion: @@ -1380,6 +1386,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 356 | 282 passed | 70 failed | 4 failed as expected -assertions: 2088 | 1936 passed | 131 failed | 21 failed as expected +test cases: 368 | 292 passed | 70 failed | 6 failed as expected +assertions: 2103 | 1951 passed | 129 failed | 23 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt index 7066d5938ed8da7966b7430a1916b9ed0cc79455..08cef9ace3d04e517a50191c4466ac7fe89d7520 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.sw.approved.txt @@ -744,6 +744,41 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - double +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, + 4.9406564584124654e-324]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e- + 324, -0.0000000000000000e+00]) + +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - float +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0. + 00000000e+00]) + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -2409,12 +2444,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, Predicate<int>(alwaysTrue, "always true") ) + REQUIRE_THAT( 1, Predicate<int>( alwaysTrue, "always true" ) ) with expansion: 1 matches predicate: "always true" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, !Predicate<int>(alwaysFalse, "always false") ) + REQUIRE_THAT( 1, !Predicate<int>( alwaysFalse, "always false" ) ) with expansion: 1 not matches predicate: "always false" @@ -2426,12 +2461,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") ) + REQUIRE_THAT( "Hello olleH", Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); }, "First and last character should be equal" ) ) with expansion: "Hello olleH" matches predicate: "First and last character should be equal" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) ) + REQUIRE_THAT( "This wouldn't pass", !Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); } ) ) with expansion: "This wouldn't pass" not matches undescribed predicate @@ -2881,34 +2916,34 @@ 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< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch:: + Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, (MatcherA() && MatcherB()) && MatcherC() ) + REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) 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< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch:: + Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, MatcherA() && (MatcherB() && MatcherC()) ) + REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype((MatcherA() && MatcherB()) && (MatcherC() && MatcherD - ())), Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, - MatcherC, MatcherD> >::value + std::is_same< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && + MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, + MatcherB, MatcherC, MatcherD>>:: value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, (MatcherA() && MatcherB()) && (MatcherC() && MatcherD()) ) + REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) @@ -2921,34 +2956,34 @@ 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< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch:: + Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, (MatcherA() || MatcherB()) || MatcherC() ) + REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) 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< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch:: + Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, MatcherA() || (MatcherB() || MatcherC()) ) + REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype((MatcherA() || MatcherB()) || (MatcherC() || MatcherD - ())), Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, - MatcherC, MatcherD> >::value + std::is_same< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || + MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, + MatcherB, MatcherC, MatcherD>>:: value Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1, (MatcherA() || MatcherB()) || (MatcherC() || MatcherD()) ) + REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ) with expansion: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) @@ -2961,8 +2996,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< decltype( !MatcherA() ), Catch::Matchers::Detail:: + MatchNotOfGeneric<MatcherA>>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0, !MatcherA() ) @@ -2971,7 +3006,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(!!MatcherA()), MatcherA const& >::value + std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, !!MatcherA() ) @@ -2980,8 +3015,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< decltype( !!!MatcherA() ), Catch::Matchers::Detail:: + MatchNotOfGeneric<MatcherA>>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 0, !!!MatcherA() ) @@ -2990,7 +3025,7 @@ with expansion: Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(!!!!MatcherA()), MatcherA const & >::value + std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, !!!!MatcherA() ) @@ -3005,9 +3040,9 @@ Matchers.tests.cpp:<line number> Matchers.tests.cpp:<line number>: PASSED: with message: - std::is_same< decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith - ("bar") && !EndsWith("foo"))), Catch::Matchers::Detail::MatchAnyOf<std:: - string> >::value + std::is_same<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && + EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail:: + MatchAnyOf<std::string>>::value ------------------------------------------------------------------------------- Combining only templated matchers @@ -3017,8 +3052,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<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB>>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || MatcherB() ) @@ -3027,8 +3062,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<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB>>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() && MatcherB() ) @@ -3037,9 +3072,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< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail: + :MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric + <MatcherB>>>::value Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THAT( 1, MatcherA() || !MatcherB() ) @@ -3053,43 +3088,43 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 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) ) + REQUIRE_THAT( 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 ) ) with expansion: { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, StartsWith("foo") && EqualsRange(arr) && EndsWith("bar") ) + REQUIRE_THAT( str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) ) with expansion: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, StartsWith("foo") && !EqualsRange(bad_arr) && EndsWith("bar") ) + REQUIRE_THAT( str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) ) with expansion: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, EqualsRange(arr) && StartsWith("foo") && EndsWith("bar") ) + REQUIRE_THAT( str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) ) with expansion: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, !EqualsRange(bad_arr) && StartsWith("foo") && EndsWith("bar") ) + REQUIRE_THAT( str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) ) with expansion: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, EqualsRange(bad_arr) || (StartsWith("foo") && EndsWith("bar")) ) + REQUIRE_THAT( str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) ) with expansion: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( str, (StartsWith("foo") && EndsWith("bar")) || EqualsRange(bad_arr) ) + REQUIRE_THAT( str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) ) with expansion: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) @@ -3101,7 +3136,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( container, EqualsRange(a) || EqualsRange(b) || EqualsRange(c) ) + REQUIRE_THAT( container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) ) with expansion: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) @@ -3419,7 +3454,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK( matcher.match(1) ) + CHECK( matcher.match( 1 ) ) with expansion: true @@ -3484,13 +3519,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Contains("STRING") ) + CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" @@ -3733,12 +3768,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) + CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "Substring" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) @@ -3923,13 +3958,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) @@ -3941,13 +3976,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) @@ -3985,11 +4020,11 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) because no exception was thrown where one was expected: Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) because no exception was thrown where one was expected: ------------------------------------------------------------------------------- @@ -4000,12 +4035,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) due to unexpected exception with message: Unknown exception Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) due to unexpected exception with message: Unknown exception @@ -4017,12 +4052,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number>: FAILED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 @@ -4033,12 +4068,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THROWS_MATCHES( throwsSpecialException(1), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, ExceptionMatcher{2} ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } ) with expansion: SpecialException::what special exception has value of 2 @@ -4100,22 +4135,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, Message("DerivedException::what") ) + REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) ) with expansion: DerivedException::what exception message matches "DerivedException::what" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, !Message("derivedexception::what") ) + REQUIRE_THROWS_MATCHES( throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) ) with expansion: DerivedException::what not exception message matches "derivedexception::what" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, !Message("DerivedException::what") ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) ) with expansion: SpecialException::what not exception message matches "DerivedException::what" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(2), SpecialException, Message("SpecialException::what") ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 2 ), SpecialException, Message( "SpecialException::what" ) ) with expansion: SpecialException::what exception message matches "SpecialException::what" @@ -4209,22 +4244,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10., WithinRel(11.1, 0.1) ) + REQUIRE_THAT( 10., WithinRel( 11.1, 0.1 ) ) with expansion: 10.0 and 11.1 are within 10% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10., !WithinRel(11.2, 0.1) ) + REQUIRE_THAT( 10., !WithinRel( 11.2, 0.1 ) ) with expansion: 10.0 not and 11.2 are within 10% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., !WithinRel(0., 0.99) ) + REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) ) with expansion: 1.0 not and 0 are within 99% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0., WithinRel(0.) ) + REQUIRE_THAT( -0., WithinRel( 0. ) ) with expansion: -0.0 and 0 are within 2.22045e-12% of each other @@ -4237,7 +4272,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, WithinRel(v2) ) + REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other @@ -4249,42 +4284,42 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(1., 0) ) + REQUIRE_THAT( 1., WithinAbs( 1., 0 ) ) with expansion: 1.0 is within 0.0 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., WithinAbs(1., 1) ) + REQUIRE_THAT( 0., WithinAbs( 1., 1 ) ) with expansion: 0.0 is within 1.0 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) + REQUIRE_THAT( 0., !WithinAbs( 1., 0.99 ) ) with expansion: 0.0 not is within 0.99 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., !WithinAbs(1., 0.99) ) + REQUIRE_THAT( 0., !WithinAbs( 1., 0.99 ) ) with expansion: 0.0 not is within 0.99 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 11., !WithinAbs(10., 0.5) ) + REQUIRE_THAT( 11., !WithinAbs( 10., 0.5 ) ) with expansion: 11.0 not is within 0.5 of 10.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10., !WithinAbs(11., 0.5) ) + REQUIRE_THAT( 10., !WithinAbs( 11., 0.5 ) ) with expansion: 10.0 not is within 0.5 of 11.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10., WithinAbs(-10., 0.5) ) + REQUIRE_THAT( -10., WithinAbs( -10., 0.5 ) ) with expansion: -10.0 is within 0.5 of -10.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10., WithinAbs(-9.6, 0.5) ) + REQUIRE_THAT( -10., WithinAbs( -9.6, 0.5 ) ) with expansion: -10.0 is within 0.5 of -9.6 @@ -4296,43 +4331,43 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinULP(1., 0) ) + REQUIRE_THAT( 1., WithinULP( 1., 0 ) ) with expansion: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1. 0000000000000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1., 2.), WithinULP(1., 1) ) + REQUIRE_THAT( nextafter( 1., 2. ), WithinULP( 1., 1 ) ) with expansion: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1. 0000000000000002e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0., WithinULP(nextafter(0., 1.), 1) ) + REQUIRE_THAT( 0., WithinULP( nextafter( 0., 1. ), 1 ) ) with expansion: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9. 8813129168249309e-324]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinULP(nextafter(1., 0.), 1) ) + REQUIRE_THAT( 1., WithinULP( nextafter( 1., 0. ), 1 ) ) with expansion: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1. 0000000000000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., !WithinULP(nextafter(1., 2.), 0) ) + REQUIRE_THAT( 1., !WithinULP( nextafter( 1., 2. ), 0 ) ) with expansion: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinULP(1., 0) ) + REQUIRE_THAT( 1., WithinULP( 1., 0 ) ) with expansion: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1. 0000000000000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0., WithinULP(0., 0) ) + REQUIRE_THAT( -0., WithinULP( 0., 0 ) ) with expansion: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0. 0000000000000000e+00]) @@ -4345,19 +4380,19 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(1., 0.5) || WithinULP(2., 1) ) + REQUIRE_THAT( 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) ) with expansion: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1. 9999999999999998e+00, 2.0000000000000004e+00]) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1., WithinAbs(2., 0.5) || WithinULP(1., 0) ) + REQUIRE_THAT( 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) ) with expansion: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1. 0000000000000000e+00, 1.0000000000000000e+00]) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) ) + REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) ) with expansion: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) @@ -4369,22 +4404,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinAbs(1., 0.) ) + REQUIRE_NOTHROW( WithinAbs( 1., 0. ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinAbs(1., -1.), std::domain_error ) + REQUIRE_THROWS_AS( WithinAbs( 1., -1. ), std::domain_error ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinULP(1., 0) ) + REQUIRE_NOTHROW( WithinULP( 1., 0 ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinRel(1., 0.) ) + REQUIRE_NOTHROW( WithinRel( 1., 0. ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinRel(1., -0.2), std::domain_error ) + REQUIRE_THROWS_AS( WithinRel( 1., -0.2 ), std::domain_error ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinRel(1., 1.), std::domain_error ) + REQUIRE_THROWS_AS( WithinRel( 1., 1. ), std::domain_error ) ------------------------------------------------------------------------------- Floating point matchers: float @@ -4394,22 +4429,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10.f, WithinRel(11.1f, 0.1f) ) + REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) ) with expansion: 10.0f and 11.1 are within 10% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10.f, !WithinRel(11.2f, 0.1f) ) + REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) ) with expansion: 10.0f not and 11.2 are within 10% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, !WithinRel(0.f, 0.99f) ) + REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) ) with expansion: 1.0f not and 0 are within 99% of each other Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0.f, WithinRel(0.f) ) + REQUIRE_THAT( -0.f, WithinRel( 0.f ) ) with expansion: -0.0f and 0 are within 0.00119209% of each other @@ -4422,7 +4457,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, WithinRel(v2) ) + REQUIRE_THAT( v1, WithinRel( v2 ) ) with expansion: 0.0f and 1.17549e-38 are within 0.00119209% of each other @@ -4434,47 +4469,47 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(1.f, 0) ) + REQUIRE_THAT( 1.f, WithinAbs( 1.f, 0 ) ) with expansion: 1.0f is within 0.0 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, WithinAbs(1.f, 1) ) + REQUIRE_THAT( 0.f, WithinAbs( 1.f, 1 ) ) with expansion: 0.0f is within 1.0 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) + REQUIRE_THAT( 0.f, !WithinAbs( 1.f, 0.99f ) ) with expansion: 0.0f not is within 0.9900000095 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, !WithinAbs(1.f, 0.99f) ) + REQUIRE_THAT( 0.f, !WithinAbs( 1.f, 0.99f ) ) with expansion: 0.0f not is within 0.9900000095 of 1.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, WithinAbs(-0.f, 0) ) + REQUIRE_THAT( 0.f, WithinAbs( -0.f, 0 ) ) with expansion: 0.0f is within 0.0 of -0.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 11.f, !WithinAbs(10.f, 0.5f) ) + REQUIRE_THAT( 11.f, !WithinAbs( 10.f, 0.5f ) ) with expansion: 11.0f not is within 0.5 of 10.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 10.f, !WithinAbs(11.f, 0.5f) ) + REQUIRE_THAT( 10.f, !WithinAbs( 11.f, 0.5f ) ) with expansion: 10.0f not is within 0.5 of 11.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10.f, WithinAbs(-10.f, 0.5f) ) + REQUIRE_THAT( -10.f, WithinAbs( -10.f, 0.5f ) ) with expansion: -10.0f is within 0.5 of -10.0 Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -10.f, WithinAbs(-9.6f, 0.5f) ) + REQUIRE_THAT( -10.f, WithinAbs( -9.6f, 0.5f ) ) with expansion: -10.0f is within 0.5 of -9.6000003815 @@ -4486,38 +4521,44 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) + REQUIRE_THAT( 1.f, WithinULP( 1.f, 0 ) ) with expansion: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( nextafter(1.f, 2.f), WithinULP(1.f, 1) ) + REQUIRE_THAT( -1.f, WithinULP( -1.f, 0 ) ) +with expansion: + -1.0f is within 0 ULPs of -1.00000000e+00f ([-1.00000000e+00, -1.00000000e+ + 00]) + +Matchers.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) ) with expansion: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.f, WithinULP(nextafter(0.f, 1.f), 1) ) + REQUIRE_THAT( 0.f, WithinULP( nextafter( 0.f, 1.f ), 1 ) ) with expansion: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinULP(nextafter(1.f, 0.f), 1) ) + REQUIRE_THAT( 1.f, WithinULP( nextafter( 1.f, 0.f ), 1 ) ) with expansion: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, !WithinULP(nextafter(1.f, 2.f), 0) ) + REQUIRE_THAT( 1.f, !WithinULP( nextafter( 1.f, 2.f ), 0 ) ) with expansion: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+ 00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinULP(1.f, 0) ) + REQUIRE_THAT( 1.f, WithinULP( 1.f, 0 ) ) with expansion: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( -0.f, WithinULP(0.f, 0) ) + REQUIRE_THAT( -0.f, WithinULP( 0.f, 0 ) ) with expansion: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) @@ -4529,19 +4570,19 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) ) + REQUIRE_THAT( 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) ) with expansion: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9. 99999940e-01, 1.00000012e+00]) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) ) + REQUIRE_THAT( 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) ) with expansion: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1. 00000000e+00, 1.00000000e+00]) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) ) + REQUIRE_THAT( 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) ) with expansion: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) @@ -4553,25 +4594,25 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinAbs(1.f, 0.f) ) + REQUIRE_NOTHROW( WithinAbs( 1.f, 0.f ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinAbs(1.f, -1.f), std::domain_error ) + REQUIRE_THROWS_AS( WithinAbs( 1.f, -1.f ), std::domain_error ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinULP(1.f, 0) ) + REQUIRE_NOTHROW( WithinULP( 1.f, 0 ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error ) + REQUIRE_THROWS_AS( WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( WithinRel(1.f, 0.f) ) + REQUIRE_NOTHROW( WithinRel( 1.f, 0.f ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinRel(1.f, -0.2f), std::domain_error ) + REQUIRE_THROWS_AS( WithinRel( 1.f, -0.2f ), std::domain_error ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( WithinRel(1.f, 1.f), std::domain_error ) + REQUIRE_THROWS_AS( WithinRel( 1.f, 1.f ), std::domain_error ) ------------------------------------------------------------------------------- Generators -- adapters @@ -6852,7 +6893,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") ) + CHECK_THAT( testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) @@ -6864,13 +6905,13 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("string") || Contains("different") || Contains("random") ) + CHECK_THAT( testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") ) + CHECK_THAT( testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) ) with expansion: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) @@ -6882,7 +6923,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") ) + CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) @@ -6894,7 +6935,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") ) + CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -6906,7 +6947,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), !Contains("different") ) + CHECK_THAT( testStringForMatching(), !Contains( "different" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "different" @@ -6917,7 +6958,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), !Contains("substring") ) + CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" @@ -7510,16 +7551,16 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS_AS( (EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed ) + REQUIRE_THROWS_AS( ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed ) Matchers.tests.cpp:<line number>: PASSED: REQUIRE_THROWS_AS( &EvilMatcher(), EvilAddressOfOperatorUsed ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( EvilMatcher() || (EvilMatcher() && !EvilMatcher()) ) + REQUIRE_NOTHROW( EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) ) Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( (EvilMatcher() && EvilMatcher()) || !EvilMatcher() ) + REQUIRE_NOTHROW( ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() ) ------------------------------------------------------------------------------- Parse test names and tags @@ -8608,7 +8649,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( "foo", Predicate<const char*>([] (const char* const&) { return true; }) ) + REQUIRE_THAT( "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) ) with expansion: "foo" matches undescribed predicate @@ -9371,19 +9412,19 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) + CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) ) with expansion: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively @@ -9395,7 +9436,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( actual, !UnorderedEquals(expected) ) + CHECK_THAT( actual, !UnorderedEquals( expected ) ) with expansion: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } @@ -10378,12 +10419,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("This String") ) + CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "This String" Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) @@ -10433,45 +10474,45 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains("string") ) + REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( testStringForMatching(), Contains("string", Catch::CaseSensitive::No) ) + REQUIRE_THAT( testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "string" (case insensitive) Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("abc") ) + CHECK_THAT( testStringForMatching(), Contains( "abc" ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), StartsWith("this") ) + CHECK_THAT( testStringForMatching(), StartsWith( "this" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), EndsWith("substring") ) + CHECK_THAT( testStringForMatching(), EndsWith( "substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "substring" Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) @@ -10494,12 +10535,7 @@ with expansion: 0 == 0 String.tests.cpp:<line number>: PASSED: - REQUIRE( empty.isNullTerminated() ) -with expansion: - true - -String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 ) + REQUIRE( std::strcmp( empty.data(), "" ) == 0 ) with expansion: 0 == 0 @@ -10520,24 +10556,11 @@ String.tests.cpp:<line number>: PASSED: with expansion: 5 == 5 -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.isNullTerminated() ) -with expansion: - true - String.tests.cpp:<line number>: PASSED: REQUIRE( std::strcmp( rawChars, "hello" ) == 0 ) with expansion: 0 == 0 -String.tests.cpp:<line number>: PASSED: - REQUIRE_NOTHROW( s.c_str() ) - -String.tests.cpp:<line number>: PASSED: - REQUIRE( s.c_str() == rawChars ) -with expansion: - "hello" == "hello" - String.tests.cpp:<line number>: PASSED: REQUIRE( s.data() == rawChars ) with expansion: @@ -10553,14 +10576,6 @@ String.tests.cpp:<line number> String.tests.cpp:<line number>: PASSED: REQUIRE( original == "original" ) -String.tests.cpp:<line number>: PASSED: - REQUIRE_FALSE( original.isNullTerminated() ) -with expansion: - !false - -String.tests.cpp:<line number>: PASSED: - REQUIRE_THROWS( original.c_str() ) - String.tests.cpp:<line number>: PASSED: REQUIRE_NOTHROW( original.data() ) @@ -10606,7 +10621,7 @@ with expansion: 6 == 6 String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 ) + REQUIRE( std::strcmp( ss.data(), "world!" ) == 0 ) with expansion: 0 == 0 @@ -10658,7 +10673,7 @@ String.tests.cpp:<line number> ............................................................................... String.tests.cpp:<line number>: PASSED: - REQUIRE( std::strcmp(ss.c_str(), "world!") == 0 ) + REQUIRE( std::strcmp(ss.data(), "world!") == 0 ) with expansion: 0 == 0 @@ -10832,10 +10847,6 @@ String.tests.cpp:<line number>: PASSED: with message: stringref.size() == 3 -String.tests.cpp:<line number>: PASSED: -with message: - stringref.isNullTerminated() - String.tests.cpp:<line number>: PASSED: with message: stringref.data() == abc @@ -10872,14 +10883,6 @@ String.tests.cpp:<line number>: PASSED: with message: shortened.begin() != shortened.end() -String.tests.cpp:<line number>: PASSED: -with message: - !(shortened.isNullTerminated()) - -String.tests.cpp:<line number>: PASSED: -with message: - !(shortened.substr(1, 3).isNullTerminated()) - ------------------------------------------------------------------------------- StringRef at compilation time UDL construction @@ -10895,10 +10898,6 @@ String.tests.cpp:<line number>: PASSED: with message: sr1.size() == 3 -String.tests.cpp:<line number>: PASSED: -with message: - sr1.isNullTerminated() - String.tests.cpp:<line number>: PASSED: with message: sr2.empty() @@ -10907,9 +10906,53 @@ String.tests.cpp:<line number>: PASSED: with message: sr2.size() == 0 -String.tests.cpp:<line number>: PASSED: -with message: - sr2.isNullTerminated() +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - signed char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +------------------------------------------------------------------------------- +Stringifying char arrays with statically known sizes - unsigned char +------------------------------------------------------------------------------- +ToString.tests.cpp:<line number> +............................................................................... + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" + +ToString.tests.cpp:<line number>: PASSED: + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ) +with expansion: + ""abc"" == ""abc"" ------------------------------------------------------------------------------- Stringifying std::chrono::duration helpers @@ -12344,6 +12387,50 @@ CmdLine.tests.cpp:<line number> CmdLine.tests.cpp:<line number>: PASSED: +------------------------------------------------------------------------------- +Testing checked-if +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_IF( true ) + +Misc.tests.cpp:<line number>: PASSED: + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_IF( false ) + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_ELSE( true ) + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_ELSE( false ) + +Misc.tests.cpp:<line number>: PASSED: + +------------------------------------------------------------------------------- +Testing checked-if 2 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: PASSED: + CHECKED_IF( true ) + +Misc.tests.cpp:<line number>: FAILED: + +------------------------------------------------------------------------------- +Testing checked-if 3 +------------------------------------------------------------------------------- +Misc.tests.cpp:<line number> +............................................................................... + +Misc.tests.cpp:<line number>: FAILED - but was ok: + CHECKED_ELSE( false ) + +Misc.tests.cpp:<line number>: FAILED: + ------------------------------------------------------------------------------- The NO_FAIL macro reports a failure but does not fail the test ------------------------------------------------------------------------------- @@ -13438,7 +13525,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( empty, Approx(empty) ) + REQUIRE_THAT( empty, Approx( empty ) ) with expansion: { } is approx: { } @@ -13451,12 +13538,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, Approx(v1) ) + REQUIRE_THAT( v1, Approx( v1 ) ) with expansion: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, Approx<double>({ 1., 2., 3. }) ) + REQUIRE_THAT( v1, Approx<double>( { 1., 2., 3. } ) ) with expansion: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } @@ -13469,7 +13556,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, !Approx(temp) ) + REQUIRE_THAT( v1, !Approx( temp ) ) with expansion: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } @@ -13482,22 +13569,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, !Approx(v2) ) + REQUIRE_THAT( v1, !Approx( v2 ) ) with expansion: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, Approx(v2).margin(0.5) ) + REQUIRE_THAT( v1, Approx( v2 ).margin( 0.5 ) ) with expansion: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, Approx(v2).epsilon(0.5) ) + REQUIRE_THAT( v1, Approx( v2 ).epsilon( 0.5 ) ) with expansion: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( v1, Approx(v2).epsilon(0.1).scale(500) ) + REQUIRE_THAT( v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) ) with expansion: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } @@ -13509,7 +13596,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Approx(t1) ) + CHECK_THAT( empty, Approx( t1 ) ) with expansion: { } is approx: { 1.0, 2.0 } @@ -13521,7 +13608,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v1, Approx(v2) ) + CHECK_THAT( v1, Approx( v2 ) ) with expansion: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } @@ -13533,17 +13620,17 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, VectorContains(1) ) + CHECK_THAT( v, VectorContains( 1 ) ) with expansion: { 1, 2, 3 } Contains: 1 Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, VectorContains(2) ) + CHECK_THAT( v, VectorContains( 2 ) ) with expansion: { 1, 2, 3 } Contains: 2 Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, (VectorContains<int, CustomAllocator<int>>(2)) ) + CHECK_THAT( v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) ) with expansion: { 1, 2, 3 } Contains: 2 @@ -13555,42 +13642,42 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Contains<int>({ 1, 2 }) ) + CHECK_THAT( v, Contains<int>( { 1, 2 } ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) ) + CHECK_THAT( v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Contains(empty) ) + CHECK_THAT( v, Contains( empty ) ) with expansion: { 1, 2, 3 } Contains: { } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( empty, Contains(empty) ) + CHECK_THAT( empty, Contains( empty ) ) with expansion: { } Contains: { } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) ) + CHECK_THAT( v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, Contains(v6) ) + CHECK_THAT( v5, Contains( v6 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2 } @@ -13602,7 +13689,7 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, VectorContains(1) && VectorContains(2) ) + CHECK_THAT( v, VectorContains( 1 ) && VectorContains( 2 ) ) with expansion: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) @@ -13614,32 +13701,32 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Equals(v) ) + CHECK_THAT( v, Equals( v ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( empty, Equals(empty) ) + CHECK_THAT( empty, Equals( empty ) ) with expansion: { } Equals: { } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Equals<int>({ 1, 2, 3 }) ) + CHECK_THAT( v, Equals<int>( { 1, 2, 3 } ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, Equals(v2) ) + CHECK_THAT( v, Equals( v2 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) ) + CHECK_THAT( v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, Equals(v6) ) + CHECK_THAT( v5, Equals( v6 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2, 3 } @@ -13651,37 +13738,37 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, UnorderedEquals(v) ) + CHECK_THAT( v, UnorderedEquals( v ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v, UnorderedEquals<int>({ 3, 2, 1 }) ) + CHECK_THAT( v, UnorderedEquals<int>( { 3, 2, 1 } ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( empty, UnorderedEquals(empty) ) + CHECK_THAT( empty, UnorderedEquals( empty ) ) with expansion: { } UnorderedEquals: { } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( permuted, UnorderedEquals(v) ) + REQUIRE_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - REQUIRE_THAT( permuted, UnorderedEquals(v) ) + REQUIRE_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) ) + CHECK_THAT( v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } Matchers.tests.cpp:<line number>: PASSED: - CHECK_THAT( v5_permuted, UnorderedEquals(v5) ) + CHECK_THAT( v5_permuted, UnorderedEquals( v5 ) ) with expansion: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } @@ -13693,12 +13780,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, VectorContains(-1) ) + CHECK_THAT( v, VectorContains( -1 ) ) with expansion: { 1, 2, 3 } Contains: -1 Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, VectorContains(1) ) + CHECK_THAT( empty, VectorContains( 1 ) ) with expansion: { } Contains: 1 @@ -13710,12 +13797,12 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Contains(v) ) + CHECK_THAT( empty, Contains( v ) ) with expansion: { } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 4 } @@ -13727,22 +13814,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Equals(v2) ) + CHECK_THAT( v, Equals( v2 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v2, Equals(v) ) + CHECK_THAT( v2, Equals( v ) ) with expansion: { 1, 2 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, Equals(v) ) + CHECK_THAT( empty, Equals( v ) ) with expansion: { } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, Equals(empty) ) + CHECK_THAT( v, Equals( empty ) ) with expansion: { 1, 2, 3 } Equals: { } @@ -13754,22 +13841,22 @@ Matchers.tests.cpp:<line number> ............................................................................... Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( v, UnorderedEquals(empty) ) + CHECK_THAT( v, UnorderedEquals( empty ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( empty, UnorderedEquals(v) ) + CHECK_THAT( empty, UnorderedEquals( v ) ) with expansion: { } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 1, 3 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number>: FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 3, 1 } UnorderedEquals: { 1, 2, 3 } @@ -14022,6 +14109,19 @@ Xml.tests.cpp:<line number>: PASSED: with expansion: "[\x7F]" == "[\x7F]" +------------------------------------------------------------------------------- +XmlWriter writes boolean attributes as true/false +------------------------------------------------------------------------------- +Xml.tests.cpp:<line number> +............................................................................... + +Xml.tests.cpp:<line number>: PASSED: + REQUIRE_THAT( stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") ) +with expansion: + "<?xml version="1.0" encoding="UTF-8"?> + <Element1 attr1="true" attr2="false"/> + " ( contains: "attr1="true"" and contains: "attr2="false"" ) + ------------------------------------------------------------------------------- analyse no analysis ------------------------------------------------------------------------------- @@ -14222,7 +14322,7 @@ checkedElse, failing Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: FAILED: +Misc.tests.cpp:<line number>: FAILED - but was ok: CHECKED_ELSE( flag ) with expansion: false @@ -14254,7 +14354,7 @@ checkedIf, failing Misc.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: FAILED: +Misc.tests.cpp:<line number>: FAILED - but was ok: CHECKED_IF( flag ) with expansion: false @@ -14538,6 +14638,55 @@ Condition.tests.cpp:<line number>: PASSED: with expansion: 1 == 1 +------------------------------------------------------------------------------- +convertToBits +------------------------------------------------------------------------------- +FloatingPoint.tests.cpp:<line number> +............................................................................... + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( 0.f ) == 0 ) +with expansion: + 0 == 0 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( -0.f ) == ( 1ULL << 31 ) ) +with expansion: + 2147483648 (0x<hex digits>) + == + 2147483648 (0x<hex digits>) + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( 0. ) == 0 ) +with expansion: + 0 == 0 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( -0. ) == ( 1ULL << 63 ) ) +with expansion: + 9223372036854775808 (0x<hex digits>) + == + 9223372036854775808 (0x<hex digits>) + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 ) +with expansion: + 1 == 1 + +FloatingPoint.tests.cpp:<line number>: PASSED: + CHECK( convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 ) +with expansion: + 1 == 1 + +------------------------------------------------------------------------------- +empty tags are not allowed +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE_THROWS( Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) ) + ------------------------------------------------------------------------------- erfc_inv ------------------------------------------------------------------------------- @@ -16048,6 +16197,22 @@ Generators.tests.cpp:<line number>: PASSED: with expansion: 6 == 6 +------------------------------------------------------------------------------- +tags with dots in later positions are not parsed as hidden +------------------------------------------------------------------------------- +Tag.tests.cpp:<line number> +............................................................................... + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testcase.tags.size() == 1 ) +with expansion: + 1 == 1 + +Tag.tests.cpp:<line number>: PASSED: + REQUIRE( testcase.tags[0].original == "magic.tag"_catch_sr ) +with expansion: + magic.tag == magic.tag + ------------------------------------------------------------------------------- thrown std::strings are translated ------------------------------------------------------------------------------- @@ -16768,6 +16933,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 356 | 266 passed | 86 failed | 4 failed as expected -assertions: 2105 | 1936 passed | 148 failed | 21 failed as expected +test cases: 368 | 276 passed | 86 failed | 6 failed as expected +assertions: 2120 | 1951 passed | 146 failed | 23 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt index ee504415a897eb84252b9621733d341d64ac32e3..df003bd3fc778c80d54b9fb07f58916df32a027e 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/console.swa4.approved.txt @@ -744,6 +744,41 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - double +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, + 4.9406564584124654e-324]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e- + 324, -0.0000000000000000e+00]) + +------------------------------------------------------------------------------- +#2152 - ULP checks between differently signed values were wrong - float +------------------------------------------------------------------------------- +Matchers.tests.cpp:<line number> +............................................................................... + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ) +with expansion: + 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) + +Matchers.tests.cpp:<line number>: PASSED: + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ) +with expansion: + 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0. + 00000000e+00]) + ------------------------------------------------------------------------------- #748 - captures with unexpected exceptions outside assertions @@ -924,6 +959,6 @@ Condition.tests.cpp:<line number>: FAILED: CHECK( true != true ) =============================================================================== -test cases: 31 | 26 passed | 3 failed | 2 failed as expected -assertions: 99 | 92 passed | 4 failed | 3 failed as expected +test cases: 33 | 28 passed | 3 failed | 2 failed as expected +assertions: 103 | 96 passed | 4 failed | 3 failed as expected diff --git a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt index 5206ed2d18e12081a39a7ddc24e037407d48bcdd..88e96b0fcf64e556af68cca1df002ade68794c7b 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="132" tests="2106" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="129" tests="2120" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> <property name="random-seed" value="1"/> @@ -47,6 +47,8 @@ Nor would this <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - double" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="#2152 - ULP checks between differently signed values were wrong - float" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}" status="run"> <error type="TEST_CASE"> FAILED: @@ -396,17 +398,17 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAllOf" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Composed matchers shortcircuit/MatchAnyOf" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Contains string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), Contains("not there", Catch::CaseSensitive::No)" type="CHECK_THAT"> + <failure message="testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), Contains("STRING")" type="CHECK_THAT"> + <failure message="testStringForMatching(), Contains( "STRING" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Contains("STRING") ) + CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" Matchers.tests.cpp:<line number> @@ -441,16 +443,16 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Default scale is invisible to comparison" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Directly creating an EnumInfo" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="EndsWith string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), EndsWith("Substring")" type="CHECK_THAT"> + <failure message="testStringForMatching(), EndsWith( "Substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) + CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "Substring" Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No)" type="CHECK_THAT"> + <failure message="testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) @@ -556,17 +558,17 @@ Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Equality checks that should succeed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Equals" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Equals string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), Equals("this string contains 'ABC' as a substring")" type="CHECK_THAT"> + <failure message="testStringForMatching(), Equals( "this string contains 'ABC' as a substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), Equals("something else", Catch::CaseSensitive::No)" type="CHECK_THAT"> + <failure message="testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) @@ -575,42 +577,42 @@ Matchers.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Exception matchers that fail/No exception" time="{duration}" status="run"> - <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES"> + <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="CHECK_THROWS_MATCHES"> FAILED: - CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) Matchers.tests.cpp:<line number> </failure> - <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES"> + <failure message="doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES"> FAILED: - REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) Matchers.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Exception matchers that fail/Type mismatch" time="{duration}" status="run"> - <error message="throwsAsInt(1), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES"> + <error message="throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }" type="CHECK_THROWS_MATCHES"> FAILED: - CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) Unknown exception Matchers.tests.cpp:<line number> </error> - <error message="throwsAsInt(1), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES"> + <error message="throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES"> FAILED: - REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) Unknown exception Matchers.tests.cpp:<line number> </error> </testcase> <testcase classname="<exe-name>.global" name="Exception matchers that fail/Contents are wrong" time="{duration}" status="run"> - <failure message="throwsSpecialException(3), SpecialException, ExceptionMatcher{1}" type="CHECK_THROWS_MATCHES"> + <failure message="throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 }" type="CHECK_THROWS_MATCHES"> FAILED: - CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number> </failure> - <failure message="throwsSpecialException(4), SpecialException, ExceptionMatcher{1}" type="REQUIRE_THROWS_MATCHES"> + <failure message="throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 }" type="REQUIRE_THROWS_MATCHES"> FAILED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number> @@ -798,9 +800,9 @@ Condition.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and ||" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be composed with both && and || - failing" time="{duration}" status="run"> - <failure message="testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random")" type="CHECK_THAT"> + <failure message="testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") ) + CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) @@ -809,9 +811,9 @@ Matchers.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Matchers can be negated (Not) with the ! operator - failing" time="{duration}" status="run"> - <failure message="testStringForMatching(), !Contains("substring")" type="CHECK_THAT"> + <failure message="testStringForMatching(), !Contains( "substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), !Contains("substring") ) + CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" Matchers.tests.cpp:<line number> @@ -1075,25 +1077,25 @@ Decomposition.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Regex string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), Matches("this STRING contains 'abc' as a substring")" type="CHECK_THAT"> + <failure message="testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), Matches("contains 'abc' as a substring")" type="CHECK_THAT"> + <failure message="testStringForMatching(), Matches( "contains 'abc' as a substring" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), Matches("this string contains 'abc' as a")" type="CHECK_THAT"> + <failure message="testStringForMatching(), Matches( "this string contains 'abc' as a" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) + CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) ) with expansion: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively @@ -1154,16 +1156,16 @@ Message from section two </system-out> </testcase> <testcase classname="<exe-name>.global" name="StartsWith string matcher" time="{duration}" status="run"> - <failure message="testStringForMatching(), StartsWith("This String")" type="CHECK_THAT"> + <failure message="testStringForMatching(), StartsWith( "This String" )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("This String") ) + CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "This String" Matchers.tests.cpp:<line number> </failure> - <failure message="testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No)" type="CHECK_THAT"> + <failure message="testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No )" type="CHECK_THAT"> FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) @@ -1194,6 +1196,9 @@ Matchers.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="StringRef/StringRef + StringRef" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef at compilation time/Simple constructors" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="StringRef at compilation time/UDL construction" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - signed char" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Stringifying char arrays with statically known sizes - unsigned char" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration helpers" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Stringifying std::chrono::duration with weird ratios" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Stringifying std::chrono::time_point<system_clock>" time="{duration}" status="run"/> @@ -1276,6 +1281,19 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Testing checked-if" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Testing checked-if 2" time="{duration}" status="run"> + <failure type="FAIL"> +FAILED: +Misc.tests.cpp:<line number> + </failure> + </testcase> + <testcase classname="<exe-name>.global" name="Testing checked-if 3" time="{duration}" status="run"> + <failure type="FAIL"> +FAILED: +Misc.tests.cpp:<line number> + </failure> + </testcase> <testcase classname="<exe-name>.global" name="The NO_FAIL macro reports a failure but does not fail the test" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing tags" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="The default listing implementation write to provided stream/Listing reporters" time="{duration}" status="run"/> @@ -1330,18 +1348,18 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Different length" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Vector Approx matcher/Vectors with elements/Same length, different elements" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Vector Approx matcher -- failing/Empty and non empty vectors are not approx equal" time="{duration}" status="run"> - <failure message="empty, Approx(t1)" type="CHECK_THAT"> + <failure message="empty, Approx( t1 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( empty, Approx(t1) ) + CHECK_THAT( empty, Approx( t1 ) ) with expansion: { } is approx: { 1.0, 2.0 } Matchers.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Vector Approx matcher -- failing/Just different vectors" time="{duration}" status="run"> - <failure message="v1, Approx(v2)" type="CHECK_THAT"> + <failure message="v1, Approx( v2 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v1, Approx(v2) ) + CHECK_THAT( v1, Approx( v2 ) ) with expansion: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } Matchers.tests.cpp:<line number> @@ -1353,92 +1371,92 @@ Matchers.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Vector matchers/Equals" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Vector matchers/UnorderedEquals" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Vector matchers that fail/Contains (element)" time="{duration}" status="run"> - <failure message="v, VectorContains(-1)" type="CHECK_THAT"> + <failure message="v, VectorContains( -1 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v, VectorContains(-1) ) + CHECK_THAT( v, VectorContains( -1 ) ) with expansion: { 1, 2, 3 } Contains: -1 Matchers.tests.cpp:<line number> </failure> - <failure message="empty, VectorContains(1)" type="CHECK_THAT"> + <failure message="empty, VectorContains( 1 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( empty, VectorContains(1) ) + CHECK_THAT( empty, VectorContains( 1 ) ) with expansion: { } Contains: 1 Matchers.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Vector matchers that fail/Contains (vector)" time="{duration}" status="run"> - <failure message="empty, Contains(v)" type="CHECK_THAT"> + <failure message="empty, Contains( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( empty, Contains(v) ) + CHECK_THAT( empty, Contains( v ) ) with expansion: { } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="v, Contains(v2)" type="CHECK_THAT"> + <failure message="v, Contains( v2 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 4 } Matchers.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Vector matchers that fail/Equals" time="{duration}" status="run"> - <failure message="v, Equals(v2)" type="CHECK_THAT"> + <failure message="v, Equals( v2 )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v, Equals(v2) ) + CHECK_THAT( v, Equals( v2 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2 } Matchers.tests.cpp:<line number> </failure> - <failure message="v2, Equals(v)" type="CHECK_THAT"> + <failure message="v2, Equals( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v2, Equals(v) ) + CHECK_THAT( v2, Equals( v ) ) with expansion: { 1, 2 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="empty, Equals(v)" type="CHECK_THAT"> + <failure message="empty, Equals( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( empty, Equals(v) ) + CHECK_THAT( empty, Equals( v ) ) with expansion: { } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="v, Equals(empty)" type="CHECK_THAT"> + <failure message="v, Equals( empty )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v, Equals(empty) ) + CHECK_THAT( v, Equals( empty ) ) with expansion: { 1, 2, 3 } Equals: { } Matchers.tests.cpp:<line number> </failure> </testcase> <testcase classname="<exe-name>.global" name="Vector matchers that fail/UnorderedEquals" time="{duration}" status="run"> - <failure message="v, UnorderedEquals(empty)" type="CHECK_THAT"> + <failure message="v, UnorderedEquals( empty )" type="CHECK_THAT"> FAILED: - CHECK_THAT( v, UnorderedEquals(empty) ) + CHECK_THAT( v, UnorderedEquals( empty ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { } Matchers.tests.cpp:<line number> </failure> - <failure message="empty, UnorderedEquals(v)" type="CHECK_THAT"> + <failure message="empty, UnorderedEquals( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( empty, UnorderedEquals(v) ) + CHECK_THAT( empty, UnorderedEquals( v ) ) with expansion: { } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="permuted, UnorderedEquals(v)" type="CHECK_THAT"> + <failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 1, 3 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="permuted, UnorderedEquals(v)" type="CHECK_THAT"> + <failure message="permuted, UnorderedEquals( v )" type="CHECK_THAT"> FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 3, 1 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> @@ -1497,6 +1515,7 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="XmlEncode/string with quotes" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (1)" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="XmlEncode/string with control char (x7F)" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="XmlWriter writes boolean attributes as true/false" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="analyse no analysis" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="array<int, N> -> toString" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="atomic if" time="{duration}" status="run"/> @@ -1505,13 +1524,6 @@ Exception.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="boolean member" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="checkedElse" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="checkedElse, failing" time="{duration}" status="run"> - <failure message="flag" type="CHECKED_ELSE"> -FAILED: - CHECKED_ELSE( flag ) -with expansion: - false -Misc.tests.cpp:<line number> - </failure> <failure message="testCheckedElse( false )" type="REQUIRE"> FAILED: REQUIRE( testCheckedElse( false ) ) @@ -1522,13 +1534,6 @@ Misc.tests.cpp:<line number> </testcase> <testcase classname="<exe-name>.global" name="checkedIf" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="checkedIf, failing" time="{duration}" status="run"> - <failure message="flag" type="CHECKED_IF"> -FAILED: - CHECKED_IF( flag ) -with expansion: - false -Misc.tests.cpp:<line number> - </failure> <failure message="testCheckedIf( false )" type="REQUIRE"> FAILED: REQUIRE( testCheckedIf( false ) ) @@ -1545,6 +1550,8 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="classify_outliers/mixed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="comparisons between const int variables" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="comparisons between int variables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="convertToBits" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="empty tags are not allowed" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="erfc_inv" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="estimate_clock_resolution" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="even more nested SECTION tests/c/d (leaf)" time="{duration}" status="run"/> @@ -1778,6 +1785,7 @@ Tricky.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="stringify( vectors<has_operator> )" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="strlen3" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="tables" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="tags with dots in later positions are not parsed as hidden" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="thrown std::strings are translated" time="{duration}" status="run"> <error type="TEST_CASE"> FAILED: diff --git a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 1f0cc5dad55d613eaec25b9c634eab82a854ef73..924a14b19c3ec7e2a7f70e94c6f47483e0a3ae6f 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -77,6 +77,9 @@ <testCase name="Process can be configured on command line/Benchmark options/warmup-time" duration="{duration}"/> <testCase name="Test with special, characters "in name" duration="{duration}"/> </file> + <file path="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp"> + <testCase name="convertToBits" duration="{duration}"/> + </file> <file path="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp"> <testCase name="Generators internals/Single value" duration="{duration}"/> <testCase name="Generators internals/Preset values" duration="{duration}"/> @@ -216,11 +219,16 @@ <file path="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp"> <testCase name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" duration="{duration}"/> <testCase name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" duration="{duration}"/> + <testCase name="empty tags are not allowed" duration="{duration}"/> <testCase name="shortened hide tags are split apart" duration="{duration}"/> + <testCase name="tags with dots in later positions are not parsed as hidden" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp"> <testCase name="Directly creating an EnumInfo" duration="{duration}"/> <testCase name="Range type with sentinel" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - char" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - signed char" duration="{duration}"/> + <testCase name="Stringifying char arrays with statically known sizes - unsigned char" duration="{duration}"/> <testCase name="parseEnums/No enums" duration="{duration}"/> <testCase name="parseEnums/One enum value" duration="{duration}"/> <testCase name="parseEnums/Multiple enum values" duration="{duration}"/> @@ -249,6 +257,7 @@ <testCase name="XmlEncode/string with quotes" duration="{duration}"/> <testCase name="XmlEncode/string with control char (1)" duration="{duration}"/> <testCase name="XmlEncode/string with control char (x7F)" duration="{duration}"/> + <testCase name="XmlWriter writes boolean attributes as true/false" duration="{duration}"/> </file> <file path="tests/<exe-name>/UsageTests/Approx.tests.cpp"> <testCase name="A comparison that uses literals instead of the normal constructor" duration="{duration}"/> @@ -982,6 +991,8 @@ Exception.tests.cpp:<line number> <testCase name="tables" duration="{duration}"/> </file> <file path="tests/<exe-name>/UsageTests/Matchers.tests.cpp"> + <testCase name="#2152 - ULP checks between differently signed values were wrong - double" duration="{duration}"/> + <testCase name="#2152 - ULP checks between differently signed values were wrong - float" duration="{duration}"/> <testCase name="Arbitrary predicate matcher/Function pointer" duration="{duration}"/> <testCase name="Arbitrary predicate matcher/Lambdas + different type" duration="{duration}"/> <testCase name="Combining MatchAllOfGeneric does not nest" duration="{duration}"/> @@ -996,32 +1007,32 @@ Exception.tests.cpp:<line number> <testCase name="Composed matchers shortcircuit/MatchAllOf" duration="{duration}"/> <testCase name="Composed matchers shortcircuit/MatchAnyOf" duration="{duration}"/> <testCase name="Contains string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No))"> + <failure message="CHECK_THAT(testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ))"> FAILED: - CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), Contains("STRING"))"> + <failure message="CHECK_THAT(testStringForMatching(), Contains( "STRING" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Contains("STRING") ) + CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ) with expansion: "this string contains 'abc' as a substring" contains: "STRING" Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="EndsWith string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), EndsWith("Substring"))"> + <failure message="CHECK_THAT(testStringForMatching(), EndsWith( "Substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("Substring") ) + CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) ) with expansion: "this string contains 'abc' as a substring" ends with: "Substring" Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No))"> + <failure message="CHECK_THAT(testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ))"> FAILED: - CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) Matchers.tests.cpp:<line number> @@ -1029,58 +1040,58 @@ Matchers.tests.cpp:<line number> </testCase> <testCase name="Equals" duration="{duration}"/> <testCase name="Equals string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), Equals("this string contains 'ABC' as a substring"))"> + <failure message="CHECK_THAT(testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Equals("this string contains 'ABC' as a substring") ) + CHECK_THAT( testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), Equals("something else", Catch::CaseSensitive::No))"> + <failure message="CHECK_THAT(testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ))"> FAILED: - CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Exception matchers that fail/No exception" duration="{duration}"> - <failure message="CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1})"> + <failure message="CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) Matchers.tests.cpp:<line number> </failure> - <failure message="REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1})"> + <failure message="REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ) Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Exception matchers that fail/Type mismatch" duration="{duration}"> - <error message="CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1})"> + <error message="CHECK_THROWS_MATCHES(throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) Unknown exception Matchers.tests.cpp:<line number> </error> - <error message="REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1})"> + <error message="REQUIRE_THROWS_MATCHES(throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ) Unknown exception Matchers.tests.cpp:<line number> </error> </testCase> <testCase name="Exception matchers that fail/Contents are wrong" duration="{duration}"> - <failure message="CHECK_THROWS_MATCHES(throwsSpecialException(3), SpecialException, ExceptionMatcher{1})"> + <failure message="CHECK_THROWS_MATCHES(throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} ) + CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number> </failure> - <failure message="REQUIRE_THROWS_MATCHES(throwsSpecialException(4), SpecialException, ExceptionMatcher{1})"> + <failure message="REQUIRE_THROWS_MATCHES(throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 })"> FAILED: - REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} ) + REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } ) with expansion: SpecialException::what special exception has value of 1 Matchers.tests.cpp:<line number> @@ -1104,9 +1115,9 @@ Matchers.tests.cpp:<line number> <testCase name="Matchers can be (AnyOf) composed with the || operator" duration="{duration}"/> <testCase name="Matchers can be composed with both && and ||" duration="{duration}"/> <testCase name="Matchers can be composed with both && and || - failing" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random"))"> + <failure message="CHECK_THAT(testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ))"> FAILED: - CHECK_THAT( testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") ) + CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) ) with expansion: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) Matchers.tests.cpp:<line number> @@ -1114,9 +1125,9 @@ Matchers.tests.cpp:<line number> </testCase> <testCase name="Matchers can be negated (Not) with the ! operator" duration="{duration}"/> <testCase name="Matchers can be negated (Not) with the ! operator - failing" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), !Contains("substring"))"> + <failure message="CHECK_THAT(testStringForMatching(), !Contains( "substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), !Contains("substring") ) + CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ) with expansion: "this string contains 'abc' as a substring" not contains: "substring" Matchers.tests.cpp:<line number> @@ -1125,23 +1136,23 @@ Matchers.tests.cpp:<line number> <testCase name="Overloaded comma or address-of operators are not used" duration="{duration}"/> <testCase name="Predicate matcher can accept const char*" duration="{duration}"/> <testCase name="Regex string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), Matches("this STRING contains 'abc' as a substring"))"> + <failure message="CHECK_THAT(testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("this STRING contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), Matches("contains 'abc' as a substring"))"> + <failure message="CHECK_THAT(testStringForMatching(), Matches( "contains 'abc' as a substring" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("contains 'abc' as a substring") ) + CHECK_THAT( testStringForMatching(), Matches( "contains 'abc' as a substring" ) ) with expansion: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), Matches("this string contains 'abc' as a"))"> + <failure message="CHECK_THAT(testStringForMatching(), Matches( "this string contains 'abc' as a" ))"> FAILED: - CHECK_THAT( testStringForMatching(), Matches("this string contains 'abc' as a") ) + CHECK_THAT( testStringForMatching(), Matches( "this string contains 'abc' as a" ) ) with expansion: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively Matchers.tests.cpp:<line number> @@ -1149,16 +1160,16 @@ Matchers.tests.cpp:<line number> </testCase> <testCase name="Regression test #1" duration="{duration}"/> <testCase name="StartsWith string matcher" duration="{duration}"> - <failure message="CHECK_THAT(testStringForMatching(), StartsWith("This String"))"> + <failure message="CHECK_THAT(testStringForMatching(), StartsWith( "This String" ))"> FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("This String") ) + CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) ) with expansion: "this string contains 'abc' as a substring" starts with: "This String" Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No))"> + <failure message="CHECK_THAT(testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ))"> FAILED: - CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) ) + CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) ) with expansion: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) Matchers.tests.cpp:<line number> @@ -1170,18 +1181,18 @@ Matchers.tests.cpp:<line number> <testCase name="Vector Approx matcher/Vectors with elements/Different length" duration="{duration}"/> <testCase name="Vector Approx matcher/Vectors with elements/Same length, different elements" duration="{duration}"/> <testCase name="Vector Approx matcher -- failing/Empty and non empty vectors are not approx equal" duration="{duration}"> - <failure message="CHECK_THAT(empty, Approx(t1))"> + <failure message="CHECK_THAT(empty, Approx( t1 ))"> FAILED: - CHECK_THAT( empty, Approx(t1) ) + CHECK_THAT( empty, Approx( t1 ) ) with expansion: { } is approx: { 1.0, 2.0 } Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Vector Approx matcher -- failing/Just different vectors" duration="{duration}"> - <failure message="CHECK_THAT(v1, Approx(v2))"> + <failure message="CHECK_THAT(v1, Approx( v2 ))"> FAILED: - CHECK_THAT( v1, Approx(v2) ) + CHECK_THAT( v1, Approx( v2 ) ) with expansion: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } Matchers.tests.cpp:<line number> @@ -1193,92 +1204,92 @@ Matchers.tests.cpp:<line number> <testCase name="Vector matchers/Equals" duration="{duration}"/> <testCase name="Vector matchers/UnorderedEquals" duration="{duration}"/> <testCase name="Vector matchers that fail/Contains (element)" duration="{duration}"> - <failure message="CHECK_THAT(v, VectorContains(-1))"> + <failure message="CHECK_THAT(v, VectorContains( -1 ))"> FAILED: - CHECK_THAT( v, VectorContains(-1) ) + CHECK_THAT( v, VectorContains( -1 ) ) with expansion: { 1, 2, 3 } Contains: -1 Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(empty, VectorContains(1))"> + <failure message="CHECK_THAT(empty, VectorContains( 1 ))"> FAILED: - CHECK_THAT( empty, VectorContains(1) ) + CHECK_THAT( empty, VectorContains( 1 ) ) with expansion: { } Contains: 1 Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Vector matchers that fail/Contains (vector)" duration="{duration}"> - <failure message="CHECK_THAT(empty, Contains(v))"> + <failure message="CHECK_THAT(empty, Contains( v ))"> FAILED: - CHECK_THAT( empty, Contains(v) ) + CHECK_THAT( empty, Contains( v ) ) with expansion: { } Contains: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(v, Contains(v2))"> + <failure message="CHECK_THAT(v, Contains( v2 ))"> FAILED: - CHECK_THAT( v, Contains(v2) ) + CHECK_THAT( v, Contains( v2 ) ) with expansion: { 1, 2, 3 } Contains: { 1, 2, 4 } Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Vector matchers that fail/Equals" duration="{duration}"> - <failure message="CHECK_THAT(v, Equals(v2))"> + <failure message="CHECK_THAT(v, Equals( v2 ))"> FAILED: - CHECK_THAT( v, Equals(v2) ) + CHECK_THAT( v, Equals( v2 ) ) with expansion: { 1, 2, 3 } Equals: { 1, 2 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(v2, Equals(v))"> + <failure message="CHECK_THAT(v2, Equals( v ))"> FAILED: - CHECK_THAT( v2, Equals(v) ) + CHECK_THAT( v2, Equals( v ) ) with expansion: { 1, 2 } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(empty, Equals(v))"> + <failure message="CHECK_THAT(empty, Equals( v ))"> FAILED: - CHECK_THAT( empty, Equals(v) ) + CHECK_THAT( empty, Equals( v ) ) with expansion: { } Equals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(v, Equals(empty))"> + <failure message="CHECK_THAT(v, Equals( empty ))"> FAILED: - CHECK_THAT( v, Equals(empty) ) + CHECK_THAT( v, Equals( empty ) ) with expansion: { 1, 2, 3 } Equals: { } Matchers.tests.cpp:<line number> </failure> </testCase> <testCase name="Vector matchers that fail/UnorderedEquals" duration="{duration}"> - <failure message="CHECK_THAT(v, UnorderedEquals(empty))"> + <failure message="CHECK_THAT(v, UnorderedEquals( empty ))"> FAILED: - CHECK_THAT( v, UnorderedEquals(empty) ) + CHECK_THAT( v, UnorderedEquals( empty ) ) with expansion: { 1, 2, 3 } UnorderedEquals: { } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(empty, UnorderedEquals(v))"> + <failure message="CHECK_THAT(empty, UnorderedEquals( v ))"> FAILED: - CHECK_THAT( empty, UnorderedEquals(v) ) + CHECK_THAT( empty, UnorderedEquals( v ) ) with expansion: { } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(permuted, UnorderedEquals(v))"> + <failure message="CHECK_THAT(permuted, UnorderedEquals( v ))"> FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 1, 3 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> </failure> - <failure message="CHECK_THAT(permuted, UnorderedEquals(v))"> + <failure message="CHECK_THAT(permuted, UnorderedEquals( v ))"> FAILED: - CHECK_THAT( permuted, UnorderedEquals(v) ) + CHECK_THAT( permuted, UnorderedEquals( v ) ) with expansion: { 3, 1 } UnorderedEquals: { 1, 2, 3 } Matchers.tests.cpp:<line number> @@ -1583,17 +1594,23 @@ Misc.tests.cpp:<line number> <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" duration="{duration}"/> <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving bigger changes capacity but not size" duration="{duration}"/> <testCase name="TemplateTestSig: vectors can be sized and resized - std::string,15/reserving smaller does not change size or capacity" duration="{duration}"/> + <testCase name="Testing checked-if" duration="{duration}"/> + <testCase name="Testing checked-if 2" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Misc.tests.cpp:<line number> + </skipped> + </testCase> + <testCase name="Testing checked-if 3" duration="{duration}"> + <skipped message="FAIL()"> +FAILED: +Misc.tests.cpp:<line number> + </skipped> + </testCase> <testCase name="This test 'should' fail but doesn't" duration="{duration}"/> <testCase name="atomic if" duration="{duration}"/> <testCase name="checkedElse" duration="{duration}"/> <testCase name="checkedElse, failing" duration="{duration}"> - <failure message="CHECKED_ELSE(flag)"> -FAILED: - CHECKED_ELSE( flag ) -with expansion: - false -Misc.tests.cpp:<line number> - </failure> <failure message="REQUIRE(testCheckedElse( false ))"> FAILED: REQUIRE( testCheckedElse( false ) ) @@ -1604,13 +1621,6 @@ Misc.tests.cpp:<line number> </testCase> <testCase name="checkedIf" duration="{duration}"/> <testCase name="checkedIf, failing" duration="{duration}"> - <failure message="CHECKED_IF(flag)"> -FAILED: - CHECKED_IF( flag ) -with expansion: - false -Misc.tests.cpp:<line number> - </failure> <failure message="REQUIRE(testCheckedIf( false ))"> FAILED: REQUIRE( testCheckedIf( false ) ) diff --git a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt index edf6d1ed9517ed4aff1e95760065b455c70c9222..724cd499b98562199eb6310762be5a583eaf25a5 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -158,6 +158,14 @@ ok {test-number} - ok {test-number} - # #1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0 ok {test-number} - +# #2152 - ULP checks between differently signed values were wrong - double +ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) +# #2152 - ULP checks between differently signed values were wrong - double +ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) +# #2152 - ULP checks between differently signed values were wrong - float +ok {test-number} - smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) for: 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) +# #2152 - ULP checks between differently signed values were wrong - float +ok {test-number} - smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) for: 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) # #748 - captures with unexpected exceptions not ok {test-number} - unexpected exception with message: 'answer := 42' with 1 message: 'expected exception' # #748 - captures with unexpected exceptions @@ -579,13 +587,13 @@ ok {test-number} - 1.234f == Approx( dMedium ) for: 1.234f == Approx( 1.234 ) # Approximate comparisons with mixed numeric types ok {test-number} - dMedium == Approx( 1.234f ) for: 1.234 == Approx( 1.2339999676 ) # Arbitrary predicate matcher -ok {test-number} - 1, Predicate<int>(alwaysTrue, "always true") for: 1 matches predicate: "always true" +ok {test-number} - 1, Predicate<int>( alwaysTrue, "always true" ) for: 1 matches predicate: "always true" # Arbitrary predicate matcher -ok {test-number} - 1, !Predicate<int>(alwaysFalse, "always false") for: 1 not matches predicate: "always false" +ok {test-number} - 1, !Predicate<int>( alwaysFalse, "always false" ) for: 1 not matches predicate: "always false" # Arbitrary predicate matcher -ok {test-number} - "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") for: "Hello olleH" matches predicate: "First and last character should be equal" +ok {test-number} - "Hello olleH", Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); }, "First and last character should be equal" ) for: "Hello olleH" matches predicate: "First and last character should be equal" # Arbitrary predicate matcher -ok {test-number} - "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate +ok {test-number} - "This wouldn't pass", !Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate # Assertion macros support bit operators and bool conversions ok {test-number} - lhs | rhs for: Val: 1 | Val: 2 # Assertion macros support bit operators and bool conversions @@ -691,75 +699,75 @@ ok {test-number} - name.empty() for: true # Clara::Arg supports single-arg parse the way Opt does ok {test-number} - name == "foo" for: "foo" == "foo" # 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< decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, (MatcherA() && MatcherB()) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, MatcherA() && (MatcherB() && MatcherC()) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) +ok {test-number} - 1, MatcherA() && ( MatcherB() && MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' # Combining MatchAllOfGeneric does not nest -ok {test-number} - 1, (MatcherA() && MatcherB()) && (MatcherC() && MatcherD()) for: 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) +ok {test-number} - 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, (MatcherA() || MatcherB()) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || MatcherC() for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, MatcherA() || (MatcherB() || MatcherC()) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) +ok {test-number} - 1, MatcherA() || ( MatcherB() || MatcherC() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: value' # Combining MatchAnyOfGeneric does not nest -ok {test-number} - 1, (MatcherA() || MatcherB()) || (MatcherC() || MatcherD()) for: 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) +ok {test-number} - 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( !MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 0, !MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f # 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<decltype( !!MatcherA() ), MatcherA const&>::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 1, !!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f # 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< decltype( !!!MatcherA() ), Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 0, !!!MatcherA() for: 0 not equals: (int) 1 or (float) 1.0f # 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<decltype( !!!!MatcherA() ), MatcherA const&>::value' # Combining MatchNotOfGeneric does not nest ok {test-number} - 1, !!!!MatcherA() for: 1 equals: (int) 1 or (float) 1.0f # 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<decltype( StartsWith( "foo" ) || ( StartsWith( "bar" ) && EndsWith( "bar" ) && !EndsWith( "foo" ) ) ), Catch::Matchers::Detail::MatchAnyOf<std::string>>::value' # 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<decltype( MatcherA() || MatcherB() ), Catch::Matchers::Detail:: MatchAnyOfGeneric<MatcherA, MatcherB>>::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() || MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f 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<decltype( MatcherA() && MatcherB() ), Catch::Matchers::Detail:: MatchAllOfGeneric<MatcherA, MatcherB>>::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() && MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f 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< decltype( MatcherA() || !MatcherB() ), Catch::Matchers::Detail::MatchAnyOfGeneric< MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value' # Combining only templated matchers ok {test-number} - 1, MatcherA() || !MatcherB() for: 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) # Combining templated and concrete matchers -ok {test-number} - 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 } ) +ok {test-number} - 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 } ) # Combining templated and concrete matchers -ok {test-number} - str, StartsWith("foo") && EqualsRange(arr) && EndsWith("bar") for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) +ok {test-number} - str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) # Combining templated and concrete matchers -ok {test-number} - str, StartsWith("foo") && !EqualsRange(bad_arr) && EndsWith("bar") for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) +ok {test-number} - str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) for: "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) # Combining templated and concrete matchers -ok {test-number} - str, EqualsRange(arr) && StartsWith("foo") && EndsWith("bar") for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +ok {test-number} - str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) # Combining templated and concrete matchers -ok {test-number} - str, !EqualsRange(bad_arr) && StartsWith("foo") && EndsWith("bar") for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) +ok {test-number} - str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) for: "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) # Combining templated and concrete matchers -ok {test-number} - str, EqualsRange(bad_arr) || (StartsWith("foo") && EndsWith("bar")) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) +ok {test-number} - str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) for: "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) # Combining templated and concrete matchers -ok {test-number} - str, (StartsWith("foo") && EndsWith("bar")) || EqualsRange(bad_arr) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) +ok {test-number} - str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) for: "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) # Combining templated matchers -ok {test-number} - container, EqualsRange(a) || EqualsRange(b) || EqualsRange(c) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) +ok {test-number} - container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) for: { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) # Commas in various macros are allowed ok {test-number} - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} # Commas in various macros are allowed @@ -867,7 +875,7 @@ ok {test-number} - first.matchCalled for: true # Composed generic matchers shortcircuit ok {test-number} - !second.matchCalled for: true # Composed generic matchers shortcircuit -ok {test-number} - matcher.match(1) for: true +ok {test-number} - matcher.match( 1 ) for: true # Composed generic matchers shortcircuit ok {test-number} - first.matchCalled for: true # Composed generic matchers shortcircuit @@ -885,9 +893,9 @@ ok {test-number} - first.matchCalled for: true # Composed matchers shortcircuit ok {test-number} - !second.matchCalled for: true # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) +not ok {test-number} - testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "not there" (case insensitive) # Contains string matcher -not ok {test-number} - testStringForMatching(), Contains("STRING") for: "this string contains 'abc' as a substring" contains: "STRING" +not ok {test-number} - testStringForMatching(), Contains( "STRING" ) for: "this string contains 'abc' as a substring" contains: "STRING" # Copy and then generate a range ok {test-number} - elem % 2 == 1 for: 1 == 1 # Copy and then generate a range @@ -933,9 +941,9 @@ ok {test-number} - enumInfo->lookup(1) == "Value2" for: Value2 == "Value2" # Directly creating an EnumInfo ok {test-number} - enumInfo->lookup(3) == "{** unexpected enum value **}" for: {** unexpected enum value **} == "{** unexpected enum value **}" # EndsWith string matcher -not ok {test-number} - testStringForMatching(), EndsWith("Substring") for: "this string contains 'abc' as a substring" ends with: "Substring" +not ok {test-number} - testStringForMatching(), EndsWith( "Substring" ) for: "this string contains 'abc' as a substring" ends with: "Substring" # EndsWith string matcher -not ok {test-number} - testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) +not ok {test-number} - testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: "this" (case insensitive) # Enums can quickly have stringification enabled using REGISTER_ENUM ok {test-number} - stringify( EnumClass3::Value1 ) == "Value1" for: "Value1" == "Value1" # Enums can quickly have stringification enabled using REGISTER_ENUM @@ -993,13 +1001,13 @@ ok {test-number} - data.str_hello.size() == 5 for: 5 == 5 # Equality checks that should succeed ok {test-number} - x == Approx( 1.3 ) for: 1.3 == Approx( 1.3 ) # Equals -ok {test-number} - testStringForMatching(), Equals("this string contains 'abc' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" +ok {test-number} - testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" # Equals -ok {test-number} - testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) +ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) # Equals string matcher -not ok {test-number} - testStringForMatching(), Equals("this string contains 'ABC' as a substring") for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" +not ok {test-number} - testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) for: "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" # Equals string matcher -not ok {test-number} - testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) +not ok {test-number} - testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" equals: "something else" (case insensitive) # Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified ok {test-number} - ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" for: "This exception has overridden what() method" == "This exception has overridden what() method" # Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified @@ -1007,21 +1015,21 @@ ok {test-number} - ::Catch::Detail::stringify(OperatorException{}) == "OperatorE # Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified ok {test-number} - ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" for: "StringMakerException" == "StringMakerException" # Exception matchers that fail -not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1} +not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } # Exception matchers that fail -not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{1} +not ok {test-number} - expected exception, got none; expression was: doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } # Exception matchers that fail -not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1} +not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } # Exception matchers that fail -not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt(1), SpecialException, ExceptionMatcher{1} +not ok {test-number} - unexpected exception with message: 'Unknown exception'; expression was: throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } # Exception matchers that fail -not ok {test-number} - throwsSpecialException(3), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 +not ok {test-number} - throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 # Exception matchers that fail -not ok {test-number} - throwsSpecialException(4), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 +not ok {test-number} - throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 # Exception matchers that succeed -ok {test-number} - throwsSpecialException(1), SpecialException, ExceptionMatcher{1} for: SpecialException::what special exception has value of 1 +ok {test-number} - throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } for: SpecialException::what special exception has value of 1 # Exception matchers that succeed -ok {test-number} - throwsSpecialException(2), SpecialException, ExceptionMatcher{2} for: SpecialException::what special exception has value of 2 +ok {test-number} - throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } for: SpecialException::what special exception has value of 2 # Exception messages can be tested for ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" # Exception messages can be tested for @@ -1035,13 +1043,13 @@ ok {test-number} - thisThrows(), Contains( "except" ) for: "expected exception" # Exception messages can be tested for ok {test-number} - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) for: "expected exception" contains: "except" (case insensitive) # Exceptions matchers -ok {test-number} - throwsDerivedException(), DerivedException, Message("DerivedException::what") for: DerivedException::what exception message matches "DerivedException::what" +ok {test-number} - throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) for: DerivedException::what exception message matches "DerivedException::what" # Exceptions matchers -ok {test-number} - throwsDerivedException(), DerivedException, !Message("derivedexception::what") for: DerivedException::what not exception message matches "derivedexception::what" +ok {test-number} - throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) for: DerivedException::what not exception message matches "derivedexception::what" # Exceptions matchers -ok {test-number} - throwsSpecialException(2), SpecialException, !Message("DerivedException::what") for: SpecialException::what not exception message matches "DerivedException::what" +ok {test-number} - throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) for: SpecialException::what not exception message matches "DerivedException::what" # Exceptions matchers -ok {test-number} - throwsSpecialException(2), SpecialException, Message("SpecialException::what") for: SpecialException::what exception message matches "SpecialException::what" +ok {test-number} - throwsSpecialException( 2 ), SpecialException, Message( "SpecialException::what" ) for: SpecialException::what exception message matches "SpecialException::what" # Expected exceptions that don't throw or unexpected exceptions fail the test not ok {test-number} - unexpected exception with message: 'expected exception'; expression was: thisThrows(), std::string # Expected exceptions that don't throw or unexpected exceptions fail the test @@ -1067,125 +1075,127 @@ ok {test-number} - Factorial(3) == 6 for: 6 == 6 # Factorials are computed ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) # Floating point matchers: double -ok {test-number} - 10., WithinRel(11.1, 0.1) for: 10.0 and 11.1 are within 10% of each other +ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other # Floating point matchers: double -ok {test-number} - 10., !WithinRel(11.2, 0.1) for: 10.0 not and 11.2 are within 10% of each other +ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other # Floating point matchers: double -ok {test-number} - 1., !WithinRel(0., 0.99) for: 1.0 not and 0 are within 99% of each other +ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other # Floating point matchers: double -ok {test-number} - -0., WithinRel(0.) for: -0.0 and 0 are within 2.22045e-12% of each other +ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other # Floating point matchers: double -ok {test-number} - v1, WithinRel(v2) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other # Floating point matchers: double -ok {test-number} - 1., WithinAbs(1., 0) for: 1.0 is within 0.0 of 1.0 +ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0 # Floating point matchers: double -ok {test-number} - 0., WithinAbs(1., 1) for: 0.0 is within 1.0 of 1.0 +ok {test-number} - 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0 # Floating point matchers: double -ok {test-number} - 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 # Floating point matchers: double -ok {test-number} - 0., !WithinAbs(1., 0.99) for: 0.0 not is within 0.99 of 1.0 +ok {test-number} - 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0 # Floating point matchers: double -ok {test-number} - 11., !WithinAbs(10., 0.5) for: 11.0 not is within 0.5 of 10.0 +ok {test-number} - 11., !WithinAbs( 10., 0.5 ) for: 11.0 not is within 0.5 of 10.0 # Floating point matchers: double -ok {test-number} - 10., !WithinAbs(11., 0.5) for: 10.0 not is within 0.5 of 11.0 +ok {test-number} - 10., !WithinAbs( 11., 0.5 ) for: 10.0 not is within 0.5 of 11.0 # Floating point matchers: double -ok {test-number} - -10., WithinAbs(-10., 0.5) for: -10.0 is within 0.5 of -10.0 +ok {test-number} - -10., WithinAbs( -10., 0.5 ) for: -10.0 is within 0.5 of -10.0 # Floating point matchers: double -ok {test-number} - -10., WithinAbs(-9.6, 0.5) for: -10.0 is within 0.5 of -9.6 +ok {test-number} - -10., WithinAbs( -9.6, 0.5 ) for: -10.0 is within 0.5 of -9.6 # Floating point matchers: double -ok {test-number} - 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +ok {test-number} - 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) # Floating point matchers: double -ok {test-number} - nextafter(1., 2.), WithinULP(1., 1) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) +ok {test-number} - nextafter( 1., 2. ), WithinULP( 1., 1 ) for: 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) # Floating point matchers: double -ok {test-number} - 0., WithinULP(nextafter(0., 1.), 1) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) +ok {test-number} - 0., WithinULP( nextafter( 0., 1. ), 1 ) for: 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) # Floating point matchers: double -ok {test-number} - 1., WithinULP(nextafter(1., 0.), 1) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) +ok {test-number} - 1., WithinULP( nextafter( 1., 0. ), 1 ) for: 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) # Floating point matchers: double -ok {test-number} - 1., !WithinULP(nextafter(1., 2.), 0) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) +ok {test-number} - 1., !WithinULP( nextafter( 1., 2. ), 0 ) for: 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) # Floating point matchers: double -ok {test-number} - 1., WithinULP(1., 0) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) +ok {test-number} - 1., WithinULP( 1., 0 ) for: 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) # Floating point matchers: double -ok {test-number} - -0., WithinULP(0., 0) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) +ok {test-number} - -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) # Floating point matchers: double -ok {test-number} - 1., WithinAbs(1., 0.5) || WithinULP(2., 1) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) +ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) # Floating point matchers: double -ok {test-number} - 1., WithinAbs(2., 0.5) || WithinULP(1., 0) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) +ok {test-number} - 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) # Floating point matchers: double -ok {test-number} - 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) # Floating point matchers: double -ok {test-number} - WithinAbs(1., 0.) +ok {test-number} - WithinAbs( 1., 0. ) # Floating point matchers: double -ok {test-number} - WithinAbs(1., -1.), std::domain_error +ok {test-number} - WithinAbs( 1., -1. ), std::domain_error # Floating point matchers: double -ok {test-number} - WithinULP(1., 0) +ok {test-number} - WithinULP( 1., 0 ) # Floating point matchers: double -ok {test-number} - WithinRel(1., 0.) +ok {test-number} - WithinRel( 1., 0. ) # Floating point matchers: double -ok {test-number} - WithinRel(1., -0.2), std::domain_error +ok {test-number} - WithinRel( 1., -0.2 ), std::domain_error # Floating point matchers: double -ok {test-number} - WithinRel(1., 1.), std::domain_error +ok {test-number} - WithinRel( 1., 1. ), std::domain_error +# Floating point matchers: float +ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other # Floating point matchers: float -ok {test-number} - 10.f, WithinRel(11.1f, 0.1f) for: 10.0f and 11.1 are within 10% of each other +ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other # Floating point matchers: float -ok {test-number} - 10.f, !WithinRel(11.2f, 0.1f) for: 10.0f not and 11.2 are within 10% of each other +ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other # Floating point matchers: float -ok {test-number} - 1.f, !WithinRel(0.f, 0.99f) for: 1.0f not and 0 are within 99% of each other +ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other # Floating point matchers: float -ok {test-number} - -0.f, WithinRel(0.f) for: -0.0f and 0 are within 0.00119209% of each other +ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other # Floating point matchers: float -ok {test-number} - v1, WithinRel(v2) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other +ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0 # Floating point matchers: float -ok {test-number} - 1.f, WithinAbs(1.f, 0) for: 1.0f is within 0.0 of 1.0 +ok {test-number} - 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0 # Floating point matchers: float -ok {test-number} - 0.f, WithinAbs(1.f, 1) for: 0.0f is within 1.0 of 1.0 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 # Floating point matchers: float -ok {test-number} - 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0 +ok {test-number} - 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0 # Floating point matchers: float -ok {test-number} - 0.f, !WithinAbs(1.f, 0.99f) for: 0.0f not is within 0.9900000095 of 1.0 +ok {test-number} - 0.f, WithinAbs( -0.f, 0 ) for: 0.0f is within 0.0 of -0.0 # Floating point matchers: float -ok {test-number} - 0.f, WithinAbs(-0.f, 0) for: 0.0f is within 0.0 of -0.0 +ok {test-number} - 11.f, !WithinAbs( 10.f, 0.5f ) for: 11.0f not is within 0.5 of 10.0 # Floating point matchers: float -ok {test-number} - 11.f, !WithinAbs(10.f, 0.5f) for: 11.0f not is within 0.5 of 10.0 +ok {test-number} - 10.f, !WithinAbs( 11.f, 0.5f ) for: 10.0f not is within 0.5 of 11.0 # Floating point matchers: float -ok {test-number} - 10.f, !WithinAbs(11.f, 0.5f) for: 10.0f not is within 0.5 of 11.0 +ok {test-number} - -10.f, WithinAbs( -10.f, 0.5f ) for: -10.0f is within 0.5 of -10.0 # Floating point matchers: float -ok {test-number} - -10.f, WithinAbs(-10.f, 0.5f) for: -10.0f is within 0.5 of -10.0 +ok {test-number} - -10.f, WithinAbs( -9.6f, 0.5f ) for: -10.0f is within 0.5 of -9.6000003815 # Floating point matchers: float -ok {test-number} - -10.f, WithinAbs(-9.6f, 0.5f) for: -10.0f is within 0.5 of -9.6000003815 +ok {test-number} - 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) # Floating point matchers: float -ok {test-number} - 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +ok {test-number} - -1.f, WithinULP( -1.f, 0 ) for: -1.0f is within 0 ULPs of -1.00000000e+00f ([-1.00000000e+00, -1.00000000e+00]) # Floating point matchers: float -ok {test-number} - nextafter(1.f, 2.f), WithinULP(1.f, 1) for: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) +ok {test-number} - nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) for: 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) # Floating point matchers: float -ok {test-number} - 0.f, WithinULP(nextafter(0.f, 1.f), 1) for: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) +ok {test-number} - 0.f, WithinULP( nextafter( 0.f, 1.f ), 1 ) for: 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) # Floating point matchers: float -ok {test-number} - 1.f, WithinULP(nextafter(1.f, 0.f), 1) for: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) +ok {test-number} - 1.f, WithinULP( nextafter( 1.f, 0.f ), 1 ) for: 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) # Floating point matchers: float -ok {test-number} - 1.f, !WithinULP(nextafter(1.f, 2.f), 0) for: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) +ok {test-number} - 1.f, !WithinULP( nextafter( 1.f, 2.f ), 0 ) for: 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) # Floating point matchers: float -ok {test-number} - 1.f, WithinULP(1.f, 0) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) +ok {test-number} - 1.f, WithinULP( 1.f, 0 ) for: 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) # Floating point matchers: float -ok {test-number} - -0.f, WithinULP(0.f, 0) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) +ok {test-number} - -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) # Floating point matchers: float -ok {test-number} - 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) +ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) # Floating point matchers: float -ok {test-number} - 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) +ok {test-number} - 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) # Floating point matchers: float -ok {test-number} - 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) +ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) # Floating point matchers: float -ok {test-number} - WithinAbs(1.f, 0.f) +ok {test-number} - WithinAbs( 1.f, 0.f ) # Floating point matchers: float -ok {test-number} - WithinAbs(1.f, -1.f), std::domain_error +ok {test-number} - WithinAbs( 1.f, -1.f ), std::domain_error # Floating point matchers: float -ok {test-number} - WithinULP(1.f, 0) +ok {test-number} - WithinULP( 1.f, 0 ) # Floating point matchers: float -ok {test-number} - WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error +ok {test-number} - WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error # Floating point matchers: float -ok {test-number} - WithinRel(1.f, 0.f) +ok {test-number} - WithinRel( 1.f, 0.f ) # Floating point matchers: float -ok {test-number} - WithinRel(1.f, -0.2f), std::domain_error +ok {test-number} - WithinRel( 1.f, -0.2f ), std::domain_error # Floating point matchers: float -ok {test-number} - WithinRel(1.f, 1.f), std::domain_error +ok {test-number} - WithinRel( 1.f, 1.f ), std::domain_error # Generators -- adapters ok {test-number} - i % 2 == 0 for: 0 == 0 # Generators -- adapters @@ -1781,19 +1791,19 @@ ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.23 <= Approx( 1.22 ) # ManuallyRegistered ok {test-number} - with 1 message: 'was called' # Matchers can be (AllOf) composed with the && operator -ok {test-number} - testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) +ok {test-number} - testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) # Matchers can be (AnyOf) composed with the || operator -ok {test-number} - testStringForMatching(), Contains("string") || Contains("different") || Contains("random") for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) +ok {test-number} - testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be (AnyOf) composed with the || operator -ok {test-number} - testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) +ok {test-number} - testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) # Matchers can be composed with both && and || -ok {test-number} - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) +ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) # Matchers can be composed with both && and || - failing -not ok {test-number} - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) +not ok {test-number} - testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) for: "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) # Matchers can be negated (Not) with the ! operator -ok {test-number} - testStringForMatching(), !Contains("different") for: "this string contains 'abc' as a substring" not contains: "different" +ok {test-number} - testStringForMatching(), !Contains( "different" ) for: "this string contains 'abc' as a substring" not contains: "different" # Matchers can be negated (Not) with the ! operator - failing -not ok {test-number} - testStringForMatching(), !Contains("substring") for: "this string contains 'abc' as a substring" not contains: "substring" +not ok {test-number} - testStringForMatching(), !Contains( "substring" ) for: "this string contains 'abc' as a substring" not contains: "substring" # Mismatching exception messages failing the test ok {test-number} - thisThrows(), "expected exception" for: "expected exception" equals: "expected exception" # Mismatching exception messages failing the test @@ -1951,13 +1961,13 @@ not ok {test-number} - explicitly with 1 message: 'Message from section one' # Output from all sections is reported not ok {test-number} - explicitly with 1 message: 'Message from section two' # Overloaded comma or address-of operators are not used -ok {test-number} - (EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed +ok {test-number} - ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed # Overloaded comma or address-of operators are not used ok {test-number} - &EvilMatcher(), EvilAddressOfOperatorUsed # Overloaded comma or address-of operators are not used -ok {test-number} - EvilMatcher() || (EvilMatcher() && !EvilMatcher()) +ok {test-number} - EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) # Overloaded comma or address-of operators are not used -ok {test-number} - (EvilMatcher() && EvilMatcher()) || !EvilMatcher() +ok {test-number} - ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() # Parse test names and tags ok {test-number} - spec.hasFilters() == false for: false == false # Parse test names and tags @@ -2285,7 +2295,7 @@ ok {test-number} - str1.size() == 2 + 5 for: 7 == 7 # Precision of floating point stringification can be set ok {test-number} - str2.size() == 2 + 15 for: 17 == 17 # Predicate matcher can accept const char* -ok {test-number} - "foo", Predicate<const char*>([] (const char* const&) { return true; }) for: "foo" matches undescribed predicate +ok {test-number} - "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) for: "foo" matches undescribed predicate # Process can be configured on command line ok {test-number} - result for: {?} # Process can be configured on command line @@ -2461,13 +2471,13 @@ ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ } # Reconstruction should be based on stringification: #914 not ok {test-number} - truthy(false) for: Hey, its truthy! # Regex string matcher -not ok {test-number} - testStringForMatching(), Matches("this STRING contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively +not ok {test-number} - testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively # Regex string matcher -not ok {test-number} - testStringForMatching(), Matches("contains 'abc' as a substring") for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively +not ok {test-number} - testStringForMatching(), Matches( "contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively # Regex string matcher -not ok {test-number} - testStringForMatching(), Matches("this string contains 'abc' as a") for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively +not ok {test-number} - testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively # Regression test #1 -ok {test-number} - actual, !UnorderedEquals(expected) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } +ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } # Reporter's write listings to provided stream ok {test-number} - !(factories.empty()) for: !false # Reporter's write listings to provided stream @@ -2616,9 +2626,9 @@ ok {test-number} - Approx( d ) != 1.24 for: Approx( 1.23 ) != 1.24 Message from section one Message from section two # StartsWith string matcher -not ok {test-number} - testStringForMatching(), StartsWith("This String") for: "this string contains 'abc' as a substring" starts with: "This String" +not ok {test-number} - testStringForMatching(), StartsWith( "This String" ) for: "this string contains 'abc' as a substring" starts with: "This String" # StartsWith string matcher -not ok {test-number} - testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) +not ok {test-number} - testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "string" (case insensitive) # Static arrays are convertible to string ok {test-number} - Catch::Detail::stringify(singular) == "{ 1 }" for: "{ 1 }" == "{ 1 }" # Static arrays are convertible to string @@ -2626,50 +2636,38 @@ ok {test-number} - Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" for: "{ 3, 2, # Static arrays are convertible to string ok {test-number} - Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" for: "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" == "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" # String matchers -ok {test-number} - testStringForMatching(), Contains("string") for: "this string contains 'abc' as a substring" contains: "string" +ok {test-number} - testStringForMatching(), Contains( "string" ) for: "this string contains 'abc' as a substring" contains: "string" # String matchers -ok {test-number} - testStringForMatching(), Contains("string", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) +ok {test-number} - testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "string" (case insensitive) # String matchers -ok {test-number} - testStringForMatching(), Contains("abc") for: "this string contains 'abc' as a substring" contains: "abc" +ok {test-number} - testStringForMatching(), Contains( "abc" ) for: "this string contains 'abc' as a substring" contains: "abc" # String matchers -ok {test-number} - testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) +ok {test-number} - testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" contains: "abc" (case insensitive) # String matchers -ok {test-number} - testStringForMatching(), StartsWith("this") for: "this string contains 'abc' as a substring" starts with: "this" +ok {test-number} - testStringForMatching(), StartsWith( "this" ) for: "this string contains 'abc' as a substring" starts with: "this" # String matchers -ok {test-number} - testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) +ok {test-number} - testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" starts with: "this" (case insensitive) # String matchers -ok {test-number} - testStringForMatching(), EndsWith("substring") for: "this string contains 'abc' as a substring" ends with: "substring" +ok {test-number} - testStringForMatching(), EndsWith( "substring" ) for: "this string contains 'abc' as a substring" ends with: "substring" # String matchers -ok {test-number} - testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) +ok {test-number} - testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) for: "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) # StringRef ok {test-number} - empty.empty() for: true # StringRef ok {test-number} - empty.size() == 0 for: 0 == 0 # StringRef -ok {test-number} - empty.isNullTerminated() for: true -# StringRef -ok {test-number} - std::strcmp( empty.c_str(), "" ) == 0 for: 0 == 0 +ok {test-number} - std::strcmp( empty.data(), "" ) == 0 for: 0 == 0 # StringRef ok {test-number} - s.empty() == false for: false == false # StringRef ok {test-number} - s.size() == 5 for: 5 == 5 # StringRef -ok {test-number} - s.isNullTerminated() for: true -# StringRef ok {test-number} - std::strcmp( rawChars, "hello" ) == 0 for: 0 == 0 # StringRef -ok {test-number} - s.c_str() -# StringRef -ok {test-number} - s.c_str() == rawChars for: "hello" == "hello" -# StringRef ok {test-number} - s.data() == rawChars for: "hello" == "hello" # StringRef ok {test-number} - original == "original" # StringRef -ok {test-number} - !(original.isNullTerminated()) for: !false -# StringRef -ok {test-number} - original.c_str() -# StringRef ok {test-number} - original.data() # StringRef ok {test-number} - ss.empty() == false for: false == false @@ -2682,7 +2680,7 @@ ok {test-number} - ss == "hello" for: hello == "hello" # StringRef ok {test-number} - ss.size() == 6 for: 6 == 6 # StringRef -ok {test-number} - std::strcmp( ss.c_str(), "world!" ) == 0 for: 0 == 0 +ok {test-number} - std::strcmp( ss.data(), "world!" ) == 0 for: 0 == 0 # StringRef ok {test-number} - s.data() == s2.data() for: "hello world!" == "hello world!" # StringRef @@ -2690,7 +2688,7 @@ ok {test-number} - s.data() == ss.data() for: "hello world!" == "hello world!" # StringRef ok {test-number} - s.substr(s.size() + 1, 123).empty() for: true # StringRef -ok {test-number} - std::strcmp(ss.c_str(), "world!") == 0 for: 0 == 0 +ok {test-number} - std::strcmp(ss.data(), "world!") == 0 for: 0 == 0 # StringRef ok {test-number} - s.substr(1'000'000, 1).empty() for: true # StringRef @@ -2730,8 +2728,6 @@ ok {test-number} - with 1 message: 'empty.begin() == empty.end()' # StringRef at compilation time ok {test-number} - with 1 message: 'stringref.size() == 3' # StringRef at compilation time -ok {test-number} - with 1 message: 'stringref.isNullTerminated()' -# StringRef at compilation time ok {test-number} - with 1 message: 'stringref.data() == abc' # StringRef at compilation time ok {test-number} - with 1 message: 'stringref.begin() == abc' @@ -2750,21 +2746,25 @@ ok {test-number} - with 1 message: 'shortened.data() == abc' # StringRef at compilation time ok {test-number} - with 1 message: 'shortened.begin() != shortened.end()' # StringRef at compilation time -ok {test-number} - with 1 message: '!(shortened.isNullTerminated())' -# StringRef at compilation time -ok {test-number} - with 1 message: '!(shortened.substr(1, 3).isNullTerminated())' -# StringRef at compilation time ok {test-number} - with 1 message: '!(sr1.empty())' # StringRef at compilation time ok {test-number} - with 1 message: 'sr1.size() == 3' # StringRef at compilation time -ok {test-number} - with 1 message: 'sr1.isNullTerminated()' -# StringRef at compilation time ok {test-number} - with 1 message: 'sr2.empty()' # StringRef at compilation time ok {test-number} - with 1 message: 'sr2.size() == 0' -# StringRef at compilation time -ok {test-number} - with 1 message: 'sr2.isNullTerminated()' +# Stringifying char arrays with statically known sizes - char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - signed char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - signed char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - unsigned char +ok {test-number} - ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" +# Stringifying char arrays with statically known sizes - unsigned char +ok {test-number} - ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s for: ""abc"" == ""abc"" # Stringifying std::chrono::duration helpers ok {test-number} - minute == seconds for: 1 m == 60 s # Stringifying std::chrono::duration helpers @@ -3095,6 +3095,26 @@ ok {test-number} - with 1 message: 'no assertions' ok {test-number} - 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 # Test with special, characters "in name ok {test-number} - +# Testing checked-if +ok {test-number} - true +# Testing checked-if +ok {test-number} - +# Testing checked-if +ok {test-number} - false # TODO +# Testing checked-if +ok {test-number} - true +# Testing checked-if +ok {test-number} - false # TODO +# Testing checked-if +ok {test-number} - +# Testing checked-if 2 +ok {test-number} - true +# Testing checked-if 2 +not ok {test-number} - explicitly +# Testing checked-if 3 +ok {test-number} - false # TODO +# Testing checked-if 3 +not ok {test-number} - explicitly # The NO_FAIL macro reports a failure but does not fail the test ok {test-number} - 1 == 2 # TODO # The default listing implementation write to provided stream @@ -3390,99 +3410,99 @@ ok {test-number} - approx( d ) != 1.25 for: Approx( 1.23 ) != 1.25 # Variadic macros ok {test-number} - with 1 message: 'no assertions' # Vector Approx matcher -ok {test-number} - empty, Approx(empty) for: { } is approx: { } +ok {test-number} - empty, Approx( empty ) for: { } is approx: { } # Vector Approx matcher -ok {test-number} - v1, Approx(v1) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +ok {test-number} - v1, Approx( v1 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } # Vector Approx matcher -ok {test-number} - v1, Approx<double>({ 1., 2., 3. }) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } +ok {test-number} - v1, Approx<double>( { 1., 2., 3. } ) for: { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } # Vector Approx matcher -ok {test-number} - v1, !Approx(temp) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } +ok {test-number} - v1, !Approx( temp ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } # Vector Approx matcher -ok {test-number} - v1, !Approx(v2) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } +ok {test-number} - v1, !Approx( v2 ) for: { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } # Vector Approx matcher -ok {test-number} - v1, Approx(v2).margin(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +ok {test-number} - v1, Approx( v2 ).margin( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } # Vector Approx matcher -ok {test-number} - v1, Approx(v2).epsilon(0.5) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +ok {test-number} - v1, Approx( v2 ).epsilon( 0.5 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } # Vector Approx matcher -ok {test-number} - v1, Approx(v2).epsilon(0.1).scale(500) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } +ok {test-number} - v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) for: { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } # Vector Approx matcher -- failing -not ok {test-number} - empty, Approx(t1) for: { } is approx: { 1.0, 2.0 } +not ok {test-number} - empty, Approx( t1 ) for: { } is approx: { 1.0, 2.0 } # Vector Approx matcher -- failing -not ok {test-number} - v1, Approx(v2) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } +not ok {test-number} - v1, Approx( v2 ) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } # Vector matchers -ok {test-number} - v, VectorContains(1) for: { 1, 2, 3 } Contains: 1 +ok {test-number} - v, VectorContains( 1 ) for: { 1, 2, 3 } Contains: 1 # Vector matchers -ok {test-number} - v, VectorContains(2) for: { 1, 2, 3 } Contains: 2 +ok {test-number} - v, VectorContains( 2 ) for: { 1, 2, 3 } Contains: 2 # Vector matchers -ok {test-number} - v5, (VectorContains<int, CustomAllocator<int>>(2)) for: { 1, 2, 3 } Contains: 2 +ok {test-number} - v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) for: { 1, 2, 3 } Contains: 2 # Vector matchers -ok {test-number} - v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2 } +ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2 } # Vector matchers -ok {test-number} - v, Contains<int>({ 1, 2 }) for: { 1, 2, 3 } Contains: { 1, 2 } +ok {test-number} - v, Contains<int>( { 1, 2 } ) for: { 1, 2, 3 } Contains: { 1, 2 } # Vector matchers -ok {test-number} - v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2 } +ok {test-number} - v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2 } # Vector matchers -ok {test-number} - v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } # Vector matchers -ok {test-number} - v, Contains(empty) for: { 1, 2, 3 } Contains: { } +ok {test-number} - v, Contains( empty ) for: { 1, 2, 3 } Contains: { } # Vector matchers -ok {test-number} - empty, Contains(empty) for: { } Contains: { } +ok {test-number} - empty, Contains( empty ) for: { } Contains: { } # Vector matchers -ok {test-number} - v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2, 3 } +ok {test-number} - v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Contains: { 1, 2, 3 } # Vector matchers -ok {test-number} - v5, Contains(v6) for: { 1, 2, 3 } Contains: { 1, 2 } +ok {test-number} - v5, Contains( v6 ) for: { 1, 2, 3 } Contains: { 1, 2 } # Vector matchers -ok {test-number} - v, VectorContains(1) && VectorContains(2) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) +ok {test-number} - v, VectorContains( 1 ) && VectorContains( 2 ) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) # Vector matchers -ok {test-number} - v, Equals(v) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +ok {test-number} - v, Equals( v ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } # Vector matchers -ok {test-number} - empty, Equals(empty) for: { } Equals: { } +ok {test-number} - empty, Equals( empty ) for: { } Equals: { } # Vector matchers -ok {test-number} - v, Equals<int>({ 1, 2, 3 }) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +ok {test-number} - v, Equals<int>( { 1, 2, 3 } ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +ok {test-number} - v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +ok {test-number} - v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v5, Equals(v6) for: { 1, 2, 3 } Equals: { 1, 2, 3 } +ok {test-number} - v5, Equals( v6 ) for: { 1, 2, 3 } Equals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v, UnorderedEquals(v) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } +ok {test-number} - v, UnorderedEquals( v ) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v, UnorderedEquals<int>({ 3, 2, 1 }) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } +ok {test-number} - v, UnorderedEquals<int>( { 3, 2, 1 } ) for: { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } # Vector matchers -ok {test-number} - empty, UnorderedEquals(empty) for: { } UnorderedEquals: { } +ok {test-number} - empty, UnorderedEquals( empty ) for: { } UnorderedEquals: { } # Vector matchers -ok {test-number} - permuted, UnorderedEquals(v) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +ok {test-number} - permuted, UnorderedEquals( v ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } # Vector matchers -ok {test-number} - permuted, UnorderedEquals(v) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } +ok {test-number} - permuted, UnorderedEquals( v ) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } # Vector matchers -ok {test-number} - v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } +ok {test-number} - v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } # Vector matchers -ok {test-number} - v5_permuted, UnorderedEquals(v5) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } +ok {test-number} - v5_permuted, UnorderedEquals( v5 ) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - v, VectorContains(-1) for: { 1, 2, 3 } Contains: -1 +not ok {test-number} - v, VectorContains( -1 ) for: { 1, 2, 3 } Contains: -1 # Vector matchers that fail -not ok {test-number} - empty, VectorContains(1) for: { } Contains: 1 +not ok {test-number} - empty, VectorContains( 1 ) for: { } Contains: 1 # Vector matchers that fail -not ok {test-number} - empty, Contains(v) for: { } Contains: { 1, 2, 3 } +not ok {test-number} - empty, Contains( v ) for: { } Contains: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 4 } +not ok {test-number} - v, Contains( v2 ) for: { 1, 2, 3 } Contains: { 1, 2, 4 } # Vector matchers that fail -not ok {test-number} - v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2 } +not ok {test-number} - v, Equals( v2 ) for: { 1, 2, 3 } Equals: { 1, 2 } # Vector matchers that fail -not ok {test-number} - v2, Equals(v) for: { 1, 2 } Equals: { 1, 2, 3 } +not ok {test-number} - v2, Equals( v ) for: { 1, 2 } Equals: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - empty, Equals(v) for: { } Equals: { 1, 2, 3 } +not ok {test-number} - empty, Equals( v ) for: { } Equals: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - v, Equals(empty) for: { 1, 2, 3 } Equals: { } +not ok {test-number} - v, Equals( empty ) for: { 1, 2, 3 } Equals: { } # Vector matchers that fail -not ok {test-number} - v, UnorderedEquals(empty) for: { 1, 2, 3 } UnorderedEquals: { } +not ok {test-number} - v, UnorderedEquals( empty ) for: { 1, 2, 3 } UnorderedEquals: { } # Vector matchers that fail -not ok {test-number} - empty, UnorderedEquals(v) for: { } UnorderedEquals: { 1, 2, 3 } +not ok {test-number} - empty, UnorderedEquals( v ) for: { } UnorderedEquals: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - permuted, UnorderedEquals(v) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 } +not ok {test-number} - permuted, UnorderedEquals( v ) for: { 1, 3 } UnorderedEquals: { 1, 2, 3 } # Vector matchers that fail -not ok {test-number} - permuted, UnorderedEquals(v) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 } +not ok {test-number} - permuted, UnorderedEquals( v ) for: { 3, 1 } UnorderedEquals: { 1, 2, 3 } # When checked exceptions are thrown they can be expected or unexpected ok {test-number} - thisThrows(), std::domain_error # When checked exceptions are thrown they can be expected or unexpected @@ -3531,6 +3551,8 @@ ok {test-number} - encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) = ok {test-number} - encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" # XmlEncode ok {test-number} - encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" +# XmlWriter writes boolean attributes as true/false +ok {test-number} - stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") for: "<?xml version="1.0" encoding="UTF-8"?> <Element1 attr1="true" attr2="false"/> " ( contains: "attr1="true"" and contains: "attr2="false"" ) # analyse no analysis ok {test-number} - analysis.mean.point.count() == 23 for: 23.0 == 23 # analyse no analysis @@ -3592,7 +3614,7 @@ ok {test-number} - flag for: true # checkedElse ok {test-number} - testCheckedElse( true ) for: true # checkedElse, failing -not ok {test-number} - flag for: false +ok {test-number} - flag for: false # TODO # checkedElse, failing not ok {test-number} - testCheckedElse( false ) for: false # checkedIf @@ -3600,7 +3622,7 @@ ok {test-number} - flag for: true # checkedIf ok {test-number} - testCheckedIf( true ) for: true # checkedIf, failing -not ok {test-number} - flag for: false +ok {test-number} - flag for: false # TODO # checkedIf, failing not ok {test-number} - testCheckedIf( false ) for: false # classify_outliers @@ -3691,6 +3713,20 @@ ok {test-number} - long_var == unsigned_short_var for: 1 == 1 ok {test-number} - long_var == unsigned_int_var for: 1 == 1 # comparisons between int variables ok {test-number} - long_var == unsigned_long_var for: 1 == 1 +# convertToBits +ok {test-number} - convertToBits( 0.f ) == 0 for: 0 == 0 +# convertToBits +ok {test-number} - convertToBits( -0.f ) == ( 1ULL << 31 ) for: 2147483648 (0x<hex digits>) == 2147483648 (0x<hex digits>) +# convertToBits +ok {test-number} - convertToBits( 0. ) == 0 for: 0 == 0 +# convertToBits +ok {test-number} - convertToBits( -0. ) == ( 1ULL << 63 ) for: 9223372036854775808 (0x<hex digits>) == 9223372036854775808 (0x<hex digits>) +# convertToBits +ok {test-number} - convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 for: 1 == 1 +# convertToBits +ok {test-number} - convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 for: 1 == 1 +# empty tags are not allowed +ok {test-number} - Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) # erfc_inv ok {test-number} - erfc_inv(1.103560) == Approx(-0.09203687623843015) for: -0.0920368762 == Approx( -0.0920368762 ) # erfc_inv @@ -4028,6 +4064,10 @@ ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>( ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 5 == 5 # tables ok {test-number} - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) for: 6 == 6 +# tags with dots in later positions are not parsed as hidden +ok {test-number} - testcase.tags.size() == 1 for: 1 == 1 +# tags with dots in later positions are not parsed as hidden +ok {test-number} - testcase.tags[0].original == "magic.tag"_catch_sr for: magic.tag == magic.tag # thrown std::strings are translated not ok {test-number} - unexpected exception with message: 'Why would you throw a std::string?' # toString on const wchar_t const pointer returns the string contents @@ -4202,5 +4242,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2105 +1..2120 diff --git a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt index e64c984fb111c5e359fee2e29d9f93347fa02284..5291c85d220785e193c9451d31af23074960e59d 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -50,6 +50,10 @@ Tricky.tests.cpp:<line number>|nexplicit failure with message:|n "1514"'] ##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0' duration="{duration}"] ##teamcity[testStarted name='#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0'] ##teamcity[testFinished name='#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0' duration="{duration}"] +##teamcity[testStarted name='#2152 - ULP checks between differently signed values were wrong - double'] +##teamcity[testFinished name='#2152 - ULP checks between differently signed values were wrong - double' duration="{duration}"] +##teamcity[testStarted name='#2152 - ULP checks between differently signed values were wrong - float'] +##teamcity[testFinished name='#2152 - ULP checks between differently signed values were wrong - float' duration="{duration}"] ##teamcity[testStarted name='#748 - captures with unexpected exceptions'] Exception.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"- failure ignore as test marked as |'ok to fail|'|n'] Exception.tests.cpp:<line number>|nunexpected exception with messages:|n "answer := 42"|n "expected exception"|n REQUIRE_NOTHROW( thisThrows() )|nwith expansion:|n thisThrows()|n- failure ignore as test marked as |'ok to fail|'|n'] @@ -266,8 +270,8 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testStarted name='Composed matchers shortcircuit'] ##teamcity[testFinished name='Composed matchers shortcircuit' duration="{duration}"] ##teamcity[testStarted name='Contains string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains("STRING") )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "not there" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Contains( "STRING" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" contains: "STRING"|n'] ##teamcity[testFinished name='Contains string matcher' duration="{duration}"] ##teamcity[testStarted name='Copy and then generate a range'] ##teamcity[testFinished name='Copy and then generate a range' duration="{duration}"] @@ -285,8 +289,8 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "custom ##teamcity[testStarted name='Directly creating an EnumInfo'] ##teamcity[testFinished name='Directly creating an EnumInfo' duration="{duration}"] ##teamcity[testStarted name='EndsWith string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith("Substring") )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "Substring"|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "this" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "Substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ends with: "this" (case insensitive)|n'] ##teamcity[testFinished name='EndsWith string matcher' duration="{duration}"] ##teamcity[testStarted name='Enums can quickly have stringification enabled using REGISTER_ENUM'] ##teamcity[testFinished name='Enums can quickly have stringification enabled using REGISTER_ENUM' duration="{duration}"] @@ -314,18 +318,18 @@ Condition.tests.cpp:<line number>|nexpression failed|n CHECK( x == Approx( 1.30 ##teamcity[testStarted name='Equals'] ##teamcity[testFinished name='Equals' duration="{duration}"] ##teamcity[testStarted name='Equals string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals("this string contains |'ABC|' as a substring") )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "this string contains |'ABC|' as a substring"|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "something else" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals( "this string contains |'ABC|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "this string contains |'ABC|' as a substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" equals: "something else" (case insensitive)|n'] ##teamcity[testFinished name='Equals string matcher' duration="{duration}"] ##teamcity[testStarted name='Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified'] ##teamcity[testFinished name='Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified' duration="{duration}"] ##teamcity[testStarted name='Exception matchers that fail'] -Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{1}|n'] -Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{1}|n'] -Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n CHECK_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n throwsAsInt(1), SpecialException, ExceptionMatcher{1}|n'] -Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n REQUIRE_THROWS_MATCHES( throwsAsInt(1), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n throwsAsInt(1), SpecialException, ExceptionMatcher{1}|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THROWS_MATCHES( throwsSpecialException(3), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_MATCHES( throwsSpecialException(4), SpecialException, ExceptionMatcher{1} )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] +Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n CHECK_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nno exception was thrown where one was expected|n REQUIRE_THROWS_MATCHES( doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n doesNotThrow(), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n CHECK_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nunexpected exception with message:|n "Unknown exception"|n REQUIRE_THROWS_MATCHES( throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } )|nwith expansion:|n SpecialException::what special exception has value of 1|n'] ##teamcity[testFinished name='Exception matchers that fail' duration="{duration}"] ##teamcity[testStarted name='Exception matchers that succeed'] ##teamcity[testFinished name='Exception matchers that succeed' duration="{duration}"] @@ -395,12 +399,12 @@ Condition.tests.cpp:<line number>|nexpression failed|n CHECK( data.str_hello.si ##teamcity[testStarted name='Matchers can be composed with both && and ||||'] ##teamcity[testFinished name='Matchers can be composed with both && and ||||' duration="{duration}"] ##teamcity[testStarted name='Matchers can be composed with both && and |||| - failing'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), (Contains("string") |||| Contains("different")) && Contains("random") )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), ( Contains( "string" ) |||| Contains( "different" ) ) && Contains( "random" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" )|n'] ##teamcity[testFinished name='Matchers can be composed with both && and |||| - failing' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator' duration="{duration}"] ##teamcity[testStarted name='Matchers can be negated (Not) with the ! operator - failing'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), !Contains("substring") )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" not contains: "substring"|n'] ##teamcity[testFinished name='Matchers can be negated (Not) with the ! operator - failing' duration="{duration}"] ##teamcity[testStarted name='Mismatching exception messages failing the test'] Exception.tests.cpp:<line number>|nexpression failed|n REQUIRE_THROWS_WITH( thisThrows(), "should fail" )|nwith expansion:|n "expected exception" equals: "should fail"|n'] @@ -469,9 +473,9 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "Message from Decomposition.tests.cpp:<line number>|nexpression failed|n CHECK( truthy(false) )|nwith expansion:|n Hey, its truthy!|n'] ##teamcity[testFinished name='Reconstruction should be based on stringification: #914' duration="{duration}"] ##teamcity[testStarted name='Regex string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches("this STRING contains |'abc|' as a substring") )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this STRING contains |'abc|' as a substring" case sensitively|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches("contains |'abc|' as a substring") )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "contains |'abc|' as a substring" case sensitively|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches("this string contains |'abc|' as a") )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this string contains |'abc|' as a" case sensitively|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "this STRING contains |'abc|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this STRING contains |'abc|' as a substring" case sensitively|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "contains |'abc|' as a substring" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "contains |'abc|' as a substring" case sensitively|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), Matches( "this string contains |'abc|' as a" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" matches "this string contains |'abc|' as a" case sensitively|n'] ##teamcity[testFinished name='Regex string matcher' duration="{duration}"] ##teamcity[testStarted name='Regression test #1'] ##teamcity[testFinished name='Regression test #1' duration="{duration}"] @@ -499,8 +503,8 @@ Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringFor ##teamcity[testStdOut name='Standard output from all sections is reported' out='Message from section one|nMessage from section two|n'] ##teamcity[testFinished name='Standard output from all sections is reported' duration="{duration}"] ##teamcity[testStarted name='StartsWith string matcher'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith("This String") )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "This String"|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "string" (case insensitive)|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "This String"|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) )|nwith expansion:|n "this string contains |'abc|' as a substring" starts with: "string" (case insensitive)|n'] ##teamcity[testFinished name='StartsWith string matcher' duration="{duration}"] ##teamcity[testStarted name='Static arrays are convertible to string'] ##teamcity[testFinished name='Static arrays are convertible to string' duration="{duration}"] @@ -510,6 +514,12 @@ Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( testStringFor ##teamcity[testFinished name='StringRef' duration="{duration}"] ##teamcity[testStarted name='StringRef at compilation time'] ##teamcity[testFinished name='StringRef at compilation time' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - char' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - signed char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - signed char' duration="{duration}"] +##teamcity[testStarted name='Stringifying char arrays with statically known sizes - unsigned char'] +##teamcity[testFinished name='Stringifying char arrays with statically known sizes - unsigned char' duration="{duration}"] ##teamcity[testStarted name='Stringifying std::chrono::duration helpers'] ##teamcity[testFinished name='Stringifying std::chrono::duration helpers' duration="{duration}"] ##teamcity[testStarted name='Stringifying std::chrono::duration with weird ratios'] @@ -563,6 +573,14 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan ##teamcity[testFinished name='Test enum bit values' duration="{duration}"] ##teamcity[testStarted name='Test with special, characters "in name'] ##teamcity[testFinished name='Test with special, characters "in name' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if'] +##teamcity[testFinished name='Testing checked-if' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if 2'] +Misc.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Testing checked-if 2' duration="{duration}"] +##teamcity[testStarted name='Testing checked-if 3'] +Misc.tests.cpp:<line number>|nexplicit failure- failure ignore as test marked as |'ok to fail|'|n'] +##teamcity[testFinished name='Testing checked-if 3' duration="{duration}"] ##teamcity[testStarted name='The NO_FAIL macro reports a failure but does not fail the test'] ##teamcity[testFinished name='The NO_FAIL macro reports a failure but does not fail the test' duration="{duration}"] ##teamcity[testStarted name='The default listing implementation write to provided stream'] @@ -596,24 +614,24 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "3.14"' ##teamcity[testStarted name='Vector Approx matcher'] ##teamcity[testFinished name='Vector Approx matcher' duration="{duration}"] ##teamcity[testStarted name='Vector Approx matcher -- failing'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Approx(t1) )|nwith expansion:|n { } is approx: { 1.0, 2.0 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v1, Approx(v2) )|nwith expansion:|n { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Approx( t1 ) )|nwith expansion:|n { } is approx: { 1.0, 2.0 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v1, Approx( v2 ) )|nwith expansion:|n { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }|n'] ##teamcity[testFinished name='Vector Approx matcher -- failing' duration="{duration}"] ##teamcity[testStarted name='Vector matchers'] ##teamcity[testFinished name='Vector matchers' duration="{duration}"] ##teamcity[testStarted name='Vector matchers that fail'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, VectorContains(-1) )|nwith expansion:|n { 1, 2, 3 } Contains: -1|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, VectorContains(1) )|nwith expansion:|n { } Contains: 1|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Contains(v) )|nwith expansion:|n { } Contains: { 1, 2, 3 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Contains(v2) )|nwith expansion:|n { 1, 2, 3 } Contains: { 1, 2, 4 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals(v2) )|nwith expansion:|n { 1, 2, 3 } Equals: { 1, 2 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v2, Equals(v) )|nwith expansion:|n { 1, 2 } Equals: { 1, 2, 3 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Equals(v) )|nwith expansion:|n { } Equals: { 1, 2, 3 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals(empty) )|nwith expansion:|n { 1, 2, 3 } Equals: { }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, UnorderedEquals(empty) )|nwith expansion:|n { 1, 2, 3 } UnorderedEquals: { }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, UnorderedEquals(v) )|nwith expansion:|n { } UnorderedEquals: { 1, 2, 3 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals(v) )|nwith expansion:|n { 1, 3 } UnorderedEquals: { 1, 2, 3 }|n'] -Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals(v) )|nwith expansion:|n { 3, 1 } UnorderedEquals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, VectorContains( -1 ) )|nwith expansion:|n { 1, 2, 3 } Contains: -1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, VectorContains( 1 ) )|nwith expansion:|n { } Contains: 1|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Contains( v ) )|nwith expansion:|n { } Contains: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Contains( v2 ) )|nwith expansion:|n { 1, 2, 3 } Contains: { 1, 2, 4 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals( v2 ) )|nwith expansion:|n { 1, 2, 3 } Equals: { 1, 2 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v2, Equals( v ) )|nwith expansion:|n { 1, 2 } Equals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, Equals( v ) )|nwith expansion:|n { } Equals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, Equals( empty ) )|nwith expansion:|n { 1, 2, 3 } Equals: { }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( v, UnorderedEquals( empty ) )|nwith expansion:|n { 1, 2, 3 } UnorderedEquals: { }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( empty, UnorderedEquals( v ) )|nwith expansion:|n { } UnorderedEquals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals( v ) )|nwith expansion:|n { 1, 3 } UnorderedEquals: { 1, 2, 3 }|n'] +Matchers.tests.cpp:<line number>|nexpression failed|n CHECK_THAT( permuted, UnorderedEquals( v ) )|nwith expansion:|n { 3, 1 } UnorderedEquals: { 1, 2, 3 }|n'] ##teamcity[testFinished name='Vector matchers that fail' duration="{duration}"] ##teamcity[testStarted name='When checked exceptions are thrown they can be expected or unexpected'] ##teamcity[testFinished name='When checked exceptions are thrown they can be expected or unexpected' duration="{duration}"] @@ -648,6 +666,8 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testFinished name='X/level/1/b' duration="{duration}"] ##teamcity[testStarted name='XmlEncode'] ##teamcity[testFinished name='XmlEncode' duration="{duration}"] +##teamcity[testStarted name='XmlWriter writes boolean attributes as true/false'] +##teamcity[testFinished name='XmlWriter writes boolean attributes as true/false' duration="{duration}"] ##teamcity[testStarted name='analyse no analysis'] ##teamcity[testFinished name='analyse no analysis' duration="{duration}"] ##teamcity[testStarted name='array<int, N> -> toString'] @@ -661,13 +681,11 @@ Exception.tests.cpp:<line number>|nunexpected exception with message:|n "unexpe ##teamcity[testStarted name='checkedElse'] ##teamcity[testFinished name='checkedElse' duration="{duration}"] ##teamcity[testStarted name='checkedElse, failing'] -Misc.tests.cpp:<line number>|nexpression failed|n CHECKED_ELSE( flag )|nwith expansion:|n false|n'] Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedElse( false ) )|nwith expansion:|n false|n'] ##teamcity[testFinished name='checkedElse, failing' duration="{duration}"] ##teamcity[testStarted name='checkedIf'] ##teamcity[testFinished name='checkedIf' duration="{duration}"] ##teamcity[testStarted name='checkedIf, failing'] -Misc.tests.cpp:<line number>|nexpression failed|n CHECKED_IF( flag )|nwith expansion:|n false|n'] Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedIf( false ) )|nwith expansion:|n false|n'] ##teamcity[testFinished name='checkedIf, failing' duration="{duration}"] ##teamcity[testStarted name='classify_outliers'] @@ -676,6 +694,10 @@ Misc.tests.cpp:<line number>|nexpression failed|n REQUIRE( testCheckedIf( false ##teamcity[testFinished name='comparisons between const int variables' duration="{duration}"] ##teamcity[testStarted name='comparisons between int variables'] ##teamcity[testFinished name='comparisons between int variables' duration="{duration}"] +##teamcity[testStarted name='convertToBits'] +##teamcity[testFinished name='convertToBits' duration="{duration}"] +##teamcity[testStarted name='empty tags are not allowed'] +##teamcity[testFinished name='empty tags are not allowed' duration="{duration}"] ##teamcity[testStarted name='erfc_inv'] ##teamcity[testFinished name='erfc_inv' duration="{duration}"] ##teamcity[testStarted name='estimate_clock_resolution'] @@ -816,6 +838,8 @@ Tricky.tests.cpp:<line number>|nexpression failed|n REQUIRE( std::string( "firs ##teamcity[testFinished name='strlen3' duration="{duration}"] ##teamcity[testStarted name='tables'] ##teamcity[testFinished name='tables' duration="{duration}"] +##teamcity[testStarted name='tags with dots in later positions are not parsed as hidden'] +##teamcity[testFinished name='tags with dots in later positions are not parsed as hidden' duration="{duration}"] ##teamcity[testStarted name='thrown std::strings are translated'] Exception.tests.cpp:<line number>|nunexpected exception with message:|n "Why would you throw a std::string?"'] ##teamcity[testFinished name='thrown std::strings are translated' duration="{duration}"] diff --git a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt index ceaa32bcb8df86d901dbe890b1f283e5ad962dcc..bd12e70a30d509245ac9648840c46028867f74ee 100644 --- a/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/packages/Catch2/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -1,247 +1,2700 @@ <?xml version="1.0" encoding="UTF-8"?> -<Catch name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals] *"> +<Catch2TestRun name="<exe-name>" filters="~[!nonportable]~[!benchmark]~[approvals] *"> <Randomness seed="1"/> - <Group name="<exe-name>"> - <TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" tags="[Decomposition]" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <TestCase name="# A test name that starts with a #" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" tags="[Decomposition]" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Original> + fptr == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Original> + fptr == 0l + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1027: Bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + y.v == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + 0 == y.v + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1147" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 == t2 + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 != t2 + </Original> + <Expanded> + {?} != {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 < t2 + </Original> + <Expanded> + {?} < {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 > t2 + </Original> + <Expanded> + {?} > {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 <= t2 + </Original> + <Expanded> + {?} <= {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + t1 >= t2 + </Original> + <Expanded> + {?} >= {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1175 - Hidden Test" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1238" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Info> + uarr := "123" + </Info> + <Info> + sarr := "456" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + std::memcmp(uarr, "123", sizeof(uarr)) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Info> + uarr := "123" + </Info> + <Info> + sarr := "456" + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + std::memcmp(sarr, "456", sizeof(sarr)) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1245" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1319: Sections can have description (even if it is not saved" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Section name="SectionName" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1403" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + h1 == h2 + </Original> + <Expanded> + [1403 helper] == [1403 helper] + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1455 - INFO and WARN can start with a linebreak" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + +This info message starts with a linebreak + </Info> + <Warning> + +This warning message starts with a linebreak + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="#1514: stderr/stdout is not captured in tests aborted by an exception" tags="[.][output-capture][regression]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + 1514 + </Failure> + <OverallResult success="false"> + <StdOut> +This would not be caught previously + </StdOut> + <StdErr> +Nor would this + </StdErr> + </OverallResult> + </TestCase> + <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<TypeList<int>, TypeList<int>>::value + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1905 -- test spec parser properly clears internal state between compound tests" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase("spec . char")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase("spec , char")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !(spec.matches(*fakeTestCase(R"(spec \, char)"))) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1912 -- test spec parser handles escaping" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Various parentheses" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - fptr == 0 + spec.matches(*fakeTestCase(R"(spec {a} char)")) </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - fptr == 0l + spec.matches(*fakeTestCase(R"(spec [a] char)")) </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1027: Bitfields can be captured" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - y.v == 0 + !(spec.matches(*fakeTestCase("differs but has similar tag", "[a]"))) </Original> <Expanded> - 0 == 0 + !false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="backslash in test name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches(*fakeTestCase(R"(spec \ char)")) + </Original> + <Expanded> + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + counter < 7 + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + counter < 7 + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1913 - GENERATEs can share a line" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 1 != 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 1 != 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 2 != 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i != j + </Original> + <Expanded> + 2 != 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - GENERATE after a section" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - 0 == y.v + m </Original> <Expanded> - 0 == 0 + 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1147" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - t1 == t2 + m </Original> <Expanded> - {?} == {?} + 2 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - t1 != t2 + m </Original> <Expanded> - {?} != {?} + 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - Section followed by flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - t1 < t2 + 1 </Original> <Expanded> - {?} < {?} + 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - mixed sections and generates" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 5 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 6 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 1 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 5 + </Info> + <Info> + i := 1 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 6 + </Info> + <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 5 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 3 + </Info> + <Info> + k := 6 + </Info> + <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Info> + i := 2 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 5 + </Info> + <Info> + i := 2 + </Info> + <Info> + j := 4 + </Info> + <Info> + k := 6 + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1938 - nested generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + m + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + n + </Original> + <Expanded> + 3 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="#2152 - ULP checks between differently signed values were wrong - double" tags="[floating-point][matchers][ulp]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) + </Original> + <Expanded> + 0.0 is within 2 ULPs of -4.9406564584124654e-324 ([-1.4821969375237396e-323, 4.9406564584124654e-324]) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) + </Original> + <Expanded> + 0.0 not is within 1 ULPs of -4.9406564584124654e-324 ([-9.8813129168249309e-324, -0.0000000000000000e+00]) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#2152 - ULP checks between differently signed values were wrong - float" tags="[floating-point][matchers][ulp]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) + </Original> + <Expanded> + 0.0f is within 2 ULPs of -1.40129846e-45f ([-4.20389539e-45, 1.40129846e-45]) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) + </Original> + <Expanded> + 0.0f not is within 1 ULPs of -1.40129846e-45f ([-2.80259693e-45, -0.00000000e+00]) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="outside assertions" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="inside REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - t1 > t2 + thisThrows() </Original> <Expanded> - {?} > {?} + thisThrows() </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="0" failures="0" expectedFailures="1"/> + </Section> + <Section name="inside REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Info> + answer := 42 + </Info> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - t1 <= t2 + thisThrows() </Original> <Expanded> - {?} <= {?} + thisThrows() </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#809" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + 42 == f + </Original> + <Expanded> + 42 == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#833" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + a == t + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + a == t + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + throws_int(true) + </Original> + <Expanded> + throws_int(true) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + throws_int(true), int + </Original> + <Expanded> + throws_int(true), int + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + throws_int(false) + </Original> + <Expanded> + throws_int(false) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + "aaa", Catch::Matchers::EndsWith("aaa") + </Original> + <Expanded> + "aaa" ends with: "aaa" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + templated_tests<int>(3) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#835 -- errno should not be touched by Catch" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + f() == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + errno == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#872" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Info> + dummy := 0 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + x == 4 + </Original> + <Expanded> + {?} == 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="#961 -- Dynamically created sections should all be reported" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Looped section 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 1" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 2" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 3" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Looped section 4" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="'Not' checks that should fail" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + false != false + </Original> + <Expanded> + false != false + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + true != true + </Original> + <Expanded> + true != true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !true + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(true) + </Original> + <Expanded> + !true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !trueValue + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(trueValue) + </Original> + <Expanded> + !true + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 1) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 1) + </Original> + <Expanded> + !(1 == 1) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="'Not' checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + false == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + true == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !false + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(false) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !falseValue + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(falseValue) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 2) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + !(1 == 2) + </Original> + <Expanded> + !(1 == 2) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="(unimplemented) static bools can be evaluated" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Section name="compare to true" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - t1 >= t2 + is_true<true>::value == true </Original> <Expanded> - {?} >= {?} + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1175 - Hidden Test" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1238" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Info> - uarr := "123" - </Info> - <Info> - sarr := "456" - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - std::memcmp(uarr, "123", sizeof(uarr)) == 0 + true == is_true<true>::value </Original> <Expanded> - 0 == 0 + true == true </Expanded> </Expression> - <Info> - uarr := "123" - </Info> - <Info> - sarr := "456" - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="compare to false" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - std::memcmp(sarr, "456", sizeof(sarr)) == 0 + is_true<false>::value == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1245" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1319: Sections can have description (even if it is not saved" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Section name="SectionName" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1403" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - h1 == h2 + false == is_true<false>::value </Original> <Expanded> - [1403 helper] == [1403 helper] + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1455 - INFO and WARN can start with a linebreak" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - -This info message starts with a linebreak - </Info> - <Warning> - -This warning message starts with a linebreak - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="#1514: stderr/stdout is not captured in tests aborted by an exception" tags="[.][output-capture][regression]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - 1514 - </Failure> - <OverallResult success="false"> - <StdOut> -This would not be caught previously - </StdOut> - <StdErr> -Nor would this - </StdErr> - </OverallResult> - </TestCase> - <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" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - std::is_same<TypeList<int>, TypeList<int>>::value + !is_true<false>::value </Original> <Expanded> true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1905 -- test spec parser properly clears internal state between compound tests" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="double negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - spec.matches(*fakeTestCase("spec . char")) + !!is_true<true>::value </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="direct" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - spec.matches(*fakeTestCase("spec , char")) + is_true<true>::value </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - !(spec.matches(*fakeTestCase(R"(spec \, char)"))) + !(is_true<false>::value) </Original> <Expanded> !false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1912 -- test spec parser handles escaping" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Various parentheses" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="3x3x3 ints" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 1 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 1 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 2 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 2 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 4 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 5 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 5 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 7 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < y + </Original> + <Expanded> + 3 < 6 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + y < z + </Original> + <Expanded> + 6 < 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + x < z + </Original> + <Expanded> + 3 < 9 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + s == "world" + </Original> + <Expanded> + "hello" == "world" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + s == "hello" + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 1 + </Original> + <Expanded> + 0 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>::m_a.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 6 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 2 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 6 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() < 2 + </Original> + <Expanded> + 2 < 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() >= 2 + </Original> + <Expanded> + 6 >= 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() >= 2 + </Original> + <Expanded> + 2 >= 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() >= 2 + </Original> + <Expanded> + 6 >= 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture_2<TestType>{}.m_a.size() >= 2 + </Original> + <Expanded> + 2 >= 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1.0 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1.0f == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1.0 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1.0f == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value == 0 + </Original> + <Expanded> + 3 == 0 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value == 0 + </Original> + <Expanded> + 6 == 0 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value > 0 + </Original> + <Expanded> + 1 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value > 0 + </Original> + <Expanded> + 3 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Nttp_Fixture<V>::value > 0 + </Original> + <Expanded> + 6 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A TEST_CASE_METHOD based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + m_a == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - Foo<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> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - Foo<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> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - std::vector<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> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case - std::vector<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> + x.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case with array signature - Bar<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() > 0 + </Original> + <Expanded> + 42 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case with array signature - Bar<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() > 0 + </Original> + <Expanded> + 9 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case with array signature - std::array<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() > 0 + </Original> + <Expanded> + 42 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A Template product test case with array signature - std::array<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x.size() > 0 + </Original> + <Expanded> + 9 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A comparison that uses literals instead of the normal constructor" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == 1.23_a + </Original> + <Expanded> + 1.23 == Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != 1.22_a + </Original> + <Expanded> + 1.23 != Approx( 1.22 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + -d == -1.23_a + </Original> + <Expanded> + -1.23 == Approx( -1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == 1.2_a .epsilon(.1) + </Original> + <Expanded> + 1.23 == Approx( 1.2 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != 1.2_a .epsilon(.001) + </Original> + <Expanded> + 1.23 != Approx( 1.2 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == 1_a .epsilon(.3) + </Original> + <Expanded> + 1.23 == Approx( 1.0 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="A couple of nested sections followed by a failure" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Outer" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="Inner" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + to infinity and beyond + </Failure> + <OverallResult success="false"/> + </TestCase> + <TestCase name="A failing expression with a non streamable type is still captured" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + &o1 == &o2 + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + o1 == o2 + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Absolute margin" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 104.0 != Approx(100.0) + </Original> + <Expanded> + 104.0 != Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 104.0 == Approx(100.0).margin(5) + </Original> + <Expanded> + 104.0 == Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 104.0 == Approx(100.0).margin(4) + </Original> + <Expanded> + 104.0 == Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 104.0 != Approx(100.0).margin(3) + </Original> + <Expanded> + 104.0 != Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 100.3 != Approx(100.0) + </Original> + <Expanded> + 100.3 != Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 100.3 == Approx(100.0).margin(0.5) + </Original> + <Expanded> + 100.3 == Approx( 100.0 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="An empty test with no assertions" tags="[empty]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="An expression with side-effects should only be evaluated once" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + i++ == 7 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + i++ == 8 + </Original> + <Expanded> + 8 == 8 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="An unchecked exception reports the line of the last assertion" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + 1 == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="false" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + {Unknown expression after the reported line} + </Original> + <Expanded> + {Unknown expression after the reported line} + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + unexpected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Anonymous test case 1" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approx setters validate their arguments" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).margin(0) + </Original> + <Expanded> + Approx(0).margin(0) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).margin(1234656) + </Original> + <Expanded> + Approx(0).margin(1234656) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).margin(-2), std::domain_error + </Original> + <Expanded> + Approx(0).margin(-2), std::domain_error + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).epsilon(0) + </Original> + <Expanded> + Approx(0).epsilon(0) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).epsilon(1) + </Original> + <Expanded> + Approx(0).epsilon(1) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).epsilon(-0.001), std::domain_error + </Original> + <Expanded> + Approx(0).epsilon(-0.001), std::domain_error + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(0).epsilon(1.0001), std::domain_error + </Original> + <Expanded> + Approx(0).epsilon(1.0001), std::domain_error + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approx with exactly-representable margin" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0.25f == Approx(0.0f).margin(0.25f) + </Original> + <Expanded> + 0.25f == Approx( 0.0 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0.0f == Approx(0.25f).margin(0.25f) + </Original> + <Expanded> + 0.0f == Approx( 0.25 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0.5f == Approx(0.25f).margin(0.25f) + </Original> + <Expanded> + 0.5f == Approx( 0.25 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 245.0f == Approx(245.25f).margin(0.25f) + </Original> + <Expanded> + 245.0f == Approx( 245.25 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 245.5f == Approx(245.25f).margin(0.25f) + </Original> + <Expanded> + 245.5f == Approx( 245.25 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approximate PI" tags="[Approx][PI]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) + </Original> + <Expanded> + 3.1428571429 == Approx( 3.141 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) + </Original> + <Expanded> + 3.1428571429 != Approx( 3.141 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approximate comparisons with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != Approx( 1.231 ) + </Original> + <Expanded> + 1.23 != Approx( 1.231 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == Approx( 1.231 ).epsilon( 0.1 ) + </Original> + <Expanded> + 1.23 == Approx( 1.231 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approximate comparisons with floats" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 1.23f == Approx( 1.23f ) + </Original> + <Expanded> + 1.23f == Approx( 1.2300000191 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0.0f == Approx( 0.0f ) + </Original> + <Expanded> + 0.0f == Approx( 0.0 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approximate comparisons with ints" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 1 == Approx( 1 ) + </Original> + <Expanded> + 1 == Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0 == Approx( 0 ) + </Original> + <Expanded> + 0 == Approx( 0.0 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Approximate comparisons with mixed numeric types" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 1.0f == Approx( 1 ) + </Original> + <Expanded> + 1.0f == Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0 == Approx( dZero) + </Original> + <Expanded> + 0 == Approx( 0.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 0 == Approx( dSmall ).margin( 0.001 ) + </Original> + <Expanded> + 0 == Approx( 0.00001 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 1.234f == Approx( dMedium ) + </Original> + <Expanded> + 1.234f == Approx( 1.234 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + dMedium == Approx( 1.234f ) + </Original> + <Expanded> + 1.234 == Approx( 1.2339999676 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Arbitrary predicate matcher" tags="[generic][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Function pointer" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, Predicate<int>( alwaysTrue, "always true" ) + </Original> + <Expanded> + 1 matches predicate: "always true" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !Predicate<int>( alwaysFalse, "always false" ) + </Original> + <Expanded> + 1 not matches predicate: "always false" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Lambdas + different type" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "Hello olleH", Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); }, "First and last character should be equal" ) + </Original> + <Expanded> + "Hello olleH" matches predicate: "First and last character should be equal" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "This wouldn't pass", !Predicate<std::string>( []( std::string const& str ) -> bool { return str.front() == str.back(); } ) + </Original> + <Expanded> + "This wouldn't pass" not matches undescribed predicate + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Assertion macros support bit operators and bool conversions" tags="[bitops][compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + lhs | rhs + </Original> + <Expanded> + Val: 1 | Val: 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + !(lhs & rhs) + </Original> + <Expanded> + !(Val: 1 & Val: 2) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + HasBitOperators{ 1 } & HasBitOperators{ 1 } + </Original> + <Expanded> + Val: 1 & Val: 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + lhs ^ rhs + </Original> + <Expanded> + Val: 1 ^ Val: 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + !(lhs ^ lhs) + </Original> + <Expanded> + !(Val: 1 ^ Val: 1) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="Another section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - spec.matches(*fakeTestCase(R"(spec {a} char)")) - </Original> - <Expanded> true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches(*fakeTestCase(R"(spec [a] char)")) </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(spec.matches(*fakeTestCase("differs but has similar tag", "[a]"))) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="backslash in test name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="Another other section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > <Original> - spec.matches(*fakeTestCase(R"(spec \ char)")) + true </Original> <Expanded> true @@ -249,19386 +2702,17080 @@ Nor would this </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1913 - GENERATE inside a for loop should not keep recreating the generator" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Basic use of the Contains range matcher" tags="[contains][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Different argument ranges, same element type, default comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - counter < 7 + a, Contains(1) </Original> <Expanded> - 3 < 7 + { 1, 2, 3 } contains element 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - counter < 7 + b, Contains(1) </Original> <Expanded> - 6 < 7 + { 0, 1, 2 } contains element 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1913 - GENERATEs can share a line" tags="[generators][regression]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - i != j + c, !Contains(1) </Original> <Expanded> - 1 != 3 + { 4, 5, 6 } not contains element 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different argument ranges, same element type, custom comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - i != j + a, Contains(0, close_enough) </Original> <Expanded> - 1 != 4 + { 1, 2, 3 } contains element 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - i != j + b, Contains(0, close_enough) </Original> <Expanded> - 2 != 3 + { 0, 1, 2 } contains element 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - i != j + c, !Contains(0, close_enough) </Original> <Expanded> - 2 != 4 + { 4, 5, 6 } not contains element 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1938 - GENERATE after a section" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - m - </Original> - <Expanded> - 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - m - </Original> - <Expanded> - 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - m - </Original> - <Expanded> - 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1938 - Section followed by flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - 1 - </Original> - <Expanded> - 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different element type, custom comparisons" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) </Original> <Expanded> - 2 + { "abc", "abcd", "abcde" } contains element 4 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Can handle type that requires ADL-found free function begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + in, Contains(1) </Original> <Expanded> - 3 + { 1, 2, 3, 4, 5 } contains element 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1938 - flat generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + in, !Contains(8) </Original> <Expanded> - 1 + { 1, 2, 3, 4, 5 } not contains element 8 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Initialization with move only types" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + in, Contains(MoveOnlyTestElement{ 2 }) </Original> <Expanded> - 2 + { 1, 2, 3 } contains element 2 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + in, !Contains(MoveOnlyTestElement{ 9 }) </Original> <Expanded> - 3 + { 1, 2, 3 } not contains element 9 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1938 - mixed sections and generates" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 1 - </Info> - <Info> - j := 3 - </Info> - <Info> - k := 5 - </Info> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 1 - </Info> - <Info> - j := 3 - </Info> - <Info> - k := 6 - </Info> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 1 - </Info> - <Info> - j := 4 - </Info> - <Info> - k := 5 - </Info> - <Info> - i := 1 - </Info> - <Info> - j := 4 - </Info> - <Info> - k := 6 - </Info> - <Section name="A" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 2 - </Info> - <Info> - j := 3 - </Info> - <Info> - k := 5 - </Info> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 2 - </Info> - <Info> - j := 3 - </Info> - <Info> - k := 6 - </Info> - <Section name="B" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Info> - i := 2 - </Info> - <Info> - j := 4 - </Info> - <Info> - k := 5 - </Info> - <Info> - i := 2 - </Info> - <Info> - j := 4 - </Info> - <Info> - k := 6 - </Info> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1938 - nested generate" tags="[.][generators][regression]" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Matching using matcher" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) </Original> <Expanded> - 1 + { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Basic use of the Empty range matcher" tags="[empty][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Simple, std-provided containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - n + empty_array, IsEmpty() </Original> <Expanded> - 1 + { } is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + non_empty_array, !IsEmpty() </Original> <Expanded> - 1 + { 0.0 } not is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - n + empty_vec, IsEmpty() </Original> <Expanded> - 2 + { } is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + non_empty_vec, !IsEmpty() </Original> <Expanded> - 1 + { 'a', 'b', 'c' } not is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - n + inner_lists_are_empty, !IsEmpty() </Original> <Expanded> - 3 + { { } } not is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + inner_lists_are_empty.front(), IsEmpty() </Original> <Expanded> - 2 + { } is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type with empty" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - n + has_empty{}, !IsEmpty() </Original> <Expanded> - 1 + {?} not is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found empty free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m + unrelated::ADL_empty{}, IsEmpty() </Original> <Expanded> - 2 + {?} is empty </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + a := 1 + </Info> + <Info> + b := 2 + </Info> + <Info> + c := 3 + </Info> + <Info> + a + b := 3 + </Info> + <Info> + a+b := 3 + </Info> + <Info> + c > b := true + </Info> + <Info> + a == 1 := true + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CAPTURE can deal with complex expressions involving commas" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + std::vector<int>{1, 2, 3}[0, 1, 2] := 3 + </Info> + <Info> + std::vector<int>{1, 2, 3}[(0, 1)] := 2 + </Info> + <Info> + std::vector<int>{1, 2, 3}[0] := 1 + </Info> + <Info> + (helper_1436<int, int>{12, -12}) := { 12, -12 } + </Info> + <Info> + (helper_1436<int, int>(-12, 12)) := { -12, 12 } + </Info> + <Info> + (1, 2) := 2 + </Info> + <Info> + (2, 3) := 3 + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="CAPTURE parses string and character constants" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + ("comma, in string", "escaped, \", ") := "escaped, ", " + </Info> + <Info> + "single quote in string,'," := "single quote in string,'," + </Info> + <Info> + "some escapes, \\,\\\\" := "some escapes, \,\\" + </Info> + <Info> + "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" + </Info> + <Info> + '"' := '"' + </Info> + <Info> + '\'' := ''' + </Info> + <Info> + ',' := ',' + </Info> + <Info> + '}' := '}' + </Info> + <Info> + ')' := ')' + </Info> + <Info> + '(' := '(' + </Info> + <Info> + '{' := '{' + </Info> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Capture and info messages" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Capture should stringify like assertions" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Info> + i := 2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - n + true </Original> <Expanded> - 2 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Info should NOT stringify the way assertions do" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Info> + 3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - m + true </Original> <Expanded> - 2 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Character pretty printing" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Specifically escaped" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - n + tab == '\t' </Original> <Expanded> - 3 + '\t' == '\t' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - m + newline == '\n' </Original> <Expanded> - 3 + '\n' == '\n' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - n + carr_return == '\r' </Original> <Expanded> - 1 + '\r' == '\r' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - m + form_feed == '\f' </Original> <Expanded> - 3 + '\f' == '\f' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="General chars" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - n + space == ' ' </Original> <Expanded> - 2 + ' ' == ' ' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - m + c == chars[i] </Original> <Expanded> - 3 + 'a' == 'a' </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - n + c == chars[i] </Original> <Expanded> - 3 + 'z' == 'z' </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1954 - 7 arg template test case sig compiles - 1, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 1, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#1954 - 7 arg template test case sig compiles - 5, 3, 1, 1, 1, 0, 0" tags="[.][compilation][regression]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="#748 - captures with unexpected exceptions" tags="[!shouldfail][!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Section name="outside assertions" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Info> - answer := 42 - </Info> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> - <OverallResults successes="0" failures="0" expectedFailures="1"/> - </Section> - <Section name="inside REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Info> - answer := 42 - </Info> - <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows() - </Original> - <Expanded> - thisThrows() - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> - </Expression> - <OverallResults successes="0" failures="0" expectedFailures="1"/> - </Section> - <Section name="inside REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Info> - answer := 42 - </Info> - <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows() - </Original> - <Expanded> - thisThrows() - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#809" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - 42 == f + c == chars[i] </Original> <Expanded> - 42 == {?} + 'A' == 'A' </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#833" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - a == t + c == chars[i] </Original> <Expanded> - 3 == 3 + 'Z' == 'Z' </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Low ASCII" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - a == t + null_terminator == '\0' </Original> <Expanded> - 3 == 3 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - throws_int(true) + c == i </Original> <Expanded> - throws_int(true) + 2 == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - throws_int(true), int + c == i </Original> <Expanded> - throws_int(true), int + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - throws_int(false) + c == i </Original> <Expanded> - throws_int(false) + 4 == 4 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - "aaa", Catch::Matchers::EndsWith("aaa") + c == i </Original> <Expanded> - "aaa" ends with: "aaa" + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - templated_tests<int>(3) + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Clara::Arg supports single-arg parse the way Opt does" tags="[arg][clara][compilation]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name.empty() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > + <Original> + name == "foo" + </Original> + <Expanded> + "foo" == "foo" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchAllOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() && MatcherB() ) && MatcherC() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() && ( MatcherB() && MatcherC() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchAnyOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() || MatcherB() ) || MatcherC() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || ( MatcherB() || MatcherC() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining MatchNotOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 0, !MatcherA() + </Original> + <Expanded> + 0 not equals: (int) 1 or (float) 1.0f + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !!MatcherA() + </Original> + <Expanded> + 1 equals: (int) 1 or (float) 1.0f + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 0, !!!MatcherA() + </Original> + <Expanded> + 0 not equals: (int) 1 or (float) 1.0f + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, !!!!MatcherA() + </Original> + <Expanded> + 1 equals: (int) 1 or (float) 1.0f + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining concrete matchers does not use templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining only templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() && MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 1, MatcherA() || !MatcherB() + </Original> + <Expanded> + 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining templated and concrete matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + 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 ) + </Original> + <Expanded> + { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, StartsWith( "foo" ) && !EqualsRange( bad_arr ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, !EqualsRange( bad_arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) + </Original> + <Expanded> + "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, EqualsRange( bad_arr ) || ( StartsWith( "foo" ) && EndsWith( "bar" ) ) + </Original> + <Expanded> + "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + str, ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || EqualsRange( bad_arr ) + </Original> + <Expanded> + "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Combining templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + container, EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) + </Original> + <Expanded> + { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Commas in various macros are allowed" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Original> + <Expanded> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Original> + <Expanded> + std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Original> + <Expanded> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Expanded> + </Expression> + <Expression success="true" type="CHECK_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Original> + <Expanded> + std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) + </Original> + <Expanded> + !({ 1, 2 } == { 1, 2, 3 }) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) + </Original> + <Expanded> + !({ 1, 2 } == { 1, 2, 3 }) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::vector<int>{1, 2} == std::vector<int>{1, 2} + </Original> + <Expanded> + { 1, 2 } == { 1, 2 } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + a + </Original> + <Expanded> + 0x<hex digits> + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + a == &foo + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparison ops" tags="[rng]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + SimplePcg32{} == SimplePcg32{} + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + SimplePcg32{ 0 } != SimplePcg32{} + </Original> + <Expanded> + {?} != {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + !(SimplePcg32{ 1 } == SimplePcg32{ 2 }) + </Original> + <Expanded> + !({?} == {?}) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + !(SimplePcg32{ 1 } != SimplePcg32{ 1 }) + </Original> + <Expanded> + !({?} != {?}) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparison with explicitly convertible types" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td == Approx(10.0) + </Original> + <Expanded> + StrongDoubleTypedef(10) == Approx( 10.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(10.0) == td + </Original> + <Expanded> + Approx( 10.0 ) == StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td != Approx(11.0) + </Original> + <Expanded> + StrongDoubleTypedef(10) != Approx( 11.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(11.0) != td + </Original> + <Expanded> + Approx( 11.0 ) != StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td <= Approx(10.0) + </Original> + <Expanded> + StrongDoubleTypedef(10) <= Approx( 10.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td <= Approx(11.0) + </Original> + <Expanded> + StrongDoubleTypedef(10) <= Approx( 11.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(10.0) <= td + </Original> + <Expanded> + Approx( 10.0 ) <= StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(9.0) <= td + </Original> + <Expanded> + Approx( 9.0 ) <= StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td >= Approx(9.0) + </Original> + <Expanded> + StrongDoubleTypedef(10) >= Approx( 9.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + td >= Approx(td) + </Original> + <Expanded> + StrongDoubleTypedef(10) >= Approx( 10.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(td) >= td + </Original> + <Expanded> + Approx( 10.0 ) >= StrongDoubleTypedef(10) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx(11.0) >= td + </Original> + <Expanded> + Approx( 11.0 ) >= StrongDoubleTypedef(10) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparisons between ints where one side is computed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 54 == 6*9 + </Original> + <Expanded> + 54 == 54 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( -1 > 2u ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + -1 > 2u + </Original> + <Expanded> + -1 > 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( 2u < -1 ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 2u < -1 + </Original> + <Expanded> + 2 < -1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ( minInt > 2u ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + minInt > 2u + </Original> + <Expanded> + -2147483648 > 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Comparisons with int literals don't warn when mixing signed/ unsigned" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + i == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ui == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + l == 3 + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + ul == 4 + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + c == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + uc == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 1 == i + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 2 == ui + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 3 == l + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 4 == ul + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 5 == c + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 6 == uc + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + (std::numeric_limits<uint32_t>::max)() > ul + </Original> + <Expanded> + 4294967295 (0x<hex digits>) > 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Composed generic matchers shortcircuit" tags="[composed][generic][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + !(matcher.match( 1 )) </Original> <Expanded> - true + !false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#835 -- errno should not be touched by Catch" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - f() == 0 + first.matchCalled </Original> <Expanded> - 1 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - errno == 1 + !second.matchCalled </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#872" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Info> - dummy := 0 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x == 4 + matcher.match( 1 ) </Original> <Expanded> - {?} == 4 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="#961 -- Dynamically created sections should all be reported" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="Looped section 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Looped section 1" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Looped section 2" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Looped section 3" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Looped section 4" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="'Not' checks that should fail" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - false != false + first.matchCalled </Original> <Expanded> - false != false + true </Expanded> </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true != true + !second.matchCalled </Original> <Expanded> - true != true + true </Expanded> </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Composed matchers shortcircuit" tags="[composed][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !true + !(matcher.match( 1 )) </Original> <Expanded> - false + !false </Expanded> </Expression> - <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !(true) + first.matchCalled </Original> <Expanded> - !true + true </Expanded> </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !trueValue + !second.matchCalled </Original> <Expanded> - false + true </Expanded> </Expression> - <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !(trueValue) + matcher.match( 1 ) </Original> <Expanded> - !true + true </Expanded> </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !(1 == 1) + first.matchCalled </Original> <Expanded> - false + true </Expanded> </Expression> - <Expression success="false" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - !(1 == 1) + !second.matchCalled </Original> <Expanded> - !(1 == 1) + true </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="'Not' checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "not there", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "not there" (case insensitive) + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "STRING" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "STRING" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Copy and then generate a range" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - false == false + elem % 2 == 1 </Original> <Expanded> - false == false + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - true == true + elem % 2 == 1 </Original> <Expanded> - true == true + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !false + elem % 2 == 1 </Original> <Expanded> - true + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !(false) + elem % 2 == 1 </Original> <Expanded> - !false + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !falseValue + elem % 2 == 1 </Original> <Expanded> - true + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !(falseValue) + elem % 2 == 1 </Original> <Expanded> - !false + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !(1 == 2) + elem % 2 == 1 </Original> <Expanded> - true + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - !(1 == 2) + elem % 2 == 1 </Original> <Expanded> - !(1 == 2) + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="(unimplemented) static bools can be evaluated" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Section name="compare to true" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - is_true<true>::value == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true == is_true<true>::value - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="compare to false" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - is_true<false>::value == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - false == is_true<false>::value - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !is_true<false>::value - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="double negation" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !!is_true<true>::value - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="direct" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - is_true<true>::value - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !(is_true<false>::value) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="3x3x3 ints" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + elem % 2 == 1 </Original> <Expanded> - 1 < 4 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - y < z + elem % 2 == 1 </Original> <Expanded> - 4 < 7 + 1 == 1 </Expanded> </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < z + elem % 2 == 1 </Original> <Expanded> - 1 < 7 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + elem % 2 == 1 </Original> <Expanded> - 1 < 4 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Final validation" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - y < z + call_count == 1 </Original> <Expanded> - 4 < 8 + 1 == 1 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < z + make_data().size() == test_count </Original> <Expanded> - 1 < 8 + 6 == 6 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Custom exceptions can be translated when testing for nothrow" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + throwCustom() + </Original> + <Expanded> + throwCustom() + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + custom exception - not std + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Custom exceptions can be translated when testing for throwing as something else" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + throwCustom(), std::exception + </Original> + <Expanded> + throwCustom(), std::exception + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + custom exception - not std + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Custom std-exceptions can be custom translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + custom std exception + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Default scale is invisible to comparison" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 101.000001 != Approx(100).epsilon(0.01) + </Original> + <Expanded> + 101.000001 != Approx( 100.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + std::pow(10, -5) != Approx(std::pow(10, -7)) + </Original> + <Expanded> + 0.00001 != Approx( 0.0000001 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Directly creating an EnumInfo" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + enumInfo->lookup(0) == "Value1" + </Original> + <Expanded> + Value1 == "Value1" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + enumInfo->lookup(1) == "Value2" + </Original> + <Expanded> + Value2 == "Value2" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + enumInfo->lookup(3) == "{** unexpected enum value **}" + </Original> + <Expanded> + {** unexpected enum value **} +== +"{** unexpected enum value **}" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="EndsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), EndsWith( "Substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ends with: "Substring" + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), EndsWith( "this", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ends with: "this" (case insensitive) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value1 ) == "Value1" + </Original> + <Expanded> + "Value1" == "Value1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value2 ) == "Value2" + </Original> + <Expanded> + "Value2" == "Value2" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value3 ) == "Value3" + </Original> + <Expanded> + "Value3" == "Value3" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" + </Original> + <Expanded> + "{** unexpected enum value **}" +== +"{** unexpected enum value **}" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( ec3 ) == "Value2" + </Original> + <Expanded> + "Value2" == "Value2" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( Bikeshed::Colours::Red ) == "Red" + </Original> + <Expanded> + "Red" == "Red" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + stringify( Bikeshed::Colours::Blue ) == "Blue" + </Original> + <Expanded> + "Blue" == "Blue" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Epsilon only applies to Approx's value" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + 101.01 != Approx(100).epsilon(0.01) + </Original> + <Expanded> + 101.01 != Approx( 100.0 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Equality checks that should fail" tags="[!mayfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 6 + </Original> + <Expanded> + 7 == 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 8 + </Original> + <Expanded> + 7 == 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 0 + </Original> + <Expanded> + 7 == 0 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one == Approx( 9.11f ) + </Original> + <Expanded> + 9.1f == Approx( 9.1099996567 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one == Approx( 9.0f ) + </Original> + <Expanded> + 9.1f == Approx( 9.0 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one == Approx( 1 ) + </Original> + <Expanded> + 9.1f == Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one == Approx( 0 ) + </Original> + <Expanded> + 9.1f == Approx( 0.0 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.double_pi == Approx( 3.1415 ) + </Original> + <Expanded> + 3.1415926535 == Approx( 3.1415 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "goodbye" + </Original> + <Expanded> + "hello" == "goodbye" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hell" + </Original> + <Expanded> + "hello" == "hell" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hello1" + </Original> + <Expanded> + "hello" == "hello1" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() == 6 + </Original> + <Expanded> + 5 == 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + x == Approx( 1.301 ) + </Original> + <Expanded> + 1.3 == Approx( 1.301 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Equality checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven == 7 + </Original> + <Expanded> + 7 == 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one == Approx( 9.1f ) + </Original> + <Expanded> + 9.1f == Approx( 9.1000003815 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.double_pi == Approx( 3.1415926535 ) + </Original> + <Expanded> + 3.1415926535 == Approx( 3.1415926535 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello == "hello" + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + "hello" == data.str_hello + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + x == Approx( 1.3 ) + </Original> + <Expanded> + 1.3 == Approx( 1.3 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Equals" tags="[matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Equals( "this string contains 'ABC' as a substring", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Equals string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Equals( "this string contains 'ABC' as a substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Equals( "something else", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" equals: "something else" (case insensitive) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" tags="[exception][toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" + </Original> + <Expanded> + "This exception has overridden what() method" +== +"This exception has overridden what() method" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" + </Original> + <Expanded> + "OperatorException" == "OperatorException" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" + </Original> + <Expanded> + "StringMakerException" +== +"StringMakerException" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Exception matchers that fail" tags="[!throws][.][exceptions][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="No exception" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 1 < 4 + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 4 < 9 + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <Section name="Type mismatch" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 1 < 9 + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + Unknown exception + </Exception> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 1 < 5 + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + Unknown exception + </Exception> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <Section name="Contents are wrong" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + throwsSpecialException( 3 ), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 5 < 7 + SpecialException::what special exception has value of 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + throwsSpecialException( 4 ), SpecialException, ExceptionMatcher{ 1 } </Original> <Expanded> - 1 < 7 + SpecialException::what special exception has value of 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Exception matchers that succeed" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } + </Original> + <Expanded> + SpecialException::what special exception has value of 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } + </Original> + <Expanded> + SpecialException::what special exception has value of 2 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Exception messages can be tested for" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="exact match" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - x < y + thisThrows(), "expected exception" </Original> <Expanded> - 1 < 5 + "expected exception" equals: "expected exception" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="different case" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - y < z + thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) </Original> <Expanded> - 5 < 8 + "expected exception" equals: "expected exception" (case insensitive) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="wildcarded" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - x < z + thisThrows(), StartsWith( "expected" ) </Original> <Expanded> - 1 < 8 + "expected exception" starts with: "expected" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - x < y + thisThrows(), EndsWith( "exception" ) </Original> <Expanded> - 1 < 5 + "expected exception" ends with: "exception" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > <Original> - y < z + thisThrows(), Contains( "except" ) </Original> <Expanded> - 5 < 9 + "expected exception" contains: "except" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "expected exception" contains: "except" (case insensitive) + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Exceptions matchers" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsDerivedException(), DerivedException, Message( "DerivedException::what" ) + </Original> + <Expanded> + DerivedException::what exception message matches "DerivedException::what" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsDerivedException(), DerivedException, !Message( "derivedexception::what" ) + </Original> + <Expanded> + DerivedException::what not exception message matches "derivedexception::what" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsSpecialException( 2 ), SpecialException, !Message( "DerivedException::what" ) + </Original> + <Expanded> + SpecialException::what not exception message matches "DerivedException::what" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + throwsSpecialException( 2 ), SpecialException, Message( "SpecialException::what" ) + </Original> + <Expanded> + SpecialException::what exception message matches "SpecialException::what" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Expected exceptions that don't throw or unexpected exceptions fail the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), std::string + </Original> + <Expanded> + thisThrows(), std::string + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisDoesntThrow(), std::domain_error + </Original> + <Expanded> + thisDoesntThrow(), std::domain_error + </Expanded> + </Expression> + <Expression success="false" type="CHECK_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() + </Original> + <Expanded> + thisThrows() + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL aborts the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + This is a failure + </Failure> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL does not require an argument" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" /> + <OverallResult success="false"/> + </TestCase> + <TestCase name="FAIL_CHECK does not abort the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + This is a failure + </Failure> + <Warning> + This message appears in the output + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Factorials are computed" tags="[factorial]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(0) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(1) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(2) == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(3) == 6 + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + Factorial(10) == 3628800 + </Original> + <Expanded> + 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 10., WithinRel( 11.1, 0.1 ) </Original> <Expanded> - 1 < 9 + 10.0 and 11.1 are within 10% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 10., !WithinRel( 11.2, 0.1 ) </Original> <Expanded> - 1 < 6 + 10.0 not and 11.2 are within 10% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1., !WithinRel( 0., 0.99 ) </Original> <Expanded> - 6 < 7 + 1.0 not and 0 are within 99% of each other </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + -0., WithinRel( 0. ) </Original> <Expanded> - 1 < 7 + -0.0 and 0 are within 2.22045e-12% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, WithinRel( v2 ) + </Original> + <Expanded> + 0.0 and 2.22507e-308 are within 2.22045e-12% of each other + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Margin" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 1., WithinAbs( 1., 0 ) </Original> <Expanded> - 1 < 6 + 1.0 is within 0.0 of 1.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 0., WithinAbs( 1., 1 ) </Original> <Expanded> - 6 < 8 + 0.0 is within 1.0 of 1.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 1 < 8 + 0.0 not is within 0.99 of 1.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 0., !WithinAbs( 1., 0.99 ) </Original> <Expanded> - 1 < 6 + 0.0 not is within 0.99 of 1.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 11., !WithinAbs( 10., 0.5 ) </Original> <Expanded> - 6 < 9 + 11.0 not is within 0.5 of 10.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 10., !WithinAbs( 11., 0.5 ) </Original> <Expanded> - 1 < 9 + 10.0 not is within 0.5 of 11.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + -10., WithinAbs( -10., 0.5 ) </Original> <Expanded> - 2 < 4 + -10.0 is within 0.5 of -10.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + -10., WithinAbs( -9.6, 0.5 ) </Original> <Expanded> - 4 < 7 + -10.0 is within 0.5 of -9.6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="ULPs" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 1., WithinULP( 1., 0 ) </Original> <Expanded> - 2 < 7 + 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + nextafter( 1., 2. ), WithinULP( 1., 1 ) </Original> <Expanded> - 2 < 4 + 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 0., WithinULP( nextafter( 0., 1. ), 1 ) </Original> <Expanded> - 4 < 8 + 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 1., WithinULP( nextafter( 1., 0. ), 1 ) </Original> <Expanded> - 2 < 8 + 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 1., !WithinULP( nextafter( 1., 2. ), 0 ) </Original> <Expanded> - 2 < 4 + 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1., WithinULP( 1., 0 ) </Original> <Expanded> - 4 < 9 + 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + -0., WithinULP( 0., 0 ) </Original> <Expanded> - 2 < 9 + -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="Composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) </Original> <Expanded> - 2 < 5 + 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) </Original> <Expanded> - 5 < 7 + 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) </Original> <Expanded> - 2 < 7 + 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Constructor validation" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + WithinAbs( 1., 0. ) </Original> <Expanded> - 2 < 5 + WithinAbs( 1., 0. ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + WithinAbs( 1., -1. ), std::domain_error </Original> <Expanded> - 5 < 8 + WithinAbs( 1., -1. ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + WithinULP( 1., 0 ) </Original> <Expanded> - 2 < 8 + WithinULP( 1., 0 ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + WithinRel( 1., 0. ) </Original> <Expanded> - 2 < 5 + WithinRel( 1., 0. ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + WithinRel( 1., -0.2 ), std::domain_error </Original> <Expanded> - 5 < 9 + WithinRel( 1., -0.2 ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + WithinRel( 1., 1. ), std::domain_error </Original> <Expanded> - 2 < 9 + WithinRel( 1., 1. ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Floating point matchers: float" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 10.f, WithinRel( 11.1f, 0.1f ) </Original> <Expanded> - 2 < 6 + 10.0f and 11.1 are within 10% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 10.f, !WithinRel( 11.2f, 0.1f ) </Original> <Expanded> - 6 < 7 + 10.0f not and 11.2 are within 10% of each other </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 1.f, !WithinRel( 0.f, 0.99f ) </Original> <Expanded> - 2 < 7 + 1.0f not and 0 are within 99% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + -0.f, WithinRel( 0.f ) </Original> <Expanded> - 2 < 6 + -0.0f and 0 are within 0.00119209% of each other </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, WithinRel( v2 ) + </Original> + <Expanded> + 0.0f and 1.17549e-38 are within 0.00119209% of each other + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Margin" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1.f, WithinAbs( 1.f, 0 ) </Original> <Expanded> - 6 < 8 + 1.0f is within 0.0 of 1.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 0.f, WithinAbs( 1.f, 1 ) </Original> <Expanded> - 2 < 8 + 0.0f is within 1.0 of 1.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 2 < 6 + 0.0f not is within 0.9900000095 of 1.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 0.f, !WithinAbs( 1.f, 0.99f ) </Original> <Expanded> - 6 < 9 + 0.0f not is within 0.9900000095 of 1.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 0.f, WithinAbs( -0.f, 0 ) </Original> <Expanded> - 2 < 9 + 0.0f is within 0.0 of -0.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 11.f, !WithinAbs( 10.f, 0.5f ) </Original> <Expanded> - 3 < 4 + 11.0f not is within 0.5 of 10.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 10.f, !WithinAbs( 11.f, 0.5f ) </Original> <Expanded> - 4 < 7 + 10.0f not is within 0.5 of 11.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + -10.f, WithinAbs( -10.f, 0.5f ) </Original> <Expanded> - 3 < 7 + -10.0f is within 0.5 of -10.0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + -10.f, WithinAbs( -9.6f, 0.5f ) </Original> <Expanded> - 3 < 4 + -10.0f is within 0.5 of -9.6000003815 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="9" failures="0" expectedFailures="0"/> + </Section> + <Section name="ULPs" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1.f, WithinULP( 1.f, 0 ) </Original> <Expanded> - 4 < 8 + 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + -1.f, WithinULP( -1.f, 0 ) </Original> <Expanded> - 3 < 8 + -1.0f is within 0 ULPs of -1.00000000e+00f ([-1.00000000e+00, -1.00000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) </Original> <Expanded> - 3 < 4 + 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 0.f, WithinULP( nextafter( 0.f, 1.f ), 1 ) </Original> <Expanded> - 4 < 9 + 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 1.f, WithinULP( nextafter( 1.f, 0.f ), 1 ) </Original> <Expanded> - 3 < 9 + 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 1.f, !WithinULP( nextafter( 1.f, 2.f ), 0 ) </Original> <Expanded> - 3 < 5 + 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1.f, WithinULP( 1.f, 0 ) </Original> <Expanded> - 5 < 7 + 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + -0.f, WithinULP( 0.f, 0 ) </Original> <Expanded> - 3 < 7 + -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) </Original> <Expanded> - 3 < 5 + 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) </Original> <Expanded> - 5 < 8 + 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) </Original> <Expanded> - 3 < 8 + 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Constructor validation" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + WithinAbs( 1.f, 0.f ) </Original> <Expanded> - 3 < 5 + WithinAbs( 1.f, 0.f ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + WithinAbs( 1.f, -1.f ), std::domain_error </Original> <Expanded> - 5 < 9 + WithinAbs( 1.f, -1.f ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + WithinULP( 1.f, 0 ) </Original> <Expanded> - 3 < 9 + WithinULP( 1.f, 0 ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error </Original> <Expanded> - 3 < 6 + WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - y < z + WithinRel( 1.f, 0.f ) </Original> <Expanded> - 6 < 7 + WithinRel( 1.f, 0.f ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < z + WithinRel( 1.f, -0.2f ), std::domain_error </Original> <Expanded> - 3 < 7 + WithinRel( 1.f, -0.2f ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - x < y + WithinRel( 1.f, 1.f ), std::domain_error </Original> <Expanded> - 3 < 6 + WithinRel( 1.f, 1.f ), std::domain_error </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws if there are no matching values" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + filter([] (int) {return false; }, value(1)), Catch::GeneratorException + </Original> + <Expanded> + filter([] (int) {return false; }, value(1)), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - y < z + i < 4 </Original> <Expanded> - 6 < 8 + 1 < 4 </Expanded> </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < z + i < 4 </Original> <Expanded> - 3 < 8 + 2 < 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < y + i < 4 </Original> <Expanded> - 3 < 6 + 3 < 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i % 2 == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + i.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - y < z + j > 0 </Original> <Expanded> - 6 < 9 + 1 > 0 </Expanded> </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - x < z - </Original> - <Expanded> - 3 < 9 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A METHOD_AS_TEST_CASE based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - s == "world" - </Original> - <Expanded> - "hello" == "world" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - s == "hello" - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<float>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 - </Original> - <Expanded> - 0 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector<int>" tags="[.][class][failing][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 1 + j > 0 </Original> <Expanded> - 0 == 1 + 2 > 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - Template_Foo<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 + j > 0 </Original> <Expanded> - 0 == 0 + 3 > 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<float>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 + j > 0 </Original> <Expanded> - 0 == 0 + 1 > 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that succeeds - std::vector<int>" tags="[class][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>::m_a.size() == 0 + j > 0 </Original> <Expanded> - 0 == 0 + 2 > 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() < 2 + j > 0 </Original> <Expanded> - 6 < 2 + 3 > 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - Template_Foo_2<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 1 < 3 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() == chunk2.back() + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.front() < 3 + </Original> + <Expanded> + 2 < 3 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk2.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="Throws on too small generators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + chunk(2, value(1)), Catch::GeneratorException + </Original> + <Expanded> + chunk(2, value(1)), Catch::GeneratorException + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Generators -- simple" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() < 2 + j < i </Original> <Expanded> - 2 < 2 + -3 < 1 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<float, 6>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() < 2 + j < i </Original> <Expanded> - 6 < 2 + -2 < 1 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that fails - std::array<int, 2>" tags="[.][class][failing][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() < 2 + j < i </Original> <Expanded> - 2 < 2 + -1 < 1 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() >= 2 + 4u * i > str.size() </Original> <Expanded> - 6 >= 2 + 4 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - Template_Foo_2<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() >= 2 + 4u * i > str.size() </Original> <Expanded> - 2 >= 2 + 4 > 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<float,6>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() >= 2 + 4u * i > str.size() </Original> <Expanded> - 6 >= 2 + 4 > 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG based test run that succeeds - std::array<int,2>" tags="[class][nttp][product][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture_2<TestType>{}.m_a.size() >= 2 + j < i </Original> <Expanded> - 2 >= 2 + -3 < 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - double" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 2 + j < i </Original> <Expanded> - 1.0 == 2 + -2 < 2 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - float" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 2 + j < i </Original> <Expanded> - 1.0f == 2 + -1 < 2 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that fails - int" tags="[.][class][failing][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 2 + 4u * i > str.size() </Original> <Expanded> - 1 == 2 + 8 > 1 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - double" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + 4u * i > str.size() </Original> <Expanded> - 1.0 == 1 + 8 > 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - float" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + 4u * i > str.size() </Original> <Expanded> - 1.0f == 1 + 8 > 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD based test run that succeeds - int" tags="[class][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + j < i </Original> <Expanded> - 1 == 1 + -3 < 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 1" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Nttp_Fixture<V>::value == 0 + j < i </Original> <Expanded> - 1 == 0 + -2 < 3 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 3" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Nttp_Fixture<V>::value == 0 + j < i </Original> <Expanded> - 3 == 0 + -1 < 3 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that fails - 6" tags="[.][class][failing][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Nttp_Fixture<V>::value == 0 + 4u * i > str.size() </Original> <Expanded> - 6 == 0 + 12 > 1 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 1" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Nttp_Fixture<V>::value > 0 + 4u * i > str.size() </Original> <Expanded> - 1 > 0 + 12 > 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 3" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > <Original> - Nttp_Fixture<V>::value > 0 + 4u * i > str.size() </Original> <Expanded> - 3 > 0 + 12 > 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEMPLATE_TEST_CASE_METHOD_SIG based test run that succeeds - 6" tags="[class][nttp][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Generators internals" tags="[generators][internals]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Single value" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - Nttp_Fixture<V>::value > 0 + gen.get() == 123 </Original> <Expanded> - 6 > 0 + 123 == 123 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A TEST_CASE_METHOD based test run that fails" tags="[.][class][failing]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - m_a == 2 + !(gen.next()) </Original> <Expanded> - 1 == 2 + !false </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A TEST_CASE_METHOD based test run that succeeds" tags="[class]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Preset values" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - m_a == 1 + gen.get() == 1 </Original> <Expanded> 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case - Foo<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> - x.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case - Foo<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> - x.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case - std::vector<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" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() == 0 + gen.next() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case - std::vector<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" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() == 0 + gen.get() == 3 </Original> <Expanded> - 0 == 0 + 3 == 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case with array signature - Bar<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() > 0 + gen.next() </Original> <Expanded> - 42 > 0 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case with array signature - Bar<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() > 0 + gen.get() == 5 </Original> <Expanded> - 9 > 0 + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case with array signature - std::array<float, 42>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() > 0 + !(gen.next()) </Original> <Expanded> - 42 > 0 + !false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A Template product test case with array signature - std::array<int, 9>" tags="[nttp][product][template]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Generator combinator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - x.size() > 0 + gen.get() == 1 </Original> <Expanded> - 9 > 0 + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A comparison that uses literals instead of the normal constructor" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d == 1.23_a + gen.next() </Original> <Expanded> - 1.23 == Approx( 1.23 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d != 1.22_a + gen.get() == 5 </Original> <Expanded> - 1.23 != Approx( 1.22 ) + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - -d == -1.23_a + gen.next() </Original> <Expanded> - -1.23 == Approx( -1.23 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d == 1.2_a .epsilon(.1) + gen.get() == 2 </Original> <Expanded> - 1.23 == Approx( 1.2 ) + 2 == 2 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d != 1.2_a .epsilon(.001) + gen.next() </Original> <Expanded> - 1.23 != Approx( 1.2 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d == 1_a .epsilon(.3) + gen.get() == 4 </Original> <Expanded> - 1.23 == Approx( 1.0 ) + 4 == 4 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="A couple of nested sections followed by a failure" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="Outer" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="Inner" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - to infinity and beyond - </Failure> - <OverallResult success="false"/> - </TestCase> - <TestCase name="A failing expression with a non streamable type is still captured" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - &o1 == &o2 + gen.next() </Original> <Expanded> - 0x<hex digits> == 0x<hex digits> + true </Expanded> </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - o1 == o2 + gen.get() == 0 </Original> <Expanded> - {?} == {?} + 0 == 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Absolute margin" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 104.0 != Approx(100.0) + !(gen.next()) </Original> <Expanded> - 104.0 != Approx( 100.0 ) + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Section name="Explicitly typed generator sequence" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 104.0 == Approx(100.0).margin(5) + gen.get().size() == 2 </Original> <Expanded> - 104.0 == Approx( 100.0 ) + 2 == 2 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 104.0 == Approx(100.0).margin(4) + gen.get() == "aa" </Original> <Expanded> - 104.0 == Approx( 100.0 ) + "aa" == "aa" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 104.0 != Approx(100.0).margin(3) + gen.next() </Original> <Expanded> - 104.0 != Approx( 100.0 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 100.3 != Approx(100.0) + gen.get() == "bb" </Original> <Expanded> - 100.3 != Approx( 100.0 ) + "bb" == "bb" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 100.3 == Approx(100.0).margin(0.5) + gen.next() </Original> <Expanded> - 100.3 == Approx( 100.0 ) + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="An empty test with no assertions" tags="[empty]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="An expression with side-effects should only be evaluated once" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - i++ == 7 + gen.get() == "cc" </Original> <Expanded> - 7 == 7 + "cc" == "cc" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - i++ == 8 + !(gen.next()) </Original> <Expanded> - 8 == 8 + !false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="An unchecked exception reports the line of the last assertion" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1 == 1 + gen.get() == 1 </Original> <Expanded> 1 == 1 </Expanded> </Expression> - <Expression success="false" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - {Unknown expression after the reported line} + gen.next() </Original> <Expanded> - {Unknown expression after the reported line} + true </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - unexpected exception - </Exception> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Anonymous test case 1" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approx setters validate their arguments" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - Approx(0).margin(0) + gen.get() == 3 </Original> <Expanded> - Approx(0).margin(0) + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - Approx(0).margin(1234656) + !(gen.next()) </Original> <Expanded> - Approx(0).margin(1234656) + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - Approx(0).margin(-2), std::domain_error + filter([] (int) { return false; }, value(1)), Catch::GeneratorException </Original> <Expanded> - Approx(0).margin(-2), std::domain_error + filter([] (int) { return false; }, value(1)), Catch::GeneratorException </Expanded> </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(0).epsilon(0) - </Original> - <Expanded> - Approx(0).epsilon(0) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(0).epsilon(1) - </Original> - <Expanded> - Approx(0).epsilon(1) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(0).epsilon(-0.001), std::domain_error - </Original> - <Expanded> - Approx(0).epsilon(-0.001), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(0).epsilon(1.0001), std::domain_error - </Original> - <Expanded> - Approx(0).epsilon(1.0001), std::domain_error - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approx with exactly-representable margin" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 0.25f == Approx(0.0f).margin(0.25f) - </Original> - <Expanded> - 0.25f == Approx( 0.0 ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 0.0f == Approx(0.25f).margin(0.25f) - </Original> - <Expanded> - 0.0f == Approx( 0.25 ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 0.5f == Approx(0.25f).margin(0.25f) - </Original> - <Expanded> - 0.5f == Approx( 0.25 ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 245.0f == Approx(245.25f).margin(0.25f) - </Original> - <Expanded> - 245.0f == Approx( 245.25 ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 245.5f == Approx(245.25f).margin(0.25f) - </Original> - <Expanded> - 245.5f == Approx( 245.25 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approximate PI" tags="[Approx][PI]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - divide( 22, 7 ) == Approx( 3.141 ).epsilon( 0.001 ) - </Original> - <Expanded> - 3.1428571429 == Approx( 3.141 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take less" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Take more" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Map with explicit return type" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - divide( 22, 7 ) != Approx( 3.141 ).epsilon( 0.0001 ) + gen.get() == 2.0 </Original> <Expanded> - 3.1428571429 != Approx( 3.141 ) + 2.0 == 2.0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approximate comparisons with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d != Approx( 1.231 ) + gen.next() </Original> <Expanded> - 1.23 != Approx( 1.231 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - d == Approx( 1.231 ).epsilon( 0.1 ) + gen.get() == 4.0 </Original> <Expanded> - 1.23 == Approx( 1.231 ) + 4.0 == 4.0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approximate comparisons with floats" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1.23f == Approx( 1.23f ) + gen.next() </Original> <Expanded> - 1.23f == Approx( 1.2300000191 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 0.0f == Approx( 0.0f ) + gen.get() == 6.0 </Original> <Expanded> - 0.0f == Approx( 0.0 ) + 6.0 == 6.0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approximate comparisons with ints" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1 == Approx( 1 ) + !(gen.next()) </Original> <Expanded> - 1 == Approx( 1.0 ) + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Map with deduced return type" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 0 == Approx( 0 ) + gen.get() == 2.0 </Original> <Expanded> - 0 == Approx( 0.0 ) + 2.0 == 2.0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Approximate comparisons with mixed numeric types" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1.0f == Approx( 1 ) + gen.next() </Original> <Expanded> - 1.0f == Approx( 1.0 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 0 == Approx( dZero) + gen.get() == 4.0 </Original> <Expanded> - 0 == Approx( 0.0 ) + 4.0 == 4.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 0 == Approx( dSmall ).margin( 0.001 ) + gen.next() </Original> <Expanded> - 0 == Approx( 0.00001 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1.234f == Approx( dMedium ) + gen.get() == 6.0 </Original> <Expanded> - 1.234f == Approx( 1.234 ) + 6.0 == 6.0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - dMedium == Approx( 1.234f ) + !(gen.next()) </Original> <Expanded> - 1.234 == Approx( 1.2339999676 ) + !false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Arbitrary predicate matcher" tags="[generic][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Function pointer" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Singular repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1, Predicate<int>(alwaysTrue, "always true") + gen.get() == 3 </Original> <Expanded> - 1 matches predicate: "always true" + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - 1, !Predicate<int>(alwaysFalse, "always false") + !(gen.next()) </Original> <Expanded> - 1 not matches predicate: "always false" + !false </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Lambdas + different type" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") - </Original> - <Expanded> - "Hello olleH" matches predicate: "First and last character should be equal" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Actual repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) + gen.get() == 1 </Original> <Expanded> - "This wouldn't pass" not matches undescribed predicate + 1 == 1 </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Assertion macros support bit operators and bool conversions" tags="[bitops][compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - lhs | rhs - </Original> - <Expanded> - Val: 1 | Val: 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - !(lhs & rhs) - </Original> - <Expanded> - !(Val: 1 & Val: 2) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - HasBitOperators{ 1 } & HasBitOperators{ 1 } - </Original> - <Expanded> - Val: 1 & Val: 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - lhs ^ rhs - </Original> - <Expanded> - Val: 1 ^ Val: 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - !(lhs ^ lhs) - </Original> - <Expanded> - !(Val: 1 ^ Val: 1) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - true + gen.next() </Original> <Expanded> true </Expanded> </Expression> - <Section name="Another section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="A section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - true + gen.get() == 2 </Original> <Expanded> - true + 2 == 2 </Expanded> </Expression> - <Section name="Another other section" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Basic use of the Contains range matcher" tags="[contains][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Different argument ranges, same element type, default comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - a, Contains(1) + gen.next() </Original> <Expanded> - { 1, 2, 3 } contains element 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - b, Contains(1) + gen.get() == 3 </Original> <Expanded> - { 0, 1, 2 } contains element 1 + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - c, !Contains(1) + gen.next() </Original> <Expanded> - { 4, 5, 6 } not contains element 1 + true </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Different argument ranges, same element type, custom comparison" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - a, Contains(0, close_enough) + gen.get() == 1 </Original> <Expanded> - { 1, 2, 3 } contains element 0 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - b, Contains(0, close_enough) + gen.next() </Original> <Expanded> - { 0, 1, 2 } contains element 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - c, !Contains(0, close_enough) + gen.get() == 2 </Original> <Expanded> - { 4, 5, 6 } not contains element 0 + 2 == 2 </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Different element type, custom comparisons" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - a, Contains(4, [](auto&& lhs, size_t sz) { return lhs.size() == sz; }) + gen.next() </Original> <Expanded> - { "abc", "abcd", "abcde" } contains element 4 + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Can handle type that requires ADL-found free function begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - in, Contains(1) + gen.get() == 3 </Original> <Expanded> - { 1, 2, 3, 4, 5 } contains element 1 + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > <Original> - in, !Contains(8) + !(gen.next()) </Original> <Expanded> - { 1, 2, 3, 4, 5 } not contains element 8 + !false </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="12" failures="0" expectedFailures="0"/> </Section> - <Section name="Initialization with move only types" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - in, Contains(MoveOnlyTestElement{ 2 }) - </Original> - <Expanded> - { 1, 2, 3 } contains element 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - in, !Contains(MoveOnlyTestElement{ 9 }) - </Original> - <Expanded> - { 1, 2, 3 } not contains element 9 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Matching using matcher" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - in, Contains(Catch::Matchers::WithinAbs(0.5, 0.5)) - </Original> - <Expanded> - { 1.0, 2.0, 3.0, 0.0 } contains element matching is within 0.5 of 0.5 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Basic use of the Empty range matcher" tags="[empty][matchers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Simple, std-provided containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - empty_array, IsEmpty() - </Original> - <Expanded> - { } is empty - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - non_empty_array, !IsEmpty() - </Original> - <Expanded> - { 0.0 } not is empty - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - empty_vec, IsEmpty() - </Original> - <Expanded> - { } is empty - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - non_empty_vec, !IsEmpty() - </Original> - <Expanded> - { 'a', 'b', 'c' } not is empty - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - inner_lists_are_empty, !IsEmpty() - </Original> - <Expanded> - { { } } not is empty - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - inner_lists_are_empty.front(), IsEmpty() - </Original> - <Expanded> - { } is empty - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -2 + </Original> + <Expanded> + -2 == -2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <Section name="Type with empty" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - has_empty{}, !IsEmpty() - </Original> - <Expanded> - {?} not is empty - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <Section name="Type requires ADL found empty free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - unrelated::ADL_empty{}, IsEmpty() - </Original> - <Expanded> - {?} is empty - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="CAPTURE can deal with complex expressions" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - a := 1 - </Info> - <Info> - b := 2 - </Info> - <Info> - c := 3 - </Info> - <Info> - a + b := 3 - </Info> - <Info> - a+b := 3 - </Info> - <Info> - c > b := true - </Info> - <Info> - a == 1 := true - </Info> - <OverallResult success="true"/> - </TestCase> - <TestCase name="CAPTURE can deal with complex expressions involving commas" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - std::vector<int>{1, 2, 3}[0, 1, 2] := 3 - </Info> - <Info> - std::vector<int>{1, 2, 3}[(0, 1)] := 2 - </Info> - <Info> - std::vector<int>{1, 2, 3}[0] := 1 - </Info> - <Info> - (helper_1436<int, int>{12, -12}) := { 12, -12 } - </Info> - <Info> - (helper_1436<int, int>(-12, 12)) := { -12, 12 } - </Info> - <Info> - (1, 2) := 2 - </Info> - <Info> - (2, 3) := 3 - </Info> - <OverallResult success="true"/> - </TestCase> - <TestCase name="CAPTURE parses string and character constants" tags="[capture][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - ("comma, in string", "escaped, \", ") := "escaped, ", " - </Info> - <Info> - "single quote in string,'," := "single quote in string,'," - </Info> - <Info> - "some escapes, \\,\\\\" := "some escapes, \,\\" - </Info> - <Info> - "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" - </Info> - <Info> - '"' := '"' - </Info> - <Info> - '\'' := ''' - </Info> - <Info> - ',' := ',' - </Info> - <Info> - '}' := '}' - </Info> - <Info> - ')' := ')' - </Info> - <Info> - '(' := '(' - </Info> - <Info> - '{' := '{' - </Info> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Capture and info messages" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="Capture should stringify like assertions" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Info> - i := 2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Info should NOT stringify the way assertions do" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Info> - 3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Character pretty printing" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="Specifically escaped" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - tab == '\t' - </Original> - <Expanded> - '\t' == '\t' - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - newline == '\n' - </Original> - <Expanded> - '\n' == '\n' - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - carr_return == '\r' - </Original> - <Expanded> - '\r' == '\r' - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - form_feed == '\f' - </Original> - <Expanded> - '\f' == '\f' - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <Section name="General chars" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - space == ' ' - </Original> - <Expanded> - ' ' == ' ' - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == chars[i] - </Original> - <Expanded> - 'a' == 'a' - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == chars[i] - </Original> - <Expanded> - 'z' == 'z' - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == chars[i] - </Original> - <Expanded> - 'A' == 'A' - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == chars[i] - </Original> - <Expanded> - 'Z' == 'Z' - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> - <Section name="Low ASCII" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - null_terminator == '\0' - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == i - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == i - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == i - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - c == i - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Clara::Arg supports single-arg parse the way Opt does" tags="[arg][clara][compilation]" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > - <Original> - name.empty() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Clara.tests.cpp" > - <Original> - name == "foo" - </Original> - <Expanded> - "foo" == "foo" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining MatchAllOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, (MatcherA() && MatcherB()) && MatcherC() - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, MatcherA() && (MatcherB() && MatcherC()) - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, (MatcherA() && MatcherB()) && (MatcherC() && MatcherD()) - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 and equals: (T) 1 and equals: true ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining MatchAnyOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, (MatcherA() || MatcherB()) || MatcherC() - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, MatcherA() || (MatcherB() || MatcherC()) - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, (MatcherA() || MatcherB()) || (MatcherC() || MatcherD()) - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 or equals: (T) 1 or equals: true ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining MatchNotOfGeneric does not nest" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0, !MatcherA() - </Original> - <Expanded> - 0 not equals: (int) 1 or (float) 1.0f - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, !!MatcherA() - </Original> - <Expanded> - 1 equals: (int) 1 or (float) 1.0f - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0, !!!MatcherA() - </Original> - <Expanded> - 0 not equals: (int) 1 or (float) 1.0f - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, !!!!MatcherA() - </Original> - <Expanded> - 1 equals: (int) 1 or (float) 1.0f - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining concrete matchers does not use templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining only templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, MatcherA() || MatcherB() - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or equals: (long long) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, MatcherA() && MatcherB() - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f and equals: (long long) 1 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1, MatcherA() || !MatcherB() - </Original> - <Expanded> - 1 ( equals: (int) 1 or (float) 1.0f or not equals: (long long) 1 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining templated and concrete matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 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) - </Original> - <Expanded> - { 1, 3, 5 } ( matches predicate: "All elements are odd" and not Equals: { 5, 3, 1 } ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, StartsWith("foo") && EqualsRange(arr) && EndsWith("bar") - </Original> - <Expanded> - "foobar" ( starts with: "foo" and Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and ends with: "bar" ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, StartsWith("foo") && !EqualsRange(bad_arr) && EndsWith("bar") - </Original> - <Expanded> - "foobar" ( starts with: "foo" and not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and ends with: "bar" ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, EqualsRange(arr) && StartsWith("foo") && EndsWith("bar") - </Original> - <Expanded> - "foobar" ( Equals: { 'f', 'o', 'o', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, !EqualsRange(bad_arr) && StartsWith("foo") && EndsWith("bar") - </Original> - <Expanded> - "foobar" ( not Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } and starts with: "foo" and ends with: "bar" ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, EqualsRange(bad_arr) || (StartsWith("foo") && EndsWith("bar")) - </Original> - <Expanded> - "foobar" ( Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } or ( starts with: "foo" and ends with: "bar" ) ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - str, (StartsWith("foo") && EndsWith("bar")) || EqualsRange(bad_arr) - </Original> - <Expanded> - "foobar" ( ( starts with: "foo" and ends with: "bar" ) or Equals: { 'o', 'o', 'f', 'b', 'a', 'r' } ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Combining templated matchers" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - container, EqualsRange(a) || EqualsRange(b) || EqualsRange(c) - </Original> - <Expanded> - { 1, 2, 3 } ( Equals: { 1, 2, 3 } or Equals: { 0, 1, 2 } or Equals: { 4, 5, 6 } ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Commas in various macros are allowed" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} - </Original> - <Expanded> - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} - </Original> - <Expanded> - std::vector<constructor_throws>{constructor_throws{}, constructor_throws{}} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} - </Original> - <Expanded> - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} - </Expanded> - </Expression> - <Expression success="true" type="CHECK_NOTHROW" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} - </Original> - <Expanded> - std::vector<int>{1, 2, 3} == std::vector<int>{1, 2, 3} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2} == std::vector<int>{1, 2} - </Original> - <Expanded> - { 1, 2 } == { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2} == std::vector<int>{1, 2} - </Original> - <Expanded> - { 1, 2 } == { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) - </Original> - <Expanded> - !({ 1, 2 } == { 1, 2, 3 }) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !(std::vector<int>{1, 2} == std::vector<int>{1, 2, 3}) - </Original> - <Expanded> - !({ 1, 2 } == { 1, 2, 3 }) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2} == std::vector<int>{1, 2} - </Original> - <Expanded> - { 1, 2 } == { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2} == std::vector<int>{1, 2} - </Original> - <Expanded> - { 1, 2 } == { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - true - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - std::vector<int>{1, 2} == std::vector<int>{1, 2} - </Original> - <Expanded> - { 1, 2 } == { 1, 2 } - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparing function pointers" tags="[function pointer][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - a - </Original> - <Expanded> - 0x<hex digits> - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - a == &foo - </Original> - <Expanded> - 0x<hex digits> == 0x<hex digits> - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparison ops" tags="[rng]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - SimplePcg32{} == SimplePcg32{} - </Original> - <Expanded> - {?} == {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - SimplePcg32{ 0 } != SimplePcg32{} - </Original> - <Expanded> - {?} != {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - !(SimplePcg32{ 1 } == SimplePcg32{ 2 }) - </Original> - <Expanded> - !({?} == {?}) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - !(SimplePcg32{ 1 } != SimplePcg32{ 1 }) - </Original> - <Expanded> - !({?} != {?}) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparison with explicitly convertible types" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td == Approx(10.0) - </Original> - <Expanded> - StrongDoubleTypedef(10) == Approx( 10.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(10.0) == td - </Original> - <Expanded> - Approx( 10.0 ) == StrongDoubleTypedef(10) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td != Approx(11.0) - </Original> - <Expanded> - StrongDoubleTypedef(10) != Approx( 11.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(11.0) != td - </Original> - <Expanded> - Approx( 11.0 ) != StrongDoubleTypedef(10) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td <= Approx(10.0) - </Original> - <Expanded> - StrongDoubleTypedef(10) <= Approx( 10.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td <= Approx(11.0) - </Original> - <Expanded> - StrongDoubleTypedef(10) <= Approx( 11.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(10.0) <= td - </Original> - <Expanded> - Approx( 10.0 ) <= StrongDoubleTypedef(10) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(9.0) <= td - </Original> - <Expanded> - Approx( 9.0 ) <= StrongDoubleTypedef(10) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td >= Approx(9.0) - </Original> - <Expanded> - StrongDoubleTypedef(10) >= Approx( 9.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - td >= Approx(td) - </Original> - <Expanded> - StrongDoubleTypedef(10) >= Approx( 10.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(td) >= td - </Original> - <Expanded> - Approx( 10.0 ) >= StrongDoubleTypedef(10) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx(11.0) >= td - </Original> - <Expanded> - Approx( 11.0 ) >= StrongDoubleTypedef(10) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparisons between ints where one side is computed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 54 == 6*9 - </Original> - <Expanded> - 54 == 54 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - ( -1 > 2u ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - -1 > 2u - </Original> - <Expanded> - -1 > 2 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - ( 2u < -1 ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 2u < -1 - </Original> - <Expanded> - 2 < -1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - ( minInt > 2u ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - minInt > 2u - </Original> - <Expanded> - -2147483648 > 2 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Comparisons with int literals don't warn when mixing signed/ unsigned" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - i == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - ui == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - l == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - ul == 4 - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - c == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - uc == 6 - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 1 == i - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 2 == ui - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 3 == l - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 4 == ul - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 5 == c - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 6 == uc - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - (std::numeric_limits<uint32_t>::max)() > ul - </Original> - <Expanded> - 4294967295 (0x<hex digits>) > 4 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Composed generic matchers shortcircuit" tags="[composed][generic][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !(matcher.match( 1 )) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - first.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !second.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - matcher.match(1) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - first.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !second.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Composed matchers shortcircuit" tags="[composed][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="MatchAllOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !(matcher.match( 1 )) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - first.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !second.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="MatchAnyOf" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - matcher.match( 1 ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - first.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - !second.matchCalled - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Contains string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("not there", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "not there" (case insensitive) - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("STRING") - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "STRING" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Copy and then generate a range" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="from var and iterators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From a temporary container" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - elem % 2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Final validation" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - call_count == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - make_data().size() == test_count - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Custom exceptions can be translated when testing for nothrow" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - throwCustom() - </Original> - <Expanded> - throwCustom() - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - custom exception - not std - </Exception> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Custom exceptions can be translated when testing for throwing as something else" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - throwCustom(), std::exception - </Original> - <Expanded> - throwCustom(), std::exception - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - custom exception - not std - </Exception> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Custom std-exceptions can be custom translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - custom std exception - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Default scale is invisible to comparison" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 101.000001 != Approx(100).epsilon(0.01) - </Original> - <Expanded> - 101.000001 != Approx( 100.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - std::pow(10, -5) != Approx(std::pow(10, -7)) - </Original> - <Expanded> - 0.00001 != Approx( 0.0000001 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Directly creating an EnumInfo" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - enumInfo->lookup(0) == "Value1" - </Original> - <Expanded> - Value1 == "Value1" - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - enumInfo->lookup(1) == "Value2" - </Original> - <Expanded> - Value2 == "Value2" - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - enumInfo->lookup(3) == "{** unexpected enum value **}" - </Original> - <Expanded> - {** unexpected enum value **} -== -"{** unexpected enum value **}" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="EndsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), EndsWith("Substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ends with: "Substring" - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" ends with: "this" (case insensitive) - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Enums can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( EnumClass3::Value1 ) == "Value1" - </Original> - <Expanded> - "Value1" == "Value1" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( EnumClass3::Value2 ) == "Value2" - </Original> - <Expanded> - "Value2" == "Value2" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( EnumClass3::Value3 ) == "Value3" - </Original> - <Expanded> - "Value3" == "Value3" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( EnumClass3::Value4 ) == "{** unexpected enum value **}" - </Original> - <Expanded> - "{** unexpected enum value **}" -== -"{** unexpected enum value **}" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( ec3 ) == "Value2" - </Original> - <Expanded> - "Value2" == "Value2" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Enums in namespaces can quickly have stringification enabled using REGISTER_ENUM" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( Bikeshed::Colours::Red ) == "Red" - </Original> - <Expanded> - "Red" == "Red" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Original> - stringify( Bikeshed::Colours::Blue ) == "Blue" - </Original> - <Expanded> - "Blue" == "Blue" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Epsilon only applies to Approx's value" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - 101.01 != Approx(100).epsilon(0.01) - </Original> - <Expanded> - 101.01 != Approx( 100.0 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Equality checks that should fail" tags="[!mayfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven == 6 - </Original> - <Expanded> - 7 == 6 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven == 8 - </Original> - <Expanded> - 7 == 8 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven == 0 - </Original> - <Expanded> - 7 == 0 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one == Approx( 9.11f ) - </Original> - <Expanded> - 9.1f == Approx( 9.1099996567 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one == Approx( 9.0f ) - </Original> - <Expanded> - 9.1f == Approx( 9.0 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one == Approx( 1 ) - </Original> - <Expanded> - 9.1f == Approx( 1.0 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one == Approx( 0 ) - </Original> - <Expanded> - 9.1f == Approx( 0.0 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.double_pi == Approx( 3.1415 ) - </Original> - <Expanded> - 3.1415926535 == Approx( 3.1415 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello == "goodbye" - </Original> - <Expanded> - "hello" == "goodbye" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello == "hell" - </Original> - <Expanded> - "hello" == "hell" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello == "hello1" - </Original> - <Expanded> - "hello" == "hello1" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello.size() == 6 - </Original> - <Expanded> - 5 == 6 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - x == Approx( 1.301 ) - </Original> - <Expanded> - 1.3 == Approx( 1.301 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Equality checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven == 7 - </Original> - <Expanded> - 7 == 7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one == Approx( 9.1f ) - </Original> - <Expanded> - 9.1f == Approx( 9.1000003815 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.double_pi == Approx( 3.1415926535 ) - </Original> - <Expanded> - 3.1415926535 == Approx( 3.1415926535 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello == "hello" - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - "hello" == data.str_hello - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - x == Approx( 1.3 ) - </Original> - <Expanded> - 1.3 == Approx( 1.3 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Equals" tags="[matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Equals("this string contains 'abc' as a substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" equals: "this string contains 'abc' as a substring" (case insensitive) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Equals string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Equals("this string contains 'ABC' as a substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" equals: "this string contains 'ABC' as a substring" - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Equals("something else", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" equals: "something else" (case insensitive) - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Exception as a value (e.g. in REQUIRE_THROWS_MATCHES) can be stringified" tags="[exception][toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - ::Catch::Detail::stringify(WhatException{}) == "This exception has overridden what() method" - </Original> - <Expanded> - "This exception has overridden what() method" -== -"This exception has overridden what() method" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - ::Catch::Detail::stringify(OperatorException{}) == "OperatorException" - </Original> - <Expanded> - "OperatorException" == "OperatorException" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - ::Catch::Detail::stringify(StringMakerException{}) == "StringMakerException" - </Original> - <Expanded> - "StringMakerException" -== -"StringMakerException" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Exception matchers that fail" tags="[!throws][.][exceptions][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="No exception" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - doesNotThrow(), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - doesNotThrow(), SpecialException, ExceptionMatcher{1} - </Expanded> - </Expression> - <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - doesNotThrow(), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - doesNotThrow(), SpecialException, ExceptionMatcher{1} - </Expanded> - </Expression> - <OverallResults successes="0" failures="2" expectedFailures="0"/> - </Section> - <Section name="Type mismatch" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsAsInt(1), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - throwsAsInt(1), SpecialException, ExceptionMatcher{1} - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - Unknown exception - </Exception> - </Expression> - <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsAsInt(1), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - throwsAsInt(1), SpecialException, ExceptionMatcher{1} - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - Unknown exception - </Exception> - </Expression> - <OverallResults successes="0" failures="2" expectedFailures="0"/> - </Section> - <Section name="Contents are wrong" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(3), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - SpecialException::what special exception has value of 1 - </Expanded> - </Expression> - <Expression success="false" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(4), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - SpecialException::what special exception has value of 1 - </Expanded> - </Expression> - <OverallResults successes="0" failures="2" expectedFailures="0"/> - </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Exception matchers that succeed" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(1), SpecialException, ExceptionMatcher{1} - </Original> - <Expanded> - SpecialException::what special exception has value of 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(2), SpecialException, ExceptionMatcher{2} - </Original> - <Expanded> - SpecialException::what special exception has value of 2 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Exception messages can be tested for" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Section name="exact match" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), "expected exception" - </Original> - <Expanded> - "expected exception" equals: "expected exception" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="different case" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) - </Original> - <Expanded> - "expected exception" equals: "expected exception" (case insensitive) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="wildcarded" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), StartsWith( "expected" ) - </Original> - <Expanded> - "expected exception" starts with: "expected" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), EndsWith( "exception" ) - </Original> - <Expanded> - "expected exception" ends with: "exception" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), Contains( "except" ) - </Original> - <Expanded> - "expected exception" contains: "except" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) - </Original> - <Expanded> - "expected exception" contains: "except" (case insensitive) - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Exceptions matchers" tags="[!throws][exceptions][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsDerivedException(), DerivedException, Message("DerivedException::what") - </Original> - <Expanded> - DerivedException::what exception message matches "DerivedException::what" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsDerivedException(), DerivedException, !Message("derivedexception::what") - </Original> - <Expanded> - DerivedException::what not exception message matches "derivedexception::what" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(2), SpecialException, !Message("DerivedException::what") - </Original> - <Expanded> - SpecialException::what not exception message matches "DerivedException::what" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_MATCHES" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - throwsSpecialException(2), SpecialException, Message("SpecialException::what") - </Original> - <Expanded> - SpecialException::what exception message matches "SpecialException::what" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Expected exceptions that don't throw or unexpected exceptions fail the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), std::string - </Original> - <Expanded> - thisThrows(), std::string - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> - </Expression> - <Expression success="false" type="CHECK_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisDoesntThrow(), std::domain_error - </Original> - <Expanded> - thisDoesntThrow(), std::domain_error - </Expanded> - </Expression> - <Expression success="false" type="CHECK_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows() - </Original> - <Expanded> - thisThrows() - </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="FAIL aborts the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - This is a failure - </Failure> - <OverallResult success="false"/> - </TestCase> - <TestCase name="FAIL does not require an argument" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" /> - <OverallResult success="false"/> - </TestCase> - <TestCase name="FAIL_CHECK does not abort the test" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - This is a failure - </Failure> - <Warning> - This message appears in the output - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Factorials are computed" tags="[factorial]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - Factorial(0) == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - Factorial(1) == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - Factorial(2) == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - Factorial(3) == 6 - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - Factorial(10) == 3628800 - </Original> - <Expanded> - 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10., WithinRel(11.1, 0.1) - </Original> - <Expanded> - 10.0 and 11.1 are within 10% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10., !WithinRel(11.2, 0.1) - </Original> - <Expanded> - 10.0 not and 11.2 are within 10% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., !WithinRel(0., 0.99) - </Original> - <Expanded> - 1.0 not and 0 are within 99% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -0., WithinRel(0.) - </Original> - <Expanded> - -0.0 and 0 are within 2.22045e-12% of each other - </Expanded> - </Expression> - <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, WithinRel(v2) - </Original> - <Expanded> - 0.0 and 2.22507e-308 are within 2.22045e-12% of each other - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Margin" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinAbs(1., 0) - </Original> - <Expanded> - 1.0 is within 0.0 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0., WithinAbs(1., 1) - </Original> - <Expanded> - 0.0 is within 1.0 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0., !WithinAbs(1., 0.99) - </Original> - <Expanded> - 0.0 not is within 0.99 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0., !WithinAbs(1., 0.99) - </Original> - <Expanded> - 0.0 not is within 0.99 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 11., !WithinAbs(10., 0.5) - </Original> - <Expanded> - 11.0 not is within 0.5 of 10.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10., !WithinAbs(11., 0.5) - </Original> - <Expanded> - 10.0 not is within 0.5 of 11.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -10., WithinAbs(-10., 0.5) - </Original> - <Expanded> - -10.0 is within 0.5 of -10.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -10., WithinAbs(-9.6, 0.5) - </Original> - <Expanded> - -10.0 is within 0.5 of -9.6 - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="ULPs" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinULP(1., 0) - </Original> - <Expanded> - 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - nextafter(1., 2.), WithinULP(1., 1) - </Original> - <Expanded> - 1.0 is within 1 ULPs of 1.0000000000000000e+00 ([9.9999999999999989e-01, 1.0000000000000002e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0., WithinULP(nextafter(0., 1.), 1) - </Original> - <Expanded> - 0.0 is within 1 ULPs of 4.9406564584124654e-324 ([0.0000000000000000e+00, 9.8813129168249309e-324]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinULP(nextafter(1., 0.), 1) - </Original> - <Expanded> - 1.0 is within 1 ULPs of 9.9999999999999989e-01 ([9.9999999999999978e-01, 1.0000000000000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., !WithinULP(nextafter(1., 2.), 0) - </Original> - <Expanded> - 1.0 not is within 0 ULPs of 1.0000000000000002e+00 ([1.0000000000000002e+00, 1.0000000000000002e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinULP(1., 0) - </Original> - <Expanded> - 1.0 is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -0., WithinULP(0., 0) - </Original> - <Expanded> - -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00]) - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="Composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinAbs(1., 0.5) || WithinULP(2., 1) - </Original> - <Expanded> - 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1., WithinAbs(2., 0.5) || WithinULP(1., 0) - </Original> - <Expanded> - 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1) - </Original> - <Expanded> - 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Constructor validation" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinAbs(1., 0.) - </Original> - <Expanded> - WithinAbs(1., 0.) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinAbs(1., -1.), std::domain_error - </Original> - <Expanded> - WithinAbs(1., -1.), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinULP(1., 0) - </Original> - <Expanded> - WithinULP(1., 0) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1., 0.) - </Original> - <Expanded> - WithinRel(1., 0.) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1., -0.2), std::domain_error - </Original> - <Expanded> - WithinRel(1., -0.2), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1., 1.), std::domain_error - </Original> - <Expanded> - WithinRel(1., 1.), std::domain_error - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Floating point matchers: float" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10.f, WithinRel(11.1f, 0.1f) - </Original> - <Expanded> - 10.0f and 11.1 are within 10% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10.f, !WithinRel(11.2f, 0.1f) - </Original> - <Expanded> - 10.0f not and 11.2 are within 10% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, !WithinRel(0.f, 0.99f) - </Original> - <Expanded> - 1.0f not and 0 are within 99% of each other - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -0.f, WithinRel(0.f) - </Original> - <Expanded> - -0.0f and 0 are within 0.00119209% of each other - </Expanded> - </Expression> - <Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, WithinRel(v2) - </Original> - <Expanded> - 0.0f and 1.17549e-38 are within 0.00119209% of each other - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Margin" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinAbs(1.f, 0) - </Original> - <Expanded> - 1.0f is within 0.0 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.f, WithinAbs(1.f, 1) - </Original> - <Expanded> - 0.0f is within 1.0 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.f, !WithinAbs(1.f, 0.99f) - </Original> - <Expanded> - 0.0f not is within 0.9900000095 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.f, !WithinAbs(1.f, 0.99f) - </Original> - <Expanded> - 0.0f not is within 0.9900000095 of 1.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.f, WithinAbs(-0.f, 0) - </Original> - <Expanded> - 0.0f is within 0.0 of -0.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 11.f, !WithinAbs(10.f, 0.5f) - </Original> - <Expanded> - 11.0f not is within 0.5 of 10.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 10.f, !WithinAbs(11.f, 0.5f) - </Original> - <Expanded> - 10.0f not is within 0.5 of 11.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -10.f, WithinAbs(-10.f, 0.5f) - </Original> - <Expanded> - -10.0f is within 0.5 of -10.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -10.f, WithinAbs(-9.6f, 0.5f) - </Original> - <Expanded> - -10.0f is within 0.5 of -9.6000003815 - </Expanded> - </Expression> - <OverallResults successes="9" failures="0" expectedFailures="0"/> - </Section> - <Section name="ULPs" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinULP(1.f, 0) - </Original> - <Expanded> - 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - nextafter(1.f, 2.f), WithinULP(1.f, 1) - </Original> - <Expanded> - 1.0f is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.f, WithinULP(nextafter(0.f, 1.f), 1) - </Original> - <Expanded> - 0.0f is within 1 ULPs of 1.40129846e-45f ([0.00000000e+00, 2.80259693e-45]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinULP(nextafter(1.f, 0.f), 1) - </Original> - <Expanded> - 1.0f is within 1 ULPs of 9.99999940e-01f ([9.99999881e-01, 1.00000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, !WithinULP(nextafter(1.f, 2.f), 0) - </Original> - <Expanded> - 1.0f not is within 0 ULPs of 1.00000012e+00f ([1.00000012e+00, 1.00000012e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinULP(1.f, 0) - </Original> - <Expanded> - 1.0f is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - -0.f, WithinULP(0.f, 0) - </Original> - <Expanded> - -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00]) - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="Composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1) - </Original> - <Expanded> - 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0) - </Original> - <Expanded> - 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - 0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f) - </Original> - <Expanded> - 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other ) - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Constructor validation" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinAbs(1.f, 0.f) - </Original> - <Expanded> - WithinAbs(1.f, 0.f) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinAbs(1.f, -1.f), std::domain_error - </Original> - <Expanded> - WithinAbs(1.f, -1.f), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinULP(1.f, 0) - </Original> - <Expanded> - WithinULP(1.f, 0) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error - </Original> - <Expanded> - WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1.f, 0.f) - </Original> - <Expanded> - WithinRel(1.f, 0.f) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1.f, -0.2f), std::domain_error - </Original> - <Expanded> - WithinRel(1.f, -0.2f), std::domain_error - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - WithinRel(1.f, 1.f), std::domain_error - </Original> - <Expanded> - WithinRel(1.f, 1.f), std::domain_error - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Throws if there are no matching values" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - filter([] (int) {return false; }, value(1)), Catch::GeneratorException - </Original> - <Expanded> - filter([] (int) {return false; }, value(1)), Catch::GeneratorException - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i < 4 - </Original> - <Expanded> - 1 < 4 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i < 4 - </Original> - <Expanded> - 2 < 4 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortening a range" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i < 4 - </Original> - <Expanded> - 3 < 4 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Same type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i % 2 == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Transforming elements" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Different deduced type" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - i.size() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 1 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 2 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 3 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 1 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 2 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeating a generator" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j > 0 - </Original> - <Expanded> - 3 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() == chunk2.back() - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() == chunk2.back() - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Number of elements in source is divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() == chunk2.back() - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() == chunk2.back() - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() < 3 - </Original> - <Expanded> - 1 < 3 - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Number of elements in source is not divisible by chunk size" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() == chunk2.back() - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.front() < 3 - </Original> - <Expanded> - 2 < 3 - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Chunk size of zero" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk2.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Chunking a generator into sized pieces" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="Throws on too small generators" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - chunk(2, value(1)), Catch::GeneratorException - </Original> - <Expanded> - chunk(2, value(1)), Catch::GeneratorException - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Generators -- simple" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -3 < 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -2 < 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -1 < 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 4 > 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 4 > 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 4 > 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -3 < 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -2 < 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -1 < 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 8 > 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 8 > 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 8 > 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -3 < 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -2 < 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="one" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - j < i - </Original> - <Expanded> - -1 < 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 12 > 1 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 12 > 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - 4u * i > str.size() - </Original> - <Expanded> - 12 > 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Generators internals" tags="[generators][internals]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Single value" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 123 - </Original> - <Expanded> - 123 == 123 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Preset values" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Generator combinator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 4 - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <Section name="Explicitly typed generator sequence" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get().size() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == "aa" - </Original> - <Expanded> - "aa" == "aa" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == "bb" - </Original> - <Expanded> - "bb" == "bb" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == "cc" - </Original> - <Expanded> - "cc" == "cc" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="Filter generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - filter([] (int) { return false; }, value(1)), Catch::GeneratorException - </Original> - <Expanded> - filter([] (int) { return false; }, value(1)), Catch::GeneratorException - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Take less" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Take more" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Map with explicit return type" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2.0 - </Original> - <Expanded> - 2.0 == 2.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 4.0 - </Original> - <Expanded> - 4.0 == 4.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 6.0 - </Original> - <Expanded> - 6.0 == 6.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Map with deduced return type" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2.0 - </Original> - <Expanded> - 2.0 == 2.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 4.0 - </Original> - <Expanded> - 4.0 == 4.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 6.0 - </Original> - <Expanded> - 6.0 == 6.0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Singular repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Actual repeat" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="12" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="12" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -2 - </Original> - <Expanded> - -2 == -2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Negative auto step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -7 - </Original> - <Expanded> - -7 == -7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -7 - </Original> - <Expanded> - -7 == -7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -7 - </Original> - <Expanded> - -7 == -7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -1.0 == Approx( -1.0 ) - </Expanded> - </Expression> - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.9 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.9 == Approx( -0.9 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.9 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.8 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.8 == Approx( -0.8 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.8 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.7 == Approx( -0.7 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.6 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.6 == Approx( -0.6 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.6 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.5 == Approx( -0.5 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.4 == Approx( -0.4 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.3 == Approx( -0.3 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.2 == Approx( -0.2 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.1 == Approx( -0.1 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -1.38778e-16 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.0 == Approx( -0.0 ) - </Expanded> - </Expression> - <Info> - Current expected value is -1.38778e-16 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.1 == Approx( 0.1 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.2 == Approx( 0.2 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.3 == Approx( 0.3 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.4 == Approx( 0.4 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.5 == Approx( 0.5 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.6 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.6 == Approx( 0.6 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.6 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.7 == Approx( 0.7 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.8 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.8 == Approx( 0.8 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.8 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.9 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.9 == Approx( 0.9 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.9 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx( rangeEnd ) - </Original> - <Expanded> - 1.0 == Approx( 1.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="42" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="42" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="42" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="42" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -1.0 == Approx( -1.0 ) - </Expanded> - </Expression> - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.7 == Approx( -0.7 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.4 == Approx( -0.4 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.1 == Approx( -0.1 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.2 == Approx( 0.2 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.5 == Approx( 0.5 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -1.0 == Approx( -1.0 ) - </Expanded> - </Expression> - <Info> - Current expected value is -1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.7 == Approx( -0.7 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.4 == Approx( -0.4 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - -0.1 == Approx( -0.1 ) - </Expanded> - </Expression> - <Info> - Current expected value is -0.1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.2 == Approx( 0.2 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == Approx(expected) - </Original> - <Expanded> - 0.5 == Approx( 0.5 ) - </Expanded> - </Expression> - <Info> - Current expected value is 0.5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="13" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -4 - </Original> - <Expanded> - -4 == -4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.next() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - gen.get() == -7 - </Original> - <Expanded> - -7 == -7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > - <Original> - !(gen.next()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Greater-than inequalities with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d >= Approx( 1.22 ) - </Original> - <Expanded> - 1.23 >= Approx( 1.22 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d >= Approx( 1.23 ) - </Original> - <Expanded> - 1.23 >= Approx( 1.23 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - !(d >= Approx( 1.24 )) - </Original> - <Expanded> - !(1.23 >= Approx( 1.24 )) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d >= Approx( 1.24 ).epsilon(0.1) - </Original> - <Expanded> - 1.23 >= Approx( 1.24 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this is a message - </Info> - <Warning> - this is a warning - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="INFO gets logged on failure" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this message should be logged - </Info> - <Info> - so should this - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - a == 1 - </Original> - <Expanded> - 2 == 1 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="INFO gets logged on failure, even if captured before successful assertions" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this message may be logged later - </Info> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - a == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Info> - this message may be logged later - </Info> - <Info> - this message should be logged - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - a == 1 - </Original> - <Expanded> - 2 == 1 - </Expanded> - </Expression> - <Info> - this message may be logged later - </Info> - <Info> - this message should be logged - </Info> - <Info> - and this, but later - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - a == 0 - </Original> - <Expanded> - 2 == 0 - </Expanded> - </Expression> - <Info> - this message may be logged later - </Info> - <Info> - this message should be logged - </Info> - <Info> - and this, but later - </Info> - <Info> - but not this - </Info> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - a == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="INFO is reset for each loop" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - current counter 0 - </Info> - <Info> - i := 0 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 0 < 10 - </Expanded> - </Expression> - <Info> - current counter 1 - </Info> - <Info> - i := 1 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 1 < 10 - </Expanded> - </Expression> - <Info> - current counter 2 - </Info> - <Info> - i := 2 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 2 < 10 - </Expanded> - </Expression> - <Info> - current counter 3 - </Info> - <Info> - i := 3 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 3 < 10 - </Expanded> - </Expression> - <Info> - current counter 4 - </Info> - <Info> - i := 4 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 4 < 10 - </Expanded> - </Expression> - <Info> - current counter 5 - </Info> - <Info> - i := 5 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 5 < 10 - </Expanded> - </Expression> - <Info> - current counter 6 - </Info> - <Info> - i := 6 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 6 < 10 - </Expanded> - </Expression> - <Info> - current counter 7 - </Info> - <Info> - i := 7 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 7 < 10 - </Expanded> - </Expression> - <Info> - current counter 8 - </Info> - <Info> - i := 8 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 8 < 10 - </Expanded> - </Expression> - <Info> - current counter 9 - </Info> - <Info> - i := 9 - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 9 < 10 - </Expanded> - </Expression> - <Info> - current counter 10 - </Info> - <Info> - i := 10 - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - i < 10 - </Original> - <Expanded> - 10 < 10 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Inequality checks that should fail" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven != 7 - </Original> - <Expanded> - 7 != 7 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one != Approx( 9.1f ) - </Original> - <Expanded> - 9.1f != Approx( 9.1000003815 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.double_pi != Approx( 3.1415926535 ) - </Original> - <Expanded> - 3.1415926535 != Approx( 3.1415926535 ) - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello != "hello" - </Original> - <Expanded> - "hello" != "hello" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello.size() != 5 - </Original> - <Expanded> - 5 != 5 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Inequality checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven != 6 - </Original> - <Expanded> - 7 != 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven != 8 - </Original> - <Expanded> - 7 != 8 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one != Approx( 9.11f ) - </Original> - <Expanded> - 9.1f != Approx( 9.1099996567 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one != Approx( 9.0f ) - </Original> - <Expanded> - 9.1f != Approx( 9.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one != Approx( 1 ) - </Original> - <Expanded> - 9.1f != Approx( 1.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one != Approx( 0 ) - </Original> - <Expanded> - 9.1f != Approx( 0.0 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.double_pi != Approx( 3.1415 ) - </Original> - <Expanded> - 3.1415926535 != Approx( 3.1415 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello != "goodbye" - </Original> - <Expanded> - "hello" != "goodbye" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello != "hell" - </Original> - <Expanded> - "hello" != "hell" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello != "hello1" - </Original> - <Expanded> - "hello" != "hello1" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello.size() != 6 - </Original> - <Expanded> - 5 != 6 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Lambdas in assertions" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <Original> - []() { return true; }() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d <= Approx( 1.24 ) - </Original> - <Expanded> - 1.23 <= Approx( 1.24 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d <= Approx( 1.23 ) - </Original> - <Expanded> - 1.23 <= Approx( 1.23 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - !(d <= Approx( 1.22 )) - </Original> - <Expanded> - !(1.23 <= Approx( 1.22 )) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d <= Approx( 1.22 ).epsilon(0.1) - </Original> - <Expanded> - 1.23 <= Approx( 1.22 ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="ManuallyRegistered" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("string") && Contains("abc") && Contains("substring") && Contains("contains") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("string") || Contains("different") || Contains("random") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching2(), Contains("string") || Contains("different") || Contains("random") - </Original> - <Expanded> - "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be composed with both && and ||" tags="[matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be composed with both && and || - failing" tags="[.][failing][matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), !Contains("different") - </Original> - <Expanded> - "this string contains 'abc' as a substring" not contains: "different" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[.][failing][matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), !Contains("substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" not contains: "substring" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), "expected exception" - </Original> - <Expanded> - "expected exception" equals: "expected exception" - </Expanded> - </Expression> - <Expression success="false" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Original> - thisThrows(), "should fail" - </Original> - <Expanded> - "expected exception" equals: "should fail" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Nested generators and captured variables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 3 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 4 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 5 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 6 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - -5 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - -4 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 90 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 91 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 92 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 93 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 94 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 95 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 96 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 97 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 98 > -6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Original> - values > -6 - </Original> - <Expanded> - 99 > -6 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Nice descriptive name" tags="[.][tag1][tag2][tag3]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Warning> - This one ran - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Non-std exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - custom exception - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Objects that evaluated in boolean contexts can be checked" tags="[SafeBool][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - True - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !False - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - !(False) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Optionally static assertions" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Ordering comparison checks that should fail" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven > 7 - </Original> - <Expanded> - 7 > 7 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven < 7 - </Original> - <Expanded> - 7 < 7 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven > 8 - </Original> - <Expanded> - 7 > 8 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven < 6 - </Original> - <Expanded> - 7 < 6 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven < 0 - </Original> - <Expanded> - 7 < 0 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven < -1 - </Original> - <Expanded> - 7 < -1 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven >= 8 - </Original> - <Expanded> - 7 >= 8 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven <= 6 - </Original> - <Expanded> - 7 <= 6 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one < 9 - </Original> - <Expanded> - 9.1f < 9 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one > 10 - </Original> - <Expanded> - 9.1f > 10 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one > 9.2 - </Original> - <Expanded> - 9.1f > 9.2 - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello > "hello" - </Original> - <Expanded> - "hello" > "hello" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello < "hello" - </Original> - <Expanded> - "hello" < "hello" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello > "hellp" - </Original> - <Expanded> - "hello" > "hellp" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello > "z" - </Original> - <Expanded> - "hello" > "z" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello < "hellm" - </Original> - <Expanded> - "hello" < "hellm" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello < "a" - </Original> - <Expanded> - "hello" < "a" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello >= "z" - </Original> - <Expanded> - "hello" >= "z" - </Expanded> - </Expression> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello <= "a" - </Original> - <Expanded> - "hello" <= "a" - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Ordering comparison checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven < 8 - </Original> - <Expanded> - 7 < 8 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven > 6 - </Original> - <Expanded> - 7 > 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven > 0 - </Original> - <Expanded> - 7 > 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven > -1 - </Original> - <Expanded> - 7 > -1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven >= 7 - </Original> - <Expanded> - 7 >= 7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven >= 6 - </Original> - <Expanded> - 7 >= 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven <= 7 - </Original> - <Expanded> - 7 <= 7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.int_seven <= 8 - </Original> - <Expanded> - 7 <= 8 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one > 9 - </Original> - <Expanded> - 9.1f > 9 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one < 10 - </Original> - <Expanded> - 9.1f < 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.float_nine_point_one < 9.2 - </Original> - <Expanded> - 9.1f < 9.2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello <= "hello" - </Original> - <Expanded> - "hello" <= "hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello >= "hello" - </Original> - <Expanded> - "hello" >= "hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello < "hellp" - </Original> - <Expanded> - "hello" < "hellp" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello < "zebra" - </Original> - <Expanded> - "hello" < "zebra" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello > "hellm" - </Original> - <Expanded> - "hello" > "hellm" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - data.str_hello > "a" - </Original> - <Expanded> - "hello" > "a" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Our PCG implementation provides expected results for known seeds" tags="[rng]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Section name="Default seeded" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 4242248763 (0x<hex digits>) -== -4242248763 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1867888929 (0x<hex digits>) -== -1867888929 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1276619030 (0x<hex digits>) -== -1276619030 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1911218783 (0x<hex digits>) -== -1911218783 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1827115164 (0x<hex digits>) -== -1827115164 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Specific seed" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1472234645 (0x<hex digits>) -== -1472234645 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 868832940 (0x<hex digits>) -== -868832940 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 570883446 (0x<hex digits>) -== -570883446 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 889299803 (0x<hex digits>) -== -889299803 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 4261393167 (0x<hex digits>) -== -4261393167 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 1472234645 (0x<hex digits>) -== -1472234645 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 868832940 (0x<hex digits>) -== -868832940 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 570883446 (0x<hex digits>) -== -570883446 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 889299803 (0x<hex digits>) -== -889299803 (0x<hex digits>) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > - <Original> - rng() == 0x<hex digits> - </Original> - <Expanded> - 4261393167 (0x<hex digits>) -== -4261393167 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="10" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Output from all sections is reported" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - Message from section one - </Failure> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - Message from section two - </Failure> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Overloaded comma or address-of operators are not used" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - (EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed - </Original> - <Expanded> - (EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - &EvilMatcher(), EvilAddressOfOperatorUsed - </Original> - <Expanded> - &EvilMatcher(), EvilAddressOfOperatorUsed - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - EvilMatcher() || (EvilMatcher() && !EvilMatcher()) - </Original> - <Expanded> - EvilMatcher() || (EvilMatcher() && !EvilMatcher()) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - (EvilMatcher() && EvilMatcher()) || !EvilMatcher() - </Original> - <Expanded> - (EvilMatcher() && EvilMatcher()) || !EvilMatcher() - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Parse test names and tags" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Empty test spec should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Test spec from empty string should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Test spec from just a comma should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Test spec from name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Test spec from quoted name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Test spec from name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Wildcard at the start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - parseTestSpec( "*a" ).matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Wildcard at the end" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - parseTestSpec( "a*" ).matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Wildcard at both ends" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - parseTestSpec( "*a*" ).matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Redundant wildcard at the start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Redundant wildcard at the end" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Redundant wildcard at both ends" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Wildcard at both ends, redundant at start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Just wildcard" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Single tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Single tag, two matches" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Two tags" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Two tags, spare separated" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Wildcarded name and tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Single tag exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="One tag exclusion and one tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="One tag exclusion and one wldcarded name inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="One tag exclusion, using exclude:, and one wldcarded name inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="name exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="wildcarded name exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="wildcarded name exclusion with tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="wildcarded name exclusion, using exclude:, with tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="two wildcarded names" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="empty tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="empty quoted name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="quoted string followed by tag exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.hasFilters() == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcA ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcB ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcC ) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *tcD ) == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Leading and trailing spaces in test spec" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark" ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( "aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( "aardvark" ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Leading and trailing spaces in test name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark" ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( " aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( "aardvark " ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches( *fakeTestCase( "aardvark" ) ) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortened hide tags are split apart when parsing" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches(*fakeTestCase("hidden and foo", "[.][foo]")) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(spec.matches(*fakeTestCase("only foo", "[foo]"))) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortened hide tags also properly handle exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(spec.matches(*fakeTestCase("hidden and foo", "[.][foo]"))) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(spec.matches(*fakeTestCase("only foo", "[foo]"))) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(spec.matches(*fakeTestCase("only hidden", "[.]"))) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - spec.matches(*fakeTestCase("neither foo nor hidden", "[bar]")) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Pointers can be compared to null" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - p == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - p == pNULL - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - p != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - cp != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - cpc != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - returnsNull() == 0 - </Original> - <Expanded> - {null string} == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - returnsConstNull() == 0 - </Original> - <Expanded> - {null string} == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - 0 != p - </Original> - <Expanded> - 0 != 0x<hex digits> - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Precision of floating point stringification can be set" tags="[floatingPoint][toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="Floats" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - str1.size() == 3 + 5 - </Original> - <Expanded> - 8 == 8 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - str2.size() == 3 + 10 - </Original> - <Expanded> - 13 == 13 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Double" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - str1.size() == 2 + 5 - </Original> - <Expanded> - 7 == 7 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - str2.size() == 2 + 15 - </Original> - <Expanded> - 17 == 17 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Predicate matcher can accept const char*" tags="[compilation][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - "foo", Predicate<const char*>([] (const char* const&) { return true; }) - </Original> - <Expanded> - "foo" matches undescribed predicate - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Process can be configured on command line" tags="[command-line][config]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="empty args don't cause a crash" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.processName == "" - </Original> - <Expanded> - "" == "" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="default - no arguments" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.processName == "test" - </Original> - <Expanded> - "test" == "test" - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.shouldDebugBreak == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.abortAfter == -1 - </Original> - <Expanded> - -1 == -1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.noThrow == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.reporterName == "console" - </Original> - <Expanded> - "console" == "console" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(cfg.hasTestFilters()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.hasTestFilters() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("test1")) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Specify one test case exclusion using exclude:" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.hasTestFilters() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("test1")) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Specify one test case exclusion using ~" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.hasTestFilters() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("test1")) == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-r/console" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-r", "console"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.reporterName == "console" - </Original> - <Expanded> - "console" == "console" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-r/xml" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-r", "xml"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.reporterName == "xml" - </Original> - <Expanded> - "xml" == "xml" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="--reporter/junit" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--reporter", "junit"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.reporterName == "junit" - </Original> - <Expanded> - "junit" == "junit" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Only one reporter is accepted" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="must match one of the available ones" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !result - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result.errorMessage(), Contains("Unrecognized reporter") - </Original> - <Expanded> - "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="debugger" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-b" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-b"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.shouldDebugBreak == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="debugger" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="--break" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--break"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.shouldDebugBreak - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-a aborts after first failure" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-a"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.abortAfter == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-x 2 aborts after two failures" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-x", "2"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.abortAfter == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-x must be numeric" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !result - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result.errorMessage(), Contains("convert") && Contains("oops") - </Original> - <Expanded> - "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.waitForKeypress == std::get<1>(input) - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.waitForKeypress == std::get<1>(input) - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.waitForKeypress == std::get<1>(input) - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.waitForKeypress == std::get<1>(input) - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="invalid options are reported" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !result - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result.errorMessage(), Contains("never") && Contains("both") - </Original> - <Expanded> - "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-e" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-e"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.noThrow - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="--nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--nothrow"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.noThrow - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="output filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="-o filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-o", "filename.ext"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.outputFilename == "filename.ext" - </Original> - <Expanded> - "filename.ext" == "filename.ext" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="output filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="--out" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--out", "filename.ext"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.outputFilename == "filename.ext" - </Original> - <Expanded> - "filename.ext" == "filename.ext" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="combinations" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="Single character flags can be combined" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "-abe"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.abortAfter == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.shouldDebugBreak - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.noThrow == true - </Original> - <Expanded> - true == true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="without option" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.useColour == UseColour::Auto - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="auto" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--use-colour", "auto"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.useColour == UseColour::Auto - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="yes" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--use-colour", "yes"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.useColour == UseColour::Yes - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="no" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({"test", "--use-colour", "no"}) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.useColour == UseColour::No - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - !result - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - result.errorMessage(), Contains( "colour mode must be one of" ) - </Original> - <Expanded> - "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="samples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({ "test", "--benchmark-samples=200" }) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.benchmarkSamples == 200 - </Original> - <Expanded> - 200 == 200 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="resamples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({ "test", "--benchmark-resamples=20000" }) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.benchmarkResamples == 20000 - </Original> - <Expanded> - 20000 (0x<hex digits>) == 20000 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="confidence-interval" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.benchmarkConfidenceInterval == Catch::Approx(0.99) - </Original> - <Expanded> - 0.99 == Approx( 0.99 ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="no-analysis" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({ "test", "--benchmark-no-analysis" }) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.benchmarkNoAnalysis - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Section name="warmup-time" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - cli.parse({ "test", "--benchmark-warmup-time=10" }) - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <Original> - config.benchmarkWarmupTime == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 - </Original> - <Expanded> - 3 >= 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 - </Original> - <Expanded> - 2 >= 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 - </Original> - <Expanded> - 1 >= 1 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - Catch::Detail::stringify(UsesSentinel{}) == "{ }" - </Original> - <Expanded> - "{ }" == "{ }" - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Reconstruction should be based on stringification: #914" tags="[.][Decomposition][failing]" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > - <Original> - truthy(false) - </Original> - <Expanded> - Hey, its truthy! - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Regex string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Matches("this STRING contains 'abc' as a substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Matches("contains 'abc' as a substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Matches("this string contains 'abc' as a") - </Original> - <Expanded> - "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Regression test #1" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - actual, !UnorderedEquals(expected) - </Original> - <Expanded> - { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: automake - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: automake - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: automake - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="compact reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: compact - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="compact reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: compact - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="compact reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: compact - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="console reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: console - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="console reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: console - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="console reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: console - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="junit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: junit - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="junit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: junit - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="junit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: junit - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="sonarqube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: sonarqube - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="sonarqube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: sonarqube - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="sonarqube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: sonarqube - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="tap reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: tap - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="tap reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: tap - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="tap reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: tap - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="teamcity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: teamcity - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="teamcity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: teamcity - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="teamcity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: teamcity - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="xml reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: xml - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fakeTag"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -<TagsFromMatchingTests> - <Tag> - <Count>1</Count> - <Aliases> - <Alias>fakeTag</Alias> - </Aliases> - </Tag> -</TagsFromMatchingTests>" contains: "fakeTag" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="xml reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: xml - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains("fake reporter"s) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -<AvailableReporters> - <Reporter> - <Name>fake reporter</Name> - <Description>fake description</Description> - </Reporter> -</AvailableReporters>" contains: "fake reporter" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - !(factories.empty()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Section name="xml reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Info> - Tested reporter: xml - </Info> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) - </Original> - <Expanded> - "<?xml version="1.0" encoding="UTF-8"?> -<MatchingTests> - <TestCase> - <Name>fake test name</Name> - <ClassName/> - <Tags>[fakeTestTag]</Tags> - <SourceInfo> - <File>fake-file.cpp</File> - <Line>123456789</Line> - </SourceInfo> - </TestCase> -</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="SUCCEED does not require an argument" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods" tags="[bdd][fixtures]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Given: No operations precede me" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - before == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Section name="When: We get the count" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: Subsequently values are higher" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - after > before - </Original> - <Expanded> - 1 > 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Scenario: Do that thing with the thing" tags="[Tags]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Given: This stuff exists" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="And given: And some assumption" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="When: I do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: it should do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - itDoesThis() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="And: do that" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - itDoesThat() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" tags="[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter][long][lots][one very long tag name that should cause line wrapping writing out using the list command][tags][verbose][very long tags]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Given: A section name that is so long that it cannot fit in a single console width" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="When: The test headers are printed as part of the normal running of the scenario" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Scenario: Vector resizing affects size and capacity" tags="[bdd][capacity][size][vector]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Given: an empty vector" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Section name="When: it is made larger" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: the size and capacity go up" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <Section name="And when: it is made smaller again" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: the size goes down but the capacity stays the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Given: an empty vector" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Section name="When: we reserve more space" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Section name="Then: The capacity is increased but the size remains the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Sends stuff to stdout and stderr" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"> - <StdOut> -A string sent directly to stdout - </StdOut> - <StdErr> -A string sent directly to stderr -A string sent to stderr via clog - </StdErr> - </OverallResult> - </TestCase> - <TestCase name="Some simple comparisons between doubles" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d == Approx( 1.23 ) - </Original> - <Expanded> - 1.23 == Approx( 1.23 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d != Approx( 1.22 ) - </Original> - <Expanded> - 1.23 != Approx( 1.22 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d != Approx( 1.24 ) - </Original> - <Expanded> - 1.23 != Approx( 1.24 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d == 1.23_a - </Original> - <Expanded> - 1.23 == Approx( 1.23 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - d != 1.22_a - </Original> - <Expanded> - 1.23 != Approx( 1.22 ) - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx( d ) == 1.23 - </Original> - <Expanded> - Approx( 1.23 ) == 1.23 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx( d ) != 1.22 - </Original> - <Expanded> - Approx( 1.23 ) != 1.22 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Original> - Approx( d ) != 1.24 - </Original> - <Expanded> - Approx( 1.23 ) != 1.24 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Standard output from all sections is reported" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="two" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <OverallResult success="false"> - <StdOut> -Message from section one -Message from section two - </StdOut> - </OverallResult> - </TestCase> - <TestCase name="StartsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), StartsWith("This String") - </Original> - <Expanded> - "this string contains 'abc' as a substring" starts with: "This String" - </Expanded> - </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" starts with: "string" (case insensitive) - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Static arrays are convertible to string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="Single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify(singular) == "{ 1 }" - </Original> - <Expanded> - "{ 1 }" == "{ 1 }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Multiple" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" - </Original> - <Expanded> - "{ 3, 2, 1 }" == "{ 3, 2, 1 }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Non-trivial inner items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" - </Original> - <Expanded> - "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" -== -"{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="String matchers" tags="[matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("string") - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "string" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("string", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "string" (case insensitive) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("abc") - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "abc" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" contains: "abc" (case insensitive) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), StartsWith("this") - </Original> - <Expanded> - "this string contains 'abc' as a substring" starts with: "this" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" starts with: "this" (case insensitive) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), EndsWith("substring") - </Original> - <Expanded> - "this string contains 'abc' as a substring" ends with: "substring" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No) - </Original> - <Expanded> - "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="StringRef" tags="[StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Empty string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - empty.empty() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - empty.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - empty.isNullTerminated() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - std::strcmp( empty.c_str(), "" ) == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="From string literal" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.empty() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.isNullTerminated() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - std::strcmp( rawChars, "hello" ) == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.c_str() - </Original> - <Expanded> - s.c_str() - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.c_str() == rawChars - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.data() == rawChars - </Original> - <Expanded> - "hello" == "hello" - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="From sub-string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - original == "original" - </Original> - <Expanded> - original == "original" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - !(original.isNullTerminated()) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - original.c_str() - </Original> - <Expanded> - original.c_str() - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - original.data() - </Original> - <Expanded> - original.data() - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - ss.empty() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - ss.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - std::strncmp( ss.data(), "hello", 5 ) == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - ss == "hello" - </Original> - <Expanded> - hello == "hello" - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="non-zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - ss.size() == 6 - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - std::strcmp( ss.c_str(), "world!" ) == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Pointer values of full refs should match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.data() == s2.data() - </Original> - <Expanded> - "hello world!" == "hello world!" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Pointer values of substring refs should also match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.data() == ss.data() - </Original> - <Expanded> - "hello world!" == "hello world!" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Past the end substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.substr(s.size() + 1, 123).empty() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Substring off the end are trimmed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - std::strcmp(ss.c_str(), "world!") == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="substring start after the end is empty" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - s.substr(1'000'000, 1).empty() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -1.0 == Approx( -1.0 ) + </Expanded> + </Expression> + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.9 == Approx( -0.9 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.8 == Approx( -0.8 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.7 == Approx( -0.7 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.6 == Approx( -0.6 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.5 == Approx( -0.5 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.4 == Approx( -0.4 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.3 == Approx( -0.3 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.2 == Approx( -0.2 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.1 == Approx( -0.1 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -1.38778e-16 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.0 == Approx( -0.0 ) + </Expanded> + </Expression> + <Info> + Current expected value is -1.38778e-16 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.1 == Approx( 0.1 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.2 == Approx( 0.2 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.3 == Approx( 0.3 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.4 == Approx( 0.4 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.5 == Approx( 0.5 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.6 == Approx( 0.6 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.7 == Approx( 0.7 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.8 == Approx( 0.8 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.9 == Approx( 0.9 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx( rangeEnd ) + </Original> + <Expanded> + 1.0 == Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="42" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="42" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Comparisons are deep" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) - </Original> - <Expanded> - "Hello" != "Hello" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - left == right - </Original> - <Expanded> - Hello == Hello - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - left != left.substr(0, 3) - </Original> - <Expanded> - Hello != Hel - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="42" failures="0" expectedFailures="0"/> </Section> - <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="implicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr == "a standard string" - </Original> - <Expanded> - a standard string == "a standard string" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr.size() == stdStr.size() - </Original> - <Expanded> - 17 == 17 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="42" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -1.0 == Approx( -1.0 ) + </Expanded> + </Expression> + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.7 == Approx( -0.7 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.4 == Approx( -0.4 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.1 == Approx( -0.1 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.2 == Approx( 0.2 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.5 == Approx( 0.5 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="13" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="13" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="13" failures="0" expectedFailures="0"/> </Section> - <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr == "a standard string" - </Original> - <Expanded> - a standard string == "a standard string" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr.size() == stdStr.size() - </Original> - <Expanded> - 17 == 17 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="13" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Positive manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Floating Point" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -1.0 == Approx( -1.0 ) + </Expanded> + </Expression> + <Info> + Current expected value is -1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.7 == Approx( -0.7 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.4 == Approx( -0.4 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + -0.1 == Approx( -0.1 ) + </Expanded> + </Expression> + <Info> + Current expected value is -0.1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.2 == Approx( 0.2 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == Approx(expected) + </Original> + <Expanded> + 0.5 == Approx( 0.5 ) + </Expanded> + </Expression> + <Info> + Current expected value is 0.5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="13" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="13" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="13" failures="0" expectedFailures="0"/> </Section> - <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr == "a standard string" - </Original> - <Expanded> - a standard string == "a standard string" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - sr.size() == stdStr.size() - </Original> - <Expanded> - 17 == 17 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="13" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Exact" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr == "a stringref" - </Original> - <Expanded> - "a stringref" == "a stringref" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr.size() == sr.size() - </Original> - <Expanded> - 11 == 11 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly over end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> </Section> - <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr == "a stringref" - </Original> - <Expanded> - "a stringref" == "a stringref" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - stdStr.size() == sr.size() - </Original> - <Expanded> - 11 == 11 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Range" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Negative manual step" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Integer" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Section name="Slightly under end" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -1 + </Original> + <Expanded> + -1 == -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -4 + </Original> + <Expanded> + -4 == -4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.next() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + gen.get() == -7 + </Original> + <Expanded> + -7 == -7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" > + <Original> + !(gen.next()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="10" failures="0" expectedFailures="0"/> </Section> - <Section name="std::string += StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - lhs == "some string += the stringref contents" - </Original> - <Expanded> - "some string += the stringref contents" + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Greater-than inequalities with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d >= Approx( 1.22 ) + </Original> + <Expanded> + 1.23 >= Approx( 1.22 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d >= Approx( 1.23 ) + </Original> + <Expanded> + 1.23 >= Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + !(d >= Approx( 1.24 )) + </Original> + <Expanded> + !(1.23 >= Approx( 1.24 )) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d >= Approx( 1.24 ).epsilon(0.1) + </Original> + <Expanded> + 1.23 >= Approx( 1.24 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this is a message + </Info> + <Warning> + this is a warning + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="INFO gets logged on failure" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this message should be logged + </Info> + <Info> + so should this + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + a == 1 + </Original> + <Expanded> + 2 == 1 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="INFO gets logged on failure, even if captured before successful assertions" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this message may be logged later + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + a == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Info> + this message may be logged later + </Info> + <Info> + this message should be logged + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + a == 1 + </Original> + <Expanded> + 2 == 1 + </Expanded> + </Expression> + <Info> + this message may be logged later + </Info> + <Info> + this message should be logged + </Info> + <Info> + and this, but later + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + a == 0 + </Original> + <Expanded> + 2 == 0 + </Expanded> + </Expression> + <Info> + this message may be logged later + </Info> + <Info> + this message should be logged + </Info> + <Info> + and this, but later + </Info> + <Info> + but not this + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + a == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="INFO is reset for each loop" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + current counter 0 + </Info> + <Info> + i := 0 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 0 < 10 + </Expanded> + </Expression> + <Info> + current counter 1 + </Info> + <Info> + i := 1 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 1 < 10 + </Expanded> + </Expression> + <Info> + current counter 2 + </Info> + <Info> + i := 2 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 2 < 10 + </Expanded> + </Expression> + <Info> + current counter 3 + </Info> + <Info> + i := 3 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 3 < 10 + </Expanded> + </Expression> + <Info> + current counter 4 + </Info> + <Info> + i := 4 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 4 < 10 + </Expanded> + </Expression> + <Info> + current counter 5 + </Info> + <Info> + i := 5 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 5 < 10 + </Expanded> + </Expression> + <Info> + current counter 6 + </Info> + <Info> + i := 6 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 6 < 10 + </Expanded> + </Expression> + <Info> + current counter 7 + </Info> + <Info> + i := 7 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 7 < 10 + </Expanded> + </Expression> + <Info> + current counter 8 + </Info> + <Info> + i := 8 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 8 < 10 + </Expanded> + </Expression> + <Info> + current counter 9 + </Info> + <Info> + i := 9 + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 9 < 10 + </Expanded> + </Expression> + <Info> + current counter 10 + </Info> + <Info> + i := 10 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + i < 10 + </Original> + <Expanded> + 10 < 10 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Inequality checks that should fail" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 7 + </Original> + <Expanded> + 7 != 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one != Approx( 9.1f ) + </Original> + <Expanded> + 9.1f != Approx( 9.1000003815 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.double_pi != Approx( 3.1415926535 ) + </Original> + <Expanded> + 3.1415926535 != Approx( 3.1415926535 ) + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hello" + </Original> + <Expanded> + "hello" != "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() != 5 + </Original> + <Expanded> + 5 != 5 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Inequality checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 6 + </Original> + <Expanded> + 7 != 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven != 8 + </Original> + <Expanded> + 7 != 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one != Approx( 9.11f ) + </Original> + <Expanded> + 9.1f != Approx( 9.1099996567 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one != Approx( 9.0f ) + </Original> + <Expanded> + 9.1f != Approx( 9.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one != Approx( 1 ) + </Original> + <Expanded> + 9.1f != Approx( 1.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one != Approx( 0 ) + </Original> + <Expanded> + 9.1f != Approx( 0.0 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.double_pi != Approx( 3.1415 ) + </Original> + <Expanded> + 3.1415926535 != Approx( 3.1415 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "goodbye" + </Original> + <Expanded> + "hello" != "goodbye" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hell" + </Original> + <Expanded> + "hello" != "hell" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello != "hello1" + </Original> + <Expanded> + "hello" != "hello1" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello.size() != 6 + </Original> + <Expanded> + 5 != 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Lambdas in assertions" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + []() { return true; }() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Less-than inequalities with different epsilons" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.24 ) + </Original> + <Expanded> + 1.23 <= Approx( 1.24 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.23 ) + </Original> + <Expanded> + 1.23 <= Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + !(d <= Approx( 1.22 )) + </Original> + <Expanded> + !(1.23 <= Approx( 1.22 )) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d <= Approx( 1.22 ).epsilon(0.1) + </Original> + <Expanded> + 1.23 <= Approx( 1.22 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="ManuallyRegistered" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "string" ) && Contains( "abc" ) && Contains( "substring" ) && Contains( "contains" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be (AnyOf) composed with the || operator" tags="[matchers][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching2(), Contains( "string" ) || Contains( "different" ) || Contains( "random" ) + </Original> + <Expanded> + "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be composed with both && and ||" tags="[matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "substring" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be composed with both && and || - failing" tags="[.][failing][matchers][operator&&][operators][operator||]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ( ( contains: "string" or contains: "different" ) and contains: "random" ) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Matchers can be negated (Not) with the ! operator" tags="[matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !Contains( "different" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" not contains: "different" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Matchers can be negated (Not) with the ! operator - failing" tags="[.][failing][matchers][not][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), !Contains( "substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" not contains: "substring" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Mismatching exception messages failing the test" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), "expected exception" + </Original> + <Expanded> + "expected exception" equals: "expected exception" + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE_THROWS_WITH" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), "should fail" + </Original> + <Expanded> + "expected exception" equals: "should fail" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Nested generators and captured variables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 3 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 6 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -5 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + -4 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 90 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 91 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 92 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 93 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 94 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 95 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 96 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 97 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 98 > -6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + values > -6 + </Original> + <Expanded> + 99 > -6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Nice descriptive name" tags="[.][tag1][tag2][tag3]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Warning> + This one ran + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Non-std exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + custom exception + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Objects that evaluated in boolean contexts can be checked" tags="[SafeBool][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + True + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !False + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + !(False) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Optionally static assertions" tags="[compilation]" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Ordering comparison checks that should fail" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 7 + </Original> + <Expanded> + 7 > 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 7 + </Original> + <Expanded> + 7 < 7 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 8 + </Original> + <Expanded> + 7 > 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 6 + </Original> + <Expanded> + 7 < 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 0 + </Original> + <Expanded> + 7 < 0 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < -1 + </Original> + <Expanded> + 7 < -1 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 8 + </Original> + <Expanded> + 7 >= 8 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 6 + </Original> + <Expanded> + 7 <= 6 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 9 + </Original> + <Expanded> + 9.1f < 9 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one > 10 + </Original> + <Expanded> + 9.1f > 10 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one > 9.2 + </Original> + <Expanded> + 9.1f > 9.2 + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hello" + </Original> + <Expanded> + "hello" > "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hello" + </Original> + <Expanded> + "hello" < "hello" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hellp" + </Original> + <Expanded> + "hello" > "hellp" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "z" + </Original> + <Expanded> + "hello" > "z" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hellm" + </Original> + <Expanded> + "hello" < "hellm" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "a" + </Original> + <Expanded> + "hello" < "a" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello >= "z" + </Original> + <Expanded> + "hello" >= "z" + </Expanded> + </Expression> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello <= "a" + </Original> + <Expanded> + "hello" <= "a" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Ordering comparison checks that should succeed" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven < 8 + </Original> + <Expanded> + 7 < 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 6 + </Original> + <Expanded> + 7 > 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > 0 + </Original> + <Expanded> + 7 > 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven > -1 + </Original> + <Expanded> + 7 > -1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 7 + </Original> + <Expanded> + 7 >= 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven >= 6 + </Original> + <Expanded> + 7 >= 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 7 + </Original> + <Expanded> + 7 <= 7 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.int_seven <= 8 + </Original> + <Expanded> + 7 <= 8 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one > 9 + </Original> + <Expanded> + 9.1f > 9 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 10 + </Original> + <Expanded> + 9.1f < 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.float_nine_point_one < 9.2 + </Original> + <Expanded> + 9.1f < 9.2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello <= "hello" + </Original> + <Expanded> + "hello" <= "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello >= "hello" + </Original> + <Expanded> + "hello" >= "hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "hellp" + </Original> + <Expanded> + "hello" < "hellp" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello < "zebra" + </Original> + <Expanded> + "hello" < "zebra" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "hellm" + </Original> + <Expanded> + "hello" > "hellm" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + data.str_hello > "a" + </Original> + <Expanded> + "hello" > "a" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Our PCG implementation provides expected results for known seeds" tags="[rng]" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Section name="Default seeded" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 4242248763 (0x<hex digits>) +== +4242248763 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1867888929 (0x<hex digits>) +== +1867888929 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1276619030 (0x<hex digits>) +== +1276619030 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1911218783 (0x<hex digits>) +== +1911218783 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1827115164 (0x<hex digits>) +== +1827115164 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Specific seed" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1472234645 (0x<hex digits>) +== +1472234645 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 868832940 (0x<hex digits>) +== +868832940 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 570883446 (0x<hex digits>) +== +570883446 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 889299803 (0x<hex digits>) == -"some string += the stringref contents" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="StringRef + StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Original> - together == "abrakadabra" - </Original> - <Expanded> - "abrakadabra" == "abrakadabra" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="StringRef at compilation time" tags="[constexpr][StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <Section name="Simple constructors" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <OverallResults successes="15" failures="0" expectedFailures="0"/> - </Section> - <Section name="UDL construction" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > +889299803 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 4261393167 (0x<hex digits>) +== +4261393167 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 1472234645 (0x<hex digits>) +== +1472234645 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 868832940 (0x<hex digits>) +== +868832940 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 570883446 (0x<hex digits>) +== +570883446 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 889299803 (0x<hex digits>) +== +889299803 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/RandomNumberGeneration.tests.cpp" > + <Original> + rng() == 0x<hex digits> + </Original> + <Expanded> + 4261393167 (0x<hex digits>) +== +4261393167 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Output from all sections is reported" tags="[.][failing][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + Message from section one + </Failure> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + Message from section two + </Failure> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Overloaded comma or address-of operators are not used" tags="[matchers][templated]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed + </Original> + <Expanded> + ( EvilMatcher(), EvilMatcher() ), EvilCommaOperatorUsed + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + &EvilMatcher(), EvilAddressOfOperatorUsed + </Original> + <Expanded> + &EvilMatcher(), EvilAddressOfOperatorUsed + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) + </Original> + <Expanded> + EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() + </Original> + <Expanded> + ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Parse test names and tags" tags="[command-line][test-spec]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Empty test spec should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Test spec from empty string should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Test spec from just a comma should have no filters" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Test spec from name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Test spec from quoted name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Test spec from name should have one filter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Wildcard at the start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + parseTestSpec( "*a" ).matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Wildcard at the end" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + parseTestSpec( "a*" ).matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Wildcard at both ends" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + parseTestSpec( "*a*" ).matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Redundant wildcard at the start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Redundant wildcard at the end" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Redundant wildcard at both ends" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Wildcard at both ends, redundant at start" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Just wildcard" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Single tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Single tag, two matches" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Two tags" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Two tags, spare separated" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Wildcarded name and tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - minute == seconds + spec.matches( *tcA ) == false </Original> <Expanded> - 1 m == 60 s + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - hour != seconds + spec.matches( *tcB ) == false </Original> <Expanded> - 1 h != 60 s + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - micro != milli + spec.matches( *tcC ) == true </Original> <Expanded> - 1 us != 1 ms + true == true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - nano != micro + spec.matches( *tcD ) == false </Original> <Expanded> - 1 ns != 1 us + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Stringifying std::chrono::duration with weird ratios" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Single tag exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - half_minute != femto_second + spec.hasFilters() == true </Original> <Expanded> - 1 [30/1]s != 1 fs + true == true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - pico_second != atto_second + spec.matches( *tcA ) == true </Original> <Expanded> - 1 ps != 1 as + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Stringifying std::chrono::time_point<system_clock>" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - now != later + spec.matches( *tcB ) == false </Original> <Expanded> - {iso8601-timestamp} -!= -{iso8601-timestamp} + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Tabs and newlines show in output" tags="[.][failing][whitespace]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1 == s2 + spec.matches( *tcC ) == false </Original> <Expanded> - "if ($b == 10) { - $a = 20; -}" -== -"if ($b == 10) { - $a = 20; -} -" + false == false </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Tag alias can be registered against tag patterns" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Section name="The same tag alias can only be registered once" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - what, Contains( "[@zzz]" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "[@zzz]" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - what, Contains( "file" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "file" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - what, Contains( "2" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "2" - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - what, Contains( "10" ) - </Original> - <Expanded> - "error: tag alias, '[@zzz]' already registered. - First seen at: file:2 - Redefined at: file:10" contains: "10" - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <Section name="Tag aliases must be of the form [@name]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Original> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) - </Original> - <Expanded> - registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="One tag exclusion and one tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + spec.hasFilters() == true </Original> <Expanded> - 1 == 1 + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 1" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + spec.matches( *tcA ) == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 2" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - Template_Fixture<TestType>::m_a == 1 + spec.matches( *tcB ) == true </Original> <Expanded> - 1.0 == 1 + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.matches( *tcC ) == false </Original> <Expanded> - 1 > 0 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="One tag exclusion and one wldcarded name inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.hasFilters() == true </Original> <Expanded> - 4 > 0 + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.matches( *tcA ) == false </Original> <Expanded> - 1 > 0 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.matches( *tcB ) == false </Original> <Expanded> - 4 > 0 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.matches( *tcC ) == false </Original> <Expanded> - 4 > 0 + false == false </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.matches( *tcD ) == true </Original> <Expanded> - 1 > 0 + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <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" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="One tag exclusion, using exclude:, and one wldcarded name inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - sizeof(TestType) > 0 + spec.hasFilters() == true </Original> <Expanded> - 4 > 0 + true == true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcA ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcB ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcC ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcD ) == true </Original> <Expanded> - 5 >= 5 + true == true </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="name exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="wildcarded name exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="wildcarded name exclusion with tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="wildcarded name exclusion, using exclude:, with tag inclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.hasFilters() == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcA ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcB ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcC ) == true </Original> <Expanded> - 5 == 5 + true == true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcD ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="two wildcarded names" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.hasFilters() == true </Original> <Expanded> - 5 == 5 + true == true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcA ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcB ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcC ) == true </Original> <Expanded> - 5 >= 5 + true == true </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcD ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="empty tag" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.hasFilters() == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcA ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcB ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcC ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcD ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="empty quoted name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.hasFilters() == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcA ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcB ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcC ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcD ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="quoted string followed by tag exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.hasFilters() == true </Original> <Expanded> - 5 >= 5 + true == true </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *tcA ) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *tcB ) == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcC ) == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + spec.matches( *tcD ) == true + </Original> + <Expanded> + true == true + </Expanded> + </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Leading and trailing spaces in test spec" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *fakeTestCase( " aardvark " ) ) </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *fakeTestCase( " aardvark" ) ) </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 10 - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *fakeTestCase( " aardvark " ) ) </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *fakeTestCase( "aardvark " ) ) </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *fakeTestCase( "aardvark" ) ) </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Leading and trailing spaces in test name" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *fakeTestCase( " aardvark " ) ) </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 5 + spec.matches( *fakeTestCase( " aardvark" ) ) </Original> <Expanded> - 5 == 5 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 5 + spec.matches( *fakeTestCase( " aardvark " ) ) </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 5 - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + spec.matches( *fakeTestCase( "aardvark " ) ) </Original> <Expanded> - 6 == 6 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + spec.matches( *fakeTestCase( "aardvark" ) ) </Original> <Expanded> - 6 >= 6 + true </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 2 * V - </Original> - <Expanded> - 12 == 12 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 2 * V - </Original> - <Expanded> - 12 >= 12 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortened hide tags are split apart when parsing" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + spec.matches(*fakeTestCase("hidden and foo", "[.][foo]")) </Original> <Expanded> - 6 == 6 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + !(spec.matches(*fakeTestCase("only foo", "[foo]"))) </Original> <Expanded> - 6 >= 6 + !false </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 6 >= 6 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortened hide tags also properly handle exclusion" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + !(spec.matches(*fakeTestCase("hidden and foo", "[.][foo]"))) </Original> <Expanded> - 6 == 6 + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + !(spec.matches(*fakeTestCase("only foo", "[foo]"))) </Original> <Expanded> - 6 >= 6 + !false </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 2 * V - </Original> - <Expanded> - 12 >= 12 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + !(spec.matches(*fakeTestCase("only hidden", "[.]"))) </Original> <Expanded> - 6 == 6 + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + spec.matches(*fakeTestCase("neither foo nor hidden", "[bar]")) </Original> <Expanded> - 6 >= 6 + true </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 6 >= 6 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - float,4" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Pointers can be compared to null" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p == pNULL + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + p != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cp != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + cpc != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + returnsConstNull() == 0 + </Original> + <Expanded> + {null string} == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + 0 != p + </Original> + <Expanded> + 0 != 0x<hex digits> + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Precision of floating point stringification can be set" tags="[floatingPoint][toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Floats" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Original> + str1.size() == 3 + 5 </Original> <Expanded> - 4 == 4 + 8 == 8 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - v.capacity() >= V + str2.size() == 3 + 10 </Original> <Expanded> - 4 >= 4 + 13 == 13 </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 2 * V - </Original> - <Expanded> - 8 == 8 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 2 * V - </Original> - <Expanded> - 8 >= 8 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Double" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - v.size() == V + str1.size() == 2 + 5 </Original> <Expanded> - 4 == 4 + 7 == 7 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - v.capacity() >= V + str2.size() == 2 + 15 </Original> <Expanded> - 4 >= 4 + 17 == 17 </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 4 >= 4 - </Expanded> - </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Predicate matcher can accept const char*" tags="[compilation][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + "foo", Predicate<const char*>( []( const char* const& ) { return true; } ) + </Original> + <Expanded> + "foo" matches undescribed predicate + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Process can be configured on command line" tags="[command-line][config]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="empty args don't cause a crash" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + config.processName == "" </Original> <Expanded> - 4 == 4 + "" == "" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="default - no arguments" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + result </Original> <Expanded> - 4 >= 4 + {?} </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 2 * V - </Original> - <Expanded> - 8 >= 8 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + config.processName == "test" </Original> <Expanded> - 4 == 4 + "test" == "test" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + config.shouldDebugBreak == false </Original> <Expanded> - 4 >= 4 + false == false </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 4 == 4 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 4 >= 4 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - int,5" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + config.abortAfter == -1 </Original> <Expanded> - 5 == 5 + -1 == -1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + config.noThrow == false </Original> <Expanded> - 5 >= 5 + false == false </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 2 * V - </Original> - <Expanded> - 10 == 10 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 2 * V - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + config.reporterName == "console" </Original> <Expanded> - 5 == 5 + "console" == "console" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + !(cfg.hasTestFilters()) </Original> <Expanded> - 5 >= 5 + !false </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 0 + result </Original> <Expanded> - 0 == 0 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + cfg.hasTestFilters() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false </Original> <Expanded> - 5 == 5 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 2 * V + cfg.testSpec().matches(*fakeTestCase("test1")) </Original> <Expanded> - 10 >= 10 + true </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 5 >= 5 - </Expanded> - </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case exclusion using exclude:" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + result </Original> <Expanded> - 5 == 5 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + cfg.hasTestFilters() </Original> <Expanded> - 5 >= 5 + true </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 15 >= 15 - </Expanded> - </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 2 * V + cfg.testSpec().matches(*fakeTestCase("test1")) == false </Original> <Expanded> - 30 == 30 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 2 * V + cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) </Original> <Expanded> - 30 >= 30 + true </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 15 >= 15 - </Expanded> - </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Specify one test case exclusion using ~" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == 0 + result </Original> <Expanded> - 0 == 0 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.hasTestFilters() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + cfg.testSpec().matches(*fakeTestCase("test1")) == false </Original> <Expanded> - 15 >= 15 + false == false </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cfg.testSpec().matches(*fakeTestCase("alwaysIncluded")) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 15 >= 15 - </Expanded> - </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-r/console" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + cli.parse({"test", "-r", "console"}) </Original> <Expanded> - 15 == 15 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= 2 * V + config.reporterName == "console" </Original> <Expanded> - 30 >= 30 + "console" == "console" </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == V - </Original> - <Expanded> - 15 == 15 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= V - </Original> - <Expanded> - 15 >= 15 - </Expanded> - </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-r/xml" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.size() == V + cli.parse({"test", "-r", "xml"}) </Original> <Expanded> - 15 == 15 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - v.capacity() >= V + config.reporterName == "xml" </Original> <Expanded> - 15 >= 15 + "xml" == "xml" </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test case with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test enum bit values" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Original> - 0x<hex digits> == bit30and31 - </Original> - <Expanded> - 3221225472 (0x<hex digits>) == 3221225472 - </Expanded> - </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Test with special, characters "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Expression success="false" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Original> - 1 == 2 - </Original> - <Expanded> - 1 == 2 - </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--reporter/junit" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - listingString, Contains("[fakeTag]"s) + cli.parse({"test", "--reporter", "junit"}) </Original> <Expanded> - "All available tags: - 1 [fakeTag] -1 tag - -" contains: "[fakeTag]" + {?} </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - listingString, Contains("fake reporter"s) + config.reporterName == "junit" </Original> <Expanded> - "Available reporters: - fake reporter: fake description - -" contains: "fake reporter" + "junit" == "junit" </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Only one reporter is accepted" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + !(cli.parse({ "test", "-r", "xml", "-r", "junit" })) </Original> <Expanded> - "All available test cases: - fake test name - [fakeTestTag] -1 test case - -" ( contains: "fake test name" and contains: "fakeTestTag" ) + !{?} </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - For some reason someone is throwing a string literal! - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Tracker" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="reporter" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="must match one of the available ones" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() + !result </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + result.errorMessage(), Contains("Unrecognized reporter") </Original> <Expanded> - false == false + "Unrecognized reporter, 'unsupported'. Check available with --list-reporters" contains: "Unrecognized reporter" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="debugger" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-b" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - ctx.completedCycle() + cli.parse({"test", "-b"}) </Original> <Expanded> - true + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() + config.shouldDebugBreak == true </Original> <Expanded> - true + true == true </Expanded> </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="debugger" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--break" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--break"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isComplete() + config.shouldDebugBreak </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-a aborts after first failure" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() == false + cli.parse({"test", "-a"}) </Original> <Expanded> - false == false + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + config.abortAfter == 1 </Original> <Expanded> - false == false + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-x 2 aborts after two failures" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - ctx.completedCycle() + cli.parse({"test", "-x", "2"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.abortAfter == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-x must be numeric" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + !result </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + result.errorMessage(), Contains("convert") && Contains("oops") </Original> <Expanded> - false == false + "Unable to convert 'oops' to destination type" ( contains: "convert" and contains: "oops" ) </Expanded> </Expression> - <Section name="re-enter after failed section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase2.isOpen() + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) </Original> <Expanded> - true + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1b.isOpen() == false + config.waitForKeypress == std::get<1>(input) </Original> <Expanded> - false == false + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - ctx.completedCycle() + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) </Original> <Expanded> - true + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() + config.waitForKeypress == std::get<1>(input) </Original> <Expanded> - true + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<1>(input) + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Accepted options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--wait-for-keypress", std::get<0>(input)}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.waitForKeypress == std::get<1>(input) + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="abort" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="wait-for-keypress" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="invalid options are reported" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() + !result </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + result.errorMessage(), Contains("never") && Contains("both") + </Original> + <Expanded> + "keypress argument must be one of: never, start, exit or both. 'sometimes' not recognised" ( contains: "never" and contains: "both" ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-e" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-e"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.noThrow + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--nothrow" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--nothrow"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.noThrow + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="output filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="-o filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "-o", "filename.ext"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isComplete() + config.outputFilename == "filename.ext" </Original> <Expanded> - true + "filename.ext" == "filename.ext" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="output filename" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="--out" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isSuccessfullyCompleted() == false + cli.parse({"test", "--out", "filename.ext"}) </Original> <Expanded> - false == false + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + config.outputFilename == "filename.ext" </Original> <Expanded> - false == false + "filename.ext" == "filename.ext" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="combinations" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="Single character flags can be combined" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - ctx.completedCycle() + cli.parse({"test", "-abe"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.abortAfter == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.shouldDebugBreak </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isSuccessfullyCompleted() == false + config.noThrow == true </Original> <Expanded> - false == false + true == true </Expanded> </Expression> - <Section name="re-enter after failed section and find next section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="11" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="without option" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s2.isOpen() == false + cli.parse({"test"}) </Original> <Expanded> - false == false + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + config.useColour == UseColour::Auto </Original> <Expanded> - false == false + 0 == 0 </Expanded> </Expression> - <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Section name="Successfully close S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isComplete() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="10" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="auto" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s2.isOpen() == false + cli.parse({"test", "--use-colour", "auto"}) </Original> <Expanded> - false == false + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + config.useColour == UseColour::Auto </Original> <Expanded> - false == false + 0 == 0 </Expanded> </Expression> - <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1b.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Section name="fail S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - ctx.completedCycle() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isComplete() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2b.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase2.isSuccessfullyCompleted() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase3.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s2c.isOpen() == false - </Original> - <Expanded> - false == false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase3.isSuccessfullyCompleted() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="12" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="14" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="yes" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({"test", "--use-colour", "yes"}) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.useColour == UseColour::Yes + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - testCase.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Original> - s1.isOpen() - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Section name="open a nested section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="no" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s2.isOpen() + cli.parse({"test", "--use-colour", "no"}) </Original> <Expanded> - true + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.useColour == UseColour::No + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="use-colour" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="error" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s2.isComplete() + !result </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isComplete() == false + result.errorMessage(), Contains( "colour mode must be one of" ) </Original> <Expanded> - false == false + "colour mode must be one of: auto, yes or no. 'wrong' not recognised" contains: "colour mode must be one of" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="samples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - s1.isComplete() + cli.parse({ "test", "--benchmark-samples=200" }) </Original> <Expanded> - true + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() == false + config.benchmarkSamples == 200 </Original> <Expanded> - false == false + 200 == 200 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="resamples" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <Original> - testCase.isComplete() + cli.parse({ "test", "--benchmark-resamples=20000" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.benchmarkResamples == 20000 + </Original> + <Expanded> + 20000 (0x<hex digits>) == 20000 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="confidence-interval" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-confidence-interval=0.99" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.benchmarkConfidenceInterval == Catch::Approx(0.99) + </Original> + <Expanded> + 0.99 == Approx( 0.99 ) + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="no-analysis" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-no-analysis" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.benchmarkNoAnalysis </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Benchmark options" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Section name="warmup-time" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + cli.parse({ "test", "--benchmark-warmup-time=10" }) + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <Original> + config.benchmarkWarmupTime == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Trim strings" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 + </Original> + <Expanded> + 3 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Product with differing arities - std::tuple<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<TestType>::value >= 1 + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + Catch::Detail::stringify(UsesSentinel{}) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Reconstruction should be based on stringification: #914" tags="[.][Decomposition][failing]" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Decomposition.tests.cpp" > + <Original> + truthy(false) + </Original> + <Expanded> + Hey, its truthy! + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Regex string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Matches( "contains 'abc' as a substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" matches "contains 'abc' as a substring" case sensitively + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Matches( "this string contains 'abc' as a" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Regression test #1" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + actual, !UnorderedEquals( expected ) + </Original> + <Expanded> + { 'a', 'b' } not UnorderedEquals: { 'c', 'b' } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="automake reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="automake reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="automake reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: automake + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="compact reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: compact + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="console reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: console + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="junit reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: junit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="junit reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: junit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="junit reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: junit + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="sonarqube reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: sonarqube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="sonarqube reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: sonarqube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(std::string(no_whitespace)) == no_whitespace + listingString, Contains("fake reporter"s) </Original> <Expanded> - "There is no extra whitespace here" -== -"There is no extra whitespace here" + "<?xml version="1.0" encoding="UTF-8"?> +Available reporters: + fake reporter: fake description + +" contains: "fake reporter" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="sonarqube reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: sonarqube + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(std::string(leading_whitespace)) == no_whitespace + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) </Original> <Expanded> - "There is no extra whitespace here" -== -"There is no extra whitespace here" + "<?xml version="1.0" encoding="UTF-8"?> +All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="tap reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: tap + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(std::string(trailing_whitespace)) == no_whitespace + listingString, Contains("fakeTag"s) </Original> <Expanded> - "There is no extra whitespace here" -== -"There is no extra whitespace here" + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="tap reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: tap + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(std::string(whitespace_at_both_ends)) == no_whitespace + listingString, Contains("fake reporter"s) </Original> <Expanded> - "There is no extra whitespace here" -== -"There is no extra whitespace here" + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="tap reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: tap + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(StringRef(no_whitespace)) == StringRef(no_whitespace) + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) </Original> <Expanded> - There is no extra whitespace here -== -There is no extra whitespace here + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="teamcity reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: teamcity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) + listingString, Contains("fakeTag"s) </Original> <Expanded> - There is no extra whitespace here -== -There is no extra whitespace here + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "fakeTag" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="teamcity reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: teamcity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) + listingString, Contains("fake reporter"s) </Original> <Expanded> - There is no extra whitespace here -== -There is no extra whitespace here + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="teamcity reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: teamcity + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > <Original> - trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) </Original> <Expanded> - There is no extra whitespace here -== -There is no extra whitespace here + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Unexpected exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - 3.14 - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Upcasting special member functions" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - bptr->i == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - bptr->i == 3 - </Original> - <Expanded> - 3 == 3 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Usage of AllMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, AllMatch(SizeIs(5)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, !AllMatch(Contains(0) && Contains(1)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } all match matches undescribed predicate - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, allMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } all match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[1] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[2] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[3] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[4] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, !allMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } not all match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[1] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[2] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[3]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[4]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Usage of AnyMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, AnyMatch(SizeIs(5)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, !AnyMatch(Contains(0) && Contains(10)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } any match matches undescribed predicate - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, !anyMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } not any match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[1] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[2] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[3] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="xml reporter lists tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: xml + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fakeTag"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<TagsFromMatchingTests> + <Tag> + <Count>1</Count> + <Aliases> + <Alias>fakeTag</Alias> + </Aliases> + </Tag> +</TagsFromMatchingTests>" contains: "fakeTag" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="xml reporter lists reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: xml + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<AvailableReporters> + <Reporter> + <Name>fake reporter</Name> + <Description>fake description</Description> + </Reporter> +</AvailableReporters>" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + !(factories.empty()) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Section name="xml reporter lists tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Info> + Tested reporter: xml + </Info> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<MatchingTests> + <TestCase> + <Name>fake test name</Name> + <ClassName/> + <Tags>[fakeTestTag]</Tags> + <SourceInfo> + <File>fake-file.cpp</File> + <Line>123456789</Line> + </SourceInfo> + </TestCase> +</MatchingTests>" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="SUCCEED counts as a test pass" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="SUCCEED does not require an argument" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Scenario: BDD tests requiring Fixtures to provide commonly-accessed data or methods" tags="[bdd][fixtures]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: No operations precede me" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + before == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: We get the count" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: Subsequently values are higher" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > <Original> - mocked.derefed[4] + after > before </Original> <Expanded> - true + 1 > 0 </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, anyMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } any match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[1]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[2]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[3]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[4]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Scenario: Do that thing with the thing" tags="[Tags]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: This stuff exists" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="And given: And some assumption" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="When: I do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: it should do this" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + itDoesThis() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="And: do that" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + itDoesThat() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Usage of NoneMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, NoneMatch(SizeIs(6)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - data, !NoneMatch(Contains(0) && Contains(1)) - </Original> - <Expanded> - { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) - </Expanded> - </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } none match matches undescribed predicate - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, noneMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } none match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[1] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[2] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[3] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[4] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Scenario: This is a really long scenario name to see how the list command deals with wrapping" tags="[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter][long][lots][one very long tag name that should cause line wrapping writing out using the list command][tags][verbose][very long tags]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: A section name that is so long that it cannot fit in a single console width" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="When: The test headers are printed as part of the normal running of the scenario" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked, !noneMatch - </Original> - <Expanded> - { 1, 2, 3, 4, 5 } not none match matches undescribed predicate - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - mocked.derefed[0] - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[1]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - !(mocked.derefed[2]) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Scenario: Vector resizing affects size and capacity" tags="[bdd][capacity][size][vector]" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Given: an empty vector" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: it is made larger" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: the size and capacity go up" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > <Original> - !(mocked.derefed[3]) + v.size() == 10 </Original> <Expanded> - !false + 10 == 10 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > <Original> - !(mocked.derefed[4]) + v.capacity() >= 10 </Original> <Expanded> - !false + 10 >= 10 </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Usage of the SizeIs range matcher" tags="[matchers][size][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Section name="Some with stdlib containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - empty_vec, SizeIs(0) - </Original> - <Expanded> - { } has size == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - empty_vec, !SizeIs(2) - </Original> - <Expanded> - { } not has size == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - empty_vec, SizeIs(Lt(2)) - </Original> - <Expanded> - { } size matches is less than 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - arr, SizeIs(2) - </Original> - <Expanded> - { 0, 0 } has size == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - arr, SizeIs( Lt(3)) - </Original> - <Expanded> - { 0, 0 } size matches is less than 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - arr, !SizeIs(!Lt(3)) - </Original> - <Expanded> - { 0, 0 } not size matches not is less than 3 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - map, SizeIs(3) - </Original> - <Expanded> - { {?}, {?}, {?} } has size == 3 - </Expanded> - </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> - </Section> - <Section name="Type requires ADL found size free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - unrelated::ADL_size{}, SizeIs(12) - </Original> - <Expanded> - {?} has size == 12 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Section name="And when: it is made smaller again" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: the size goes down but the capacity stays the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Section name="Type has size member" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > - <Original> - has_size{}, SizeIs(13) - </Original> - <Expanded> - {?} has size == 13 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Given: an empty vector" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Section name="When: we reserve more space" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Section name="Then: The capacity is increased but the size remains the same" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/BDD.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Use a custom approx" tags="[Approx][custom]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Sends stuff to stdout and stderr" tags="[.]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"> + <StdOut> +A string sent directly to stdout + </StdOut> + <StdErr> +A string sent directly to stderr +A string sent to stderr via clog + </StdErr> + </OverallResult> + </TestCase> + <TestCase name="Some simple comparisons between doubles" tags="[Approx]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == Approx( 1.23 ) + </Original> + <Expanded> + 1.23 == Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != Approx( 1.22 ) + </Original> + <Expanded> + 1.23 != Approx( 1.22 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != Approx( 1.24 ) + </Original> + <Expanded> + 1.23 != Approx( 1.24 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == 1.23_a + </Original> + <Expanded> + 1.23 == Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != 1.22_a + </Original> + <Expanded> + 1.23 != Approx( 1.22 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx( d ) == 1.23 + </Original> + <Expanded> + Approx( 1.23 ) == 1.23 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx( d ) != 1.22 + </Original> + <Expanded> + Approx( 1.23 ) != 1.22 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + Approx( d ) != 1.24 + </Original> + <Expanded> + Approx( 1.23 ) != 1.24 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Standard output from all sections is reported" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Section name="one" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="two" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResult success="false"> + <StdOut> +Message from section one +Message from section two + </StdOut> + </OverallResult> + </TestCase> + <TestCase name="StartsWith string matcher" tags="[.][failing][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), StartsWith( "This String" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" starts with: "This String" + </Expanded> + </Expression> + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), StartsWith( "string", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" starts with: "string" (case insensitive) + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Static arrays are convertible to string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="Single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - d == approx( 1.23 ) + Catch::Detail::stringify(singular) == "{ 1 }" </Original> <Expanded> - 1.23 == Approx( 1.23 ) + "{ 1 }" == "{ 1 }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Multiple" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - d == approx( 1.22 ) + Catch::Detail::stringify(arr) == "{ 3, 2, 1 }" </Original> <Expanded> - 1.23 == Approx( 1.22 ) + "{ 3, 2, 1 }" == "{ 3, 2, 1 }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Non-trivial inner items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - d == approx( 1.24 ) + Catch::Detail::stringify(arr) == R"({ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } })" + </Original> + <Expanded> + "{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" +== +"{ { "1:1", "1:2", "1:3" }, { "2:1", "2:2" } }" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="String matchers" tags="[matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "string" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "string" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "string", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "string" (case insensitive) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "abc" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "abc" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), Contains( "aBC", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" contains: "abc" (case insensitive) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), StartsWith( "this" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" starts with: "this" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), StartsWith( "THIS", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" starts with: "this" (case insensitive) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), EndsWith( "substring" ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ends with: "substring" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + testStringForMatching(), EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) + </Original> + <Expanded> + "this string contains 'abc' as a substring" ends with: " substring" (case insensitive) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="StringRef" tags="[StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Empty string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + empty.empty() </Original> <Expanded> - 1.23 == Approx( 1.24 ) + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - d != approx( 1.25 ) + empty.size() == 0 </Original> <Expanded> - 1.23 != Approx( 1.25 ) + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - approx( d ) == 1.23 + std::strcmp( empty.data(), "" ) == 0 </Original> <Expanded> - Approx( 1.23 ) == 1.23 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="From string literal" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - approx( d ) == 1.22 + s.empty() == false </Original> <Expanded> - Approx( 1.23 ) == 1.22 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - approx( d ) == 1.24 + s.size() == 5 </Original> <Expanded> - Approx( 1.23 ) == 1.24 + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - approx( d ) != 1.25 + std::strcmp( rawChars, "hello" ) == 0 </Original> <Expanded> - Approx( 1.23 ) != 1.25 + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Variadic macros" tags="[sections][variadic]" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <Section name="Section with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Vector Approx matcher" tags="[approx][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Empty vector is roughly equal to an empty vector" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - empty, Approx(empty) - </Original> - <Expanded> - { } is approx: { } - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="A vector is approx equal to itself" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, Approx(v1) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, Approx<double>({ 1., 2., 3. }) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Different length" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, !Approx(temp) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Same length, different elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, !Approx(v2) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, Approx(v2).margin(0.5) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, Approx(v2).epsilon(0.5) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v1, Approx(v2).epsilon(0.1).scale(500) - </Original> - <Expanded> - { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } - </Expanded> - </Expression> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="4" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Vector Approx matcher -- failing" tags="[.][approx][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Empty and non empty vectors are not approx equal" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - empty, Approx(t1) - </Original> - <Expanded> - { } is approx: { 1.0, 2.0 } - </Expanded> - </Expression> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="Just different vectors" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + s.data() == rawChars + </Original> + <Expanded> + "hello" == "hello" + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="From sub-string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original == "original" + </Original> + <Expanded> + original == "original" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + original.data() + </Original> + <Expanded> + original.data() + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v1, Approx(v2) + ss.empty() == false </Original> <Expanded> - { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } + false == false </Expanded> </Expression> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Vector matchers" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, VectorContains(1) + ss.size() == 5 </Original> <Expanded> - { 1, 2, 3 } Contains: 1 + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, VectorContains(2) + std::strncmp( ss.data(), "hello", 5 ) == 0 </Original> <Expanded> - { 1, 2, 3 } Contains: 2 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5, (VectorContains<int, CustomAllocator<int>>(2)) + ss == "hello" </Original> <Expanded> - { 1, 2, 3 } Contains: 2 + hello == "hello" </Expanded> </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <Section name="Contains (vector)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Contains(v2) - </Original> - <Expanded> - { 1, 2, 3 } Contains: { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Contains<int>({ 1, 2 }) - </Original> - <Expanded> - { 1, 2, 3 } Contains: { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) - </Original> - <Expanded> - { 1, 2, 3 } Contains: { 1, 2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Contains(v2) - </Original> - <Expanded> - { 1, 2, 3 } Contains: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Contains(empty) - </Original> - <Expanded> - { 1, 2, 3 } Contains: { } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - empty, Contains(empty) - </Original> - <Expanded> - { } Contains: { } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="non-zero-based substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) + ss.size() == 6 </Original> <Expanded> - { 1, 2, 3 } Contains: { 1, 2, 3 } + 6 == 6 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5, Contains(v6) + std::strcmp( ss.data(), "world!" ) == 0 </Original> <Expanded> - { 1, 2, 3 } Contains: { 1, 2 } + 0 == 0 </Expanded> </Expression> - <OverallResults successes="8" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Contains (element), composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of full refs should match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, VectorContains(1) && VectorContains(2) + s.data() == s2.data() </Original> <Expanded> - { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) + "hello world!" == "hello world!" </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="Equals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Equals(v) - </Original> - <Expanded> - { 1, 2, 3 } Equals: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - empty, Equals(empty) - </Original> - <Expanded> - { } Equals: { } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Equals<int>({ 1, 2, 3 }) - </Original> - <Expanded> - { 1, 2, 3 } Equals: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, Equals(v2) - </Original> - <Expanded> - { 1, 2, 3 } Equals: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) - </Original> - <Expanded> - { 1, 2, 3 } Equals: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Pointer values of substring refs should also match" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5, Equals(v6) + s.data() == ss.data() </Original> <Expanded> - { 1, 2, 3 } Equals: { 1, 2, 3 } + "hello world!" == "hello world!" </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <Section name="UnorderedEquals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, UnorderedEquals(v) - </Original> - <Expanded> - { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Original> - v, UnorderedEquals<int>({ 3, 2, 1 }) - </Original> - <Expanded> - { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Past the end substring" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - empty, UnorderedEquals(empty) + s.substr(s.size() + 1, 123).empty() </Original> <Expanded> - { } UnorderedEquals: { } + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Substring off the end are trimmed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - permuted, UnorderedEquals(v) + std::strcmp(ss.data(), "world!") == 0 </Original> <Expanded> - { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Substrings" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="substring start after the end is empty" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - permuted, UnorderedEquals(v) + s.substr(1'000'000, 1).empty() </Original> <Expanded> - { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } + true </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Comparisons are deep" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + reinterpret_cast<char*>(buffer1) != reinterpret_cast<char*>(buffer2) + </Original> + <Expanded> + "Hello" != "Hello" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + left == right + </Original> + <Expanded> + Hello == Hello + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + left != left.substr(0, 3) + </Original> + <Expanded> + Hello != Hel + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="implicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) + sr == "a standard string" </Original> <Expanded> - { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } + a standard string == "a standard string" </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v5_permuted, UnorderedEquals(v5) + sr.size() == stdStr.size() </Original> <Expanded> - { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } + 17 == 17 </Expanded> </Expression> - <OverallResults successes="7" failures="0" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="Vector matchers that fail" tags="[.][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, VectorContains(-1) + sr == "a standard string" </Original> <Expanded> - { 1, 2, 3 } Contains: -1 + a standard string == "a standard string" </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - empty, VectorContains(1) + sr.size() == stdStr.size() </Original> <Expanded> - { } Contains: 1 + 17 == 17 </Expanded> </Expression> - <OverallResults successes="0" failures="2" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Contains (vector)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="from std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - empty, Contains(v) + sr == "a standard string" </Original> <Expanded> - { } Contains: { 1, 2, 3 } + a standard string == "a standard string" </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, Contains(v2) + sr.size() == stdStr.size() </Original> <Expanded> - { 1, 2, 3 } Contains: { 1, 2, 4 } + 17 == 17 </Expanded> </Expression> - <OverallResults successes="0" failures="2" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="Equals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="explicitly constructed" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, Equals(v2) + stdStr == "a stringref" </Original> <Expanded> - { 1, 2, 3 } Equals: { 1, 2 } + "a stringref" == "a stringref" </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v2, Equals(v) + stdStr.size() == sr.size() </Original> <Expanded> - { 1, 2 } Equals: { 1, 2, 3 } + 11 == 11 </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="to std::string" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="assigned" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - empty, Equals(v) + stdStr == "a stringref" </Original> <Expanded> - { } Equals: { 1, 2, 3 } + "a stringref" == "a stringref" </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > <Original> - v, Equals(empty) + stdStr.size() == sr.size() </Original> <Expanded> - { 1, 2, 3 } Equals: { } + 11 == 11 </Expanded> </Expression> - <OverallResults successes="0" failures="4" expectedFailures="0"/> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="UnorderedEquals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="std::string += StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + lhs == "some string += the stringref contents" + </Original> + <Expanded> + "some string += the stringref contents" +== +"some string += the stringref contents" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="StringRef + StringRef" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Original> + together == "abrakadabra" + </Original> + <Expanded> + "abrakadabra" == "abrakadabra" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="StringRef at compilation time" tags="[constexpr][StringRef][Strings]" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <Section name="Simple constructors" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="12" failures="0" expectedFailures="0"/> + </Section> + <Section name="UDL construction" filename="tests/<exe-name>/IntrospectiveTests/String.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - signed char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying char arrays with statically known sizes - unsigned char" tags="[toString]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s + </Original> + <Expanded> + ""abc"" == ""abc"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + minute == seconds + </Original> + <Expanded> + 1 m == 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + hour != seconds + </Original> + <Expanded> + 1 h != 60 s + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + micro != milli + </Original> + <Expanded> + 1 us != 1 ms + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + nano != micro + </Original> + <Expanded> + 1 ns != 1 us + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying std::chrono::duration with weird ratios" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + half_minute != femto_second + </Original> + <Expanded> + 1 [30/1]s != 1 fs + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + pico_second != atto_second + </Original> + <Expanded> + 1 ps != 1 as + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Stringifying std::chrono::time_point<system_clock>" tags="[chrono][toString]" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > + <Original> + now != later + </Original> + <Expanded> + {iso8601-timestamp} +!= +{iso8601-timestamp} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Tabs and newlines show in output" tags="[.][failing][whitespace]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + s1 == s2 + </Original> + <Expanded> + "if ($b == 10) { + $a = 20; +}" +== +"if ($b == 10) { + $a = 20; +} +" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Tag alias can be registered against tag patterns" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Section name="The same tag alias can only be registered once" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, Contains( "[@zzz]" ) + </Original> + <Expanded> + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "[@zzz]" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, Contains( "file" ) + </Original> + <Expanded> + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "file" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, Contains( "2" ) + </Original> + <Expanded> + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "2" + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + what, Contains( "10" ) + </Original> + <Expanded> + "error: tag alias, '[@zzz]' already registered. + First seen at: file:2 + Redefined at: file:10" contains: "10" + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Section name="Tag aliases must be of the form [@name]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[no ampersat]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[the @ is not at the start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "@no square bracket at start]", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Original> + <Expanded> + registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) ) + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 1" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 2" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" > + <Original> + Template_Fixture<TestType>::m_a == 1 + </Original> + <Expanded> + 1.0 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 1 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 4 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 1 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 4 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 4 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 1 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <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> + sizeof(TestType) > 0 + </Original> + <Expanded> + 4 > 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - float" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v, UnorderedEquals(empty) + v.capacity() == 0 </Original> <Expanded> - { 1, 2, 3 } UnorderedEquals: { } + 0 == 0 </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - int" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - empty, UnorderedEquals(v) + v.capacity() == 0 </Original> <Expanded> - { } UnorderedEquals: { 1, 2, 3 } + 0 == 0 </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - std::string" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - permuted, UnorderedEquals(v) + v.capacity() == 0 </Original> <Expanded> - { 1, 3 } UnorderedEquals: { 1, 2, 3 } + 0 == 0 </Expanded> </Expression> - <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>" tags="[template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 10 + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - permuted, UnorderedEquals(v) + v.capacity() == 0 </Original> <Expanded> - { 3, 1 } UnorderedEquals: { 1, 2, 3 } + 0 == 0 </Expanded> </Expression> - <OverallResults successes="0" failures="4" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When checked exceptions are thrown they can be expected or unexpected" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisThrows(), std::domain_error + v.size() == 5 </Original> <Expanded> - thisThrows(), std::domain_error + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisDoesntThrow() + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 </Original> <Expanded> - thisDoesntThrow() + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisThrows() + v.capacity() >= 5 </Original> <Expanded> - thisThrows() + 5 >= 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown directly they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - unexpected exception - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown during a CHECK the test should continue" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 6 >= 6 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisThrows() == 0 + v.size() == 2 * V </Original> <Expanded> - thisThrows() == 0 + 12 == 12 </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 2 * V + </Original> + <Expanded> + 12 >= 12 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 6 >= 6 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisThrows() == 0 + v.size() == 0 </Original> <Expanded> - thisThrows() == 0 + 0 == 0 </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown from functions they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - thisThrows() == 0 + v.capacity() >= V </Original> <Expanded> - thisThrows() == 0 + 6 >= 6 </Expanded> - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - expected exception - </Exception> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown from sections they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Section name="section name" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - unexpected exception - </Exception> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="Where the LHS is not a simple value" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Warning> - Uncomment the code in this test to check that it gives a sensible compiler error - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="Where there is more to the expression after the RHS" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Warning> - Uncomment the code in this test to check that it gives a sensible compiler error - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="X/level/0/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="X/level/0/b" tags="[fizz][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="X/level/1/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="X/level/1/b" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="XmlEncode" tags="[XML]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Section name="normal string" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "normal string" ) == "normal string" - </Original> - <Expanded> - "normal string" == "normal string" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="empty string" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "" ) == "" - </Original> - <Expanded> - "" == "" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with ampersand" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "smith & jones" ) == "smith &amp; jones" - </Original> - <Expanded> - "smith &amp; jones" == "smith &amp; jones" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with less-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "smith < jones" ) == "smith &lt; jones" - </Original> - <Expanded> - "smith &lt; jones" == "smith &lt; jones" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with greater-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "smith > jones" ) == "smith > jones" - </Original> - <Expanded> - "smith > jones" == "smith > jones" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "smith ]]> jones" ) == "smith ]]&gt; jones" - </Original> - <Expanded> - "smith ]]&gt; jones" -== -"smith ]]&gt; jones" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with quotes" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( stringWithQuotes ) == stringWithQuotes - </Original> - <Expanded> - "don't "quote" me on that" -== -"don't "quote" me on that" - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" - </Original> - <Expanded> - "don't &quot;quote&quot; me on that" -== -"don't &quot;quote&quot; me on that" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with control char (1)" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Original> - encode( "[\x01]" ) == "[\\x01]" - </Original> - <Expanded> - "[\x01]" == "[\x01]" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="string with control char (x7F)" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - encode( "[\x7F]" ) == "[\\x7F]" + v.capacity() == 0 </Original> <Expanded> - "[\x7F]" == "[\x7F]" + 0 == 0 </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="analyse no analysis" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 6 >= 6 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.mean.point.count() == 23 + v.size() == V </Original> <Expanded> - 23.0 == 23 + 6 == 6 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 2 * V + </Original> + <Expanded> + 12 >= 12 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 6 >= 6 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.mean.lower_bound.count() == 23 + v.size() == V </Original> <Expanded> - 23.0 == 23 + 6 == 6 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.mean.upper_bound.count() == 23 + v.capacity() >= V </Original> <Expanded> - 23.0 == 23 + 6 >= 6 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTestSig: vectors can be sized and resized - float,4" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 4 >= 4 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.standard_deviation.point.count() == 0 + v.size() == 2 * V </Original> <Expanded> - 0.0 == 0 + 8 == 8 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.standard_deviation.lower_bound.count() == 0 + v.capacity() >= 2 * V + </Original> + <Expanded> + 8 >= 8 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 4 >= 4 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 </Original> <Expanded> - 0.0 == 0 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.standard_deviation.upper_bound.count() == 0 + v.capacity() >= V </Original> <Expanded> - 0.0 == 0 + 4 >= 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 4 >= 4 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.total() == 0 + v.size() == V </Original> <Expanded> - 0 == 0 + 4 == 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 2 * V + </Original> + <Expanded> + 8 >= 8 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 4 >= 4 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.low_mild == 0 + v.size() == V </Original> <Expanded> - 0 == 0 + 4 == 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.low_severe == 0 + v.capacity() >= V </Original> <Expanded> - 0 == 0 + 4 >= 4 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTestSig: vectors can be sized and resized - int,5" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.high_mild == 0 + v.size() == 2 * V </Original> <Expanded> - 0 == 0 + 10 == 10 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 2 * V + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.high_severe == 0 + v.size() == 0 </Original> <Expanded> 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outliers.samples_seen == 0 + v.capacity() >= V </Original> <Expanded> - 0 == 0 + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - analysis.outlier_variance == 0 + v.size() == V </Original> <Expanded> - 0.0 == 0 + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="array<int, N> -> toString" tags="[array][containers][toString]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Catch::Detail::stringify( empty ) == "{ }" + v.capacity() >= 2 * V + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V </Original> <Expanded> - "{ }" == "{ }" + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Catch::Detail::stringify( oneValue ) == "{ 42 }" + v.capacity() >= V </Original> <Expanded> - "{ 42 }" == "{ 42 }" + 5 >= 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="TemplateTestSig: vectors can be sized and resized - std::string,15" tags="[nttp][template][vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 15 >= 15 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" + v.size() == 2 * V </Original> <Expanded> - "{ 42, 250 }" == "{ 42, 250 }" + 30 == 30 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="atomic if" tags="[0][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - x == 0 + v.capacity() >= 2 * V + </Original> + <Expanded> + 30 >= 30 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 15 >= 15 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 </Original> <Expanded> 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="benchmark function call" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Section name="without chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.started == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.finished == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.started == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.finished == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - called == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="with chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.started == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.finished == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - model.started == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 15 >= 15 + </Expanded> + </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - model.finished == 0 + v.capacity() == 0 </Original> <Expanded> 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - called == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="5" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="boolean member" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 15 >= 15 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - obj.prop != 0 + v.capacity() >= 2 * V + </Original> + <Expanded> + 30 >= 30 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V + </Original> + <Expanded> + 15 == 15 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= V + </Original> + <Expanded> + 15 >= 15 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == V </Original> <Expanded> - 0x<hex digits> != 0 + 15 == 15 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="checkedElse" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - flag + v.capacity() >= V </Original> <Expanded> - true + 15 >= 15 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test case with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test enum bit values" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + 0x<hex digits> == bit30and31 + </Original> + <Expanded> + 3221225472 (0x<hex digits>) == 3221225472 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Test with special, characters "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 2" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Testing checked-if 3" tags="[!shouldfail][checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Failure filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" /> + <OverallResult success="true"/> + </TestCase> + <TestCase name="The NO_FAIL macro reports a failure but does not fail the test" tags="[messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="false" type="CHECK_NOFAIL" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + 1 == 2 + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="The default listing implementation write to provided stream" tags="[reporter-helpers][reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Section name="Listing tags" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("[fakeTag]"s) + </Original> + <Expanded> + "All available tags: + 1 [fakeTag] +1 tag + +" contains: "[fakeTag]" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing reporters" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains("fake reporter"s) + </Original> + <Expanded> + "Available reporters: + fake reporter: fake description + +" contains: "fake reporter" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Listing tests" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" > + <Original> + listingString, Contains( "fake test name"s ) && Contains( "fakeTestTag"s ) + </Original> + <Expanded> + "All available test cases: + fake test name + [fakeTestTag] +1 test case + +" ( contains: "fake test name" and contains: "fakeTestTag" ) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="This test 'should' fail but doesn't" tags="[!shouldfail][.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="Thrown string literals are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + For some reason someone is throwing a string literal! + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Tracker" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCheckedElse( true ) + s1.isSuccessfullyCompleted() </Original> <Expanded> true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="checkedElse, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - flag + testCase.isComplete() == false </Original> <Expanded> - false + false == false </Expanded> </Expression> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCheckedElse( false ) + ctx.completedCycle() </Original> <Expanded> - false + true </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="checkedIf" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - flag + testCase.isSuccessfullyCompleted() </Original> <Expanded> true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCheckedIf( true ) + s1.isComplete() </Original> <Expanded> true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="checkedIf, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - flag + s1.isSuccessfullyCompleted() == false </Original> <Expanded> - false + false == false </Expanded> </Expression> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - testCheckedIf( false ) + testCase.isComplete() == false </Original> <Expanded> - false + false == false </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="classify_outliers" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Section name="none" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.samples_seen == static_cast<int>(x.size()) - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_severe == los - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_mild == lom - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.high_mild == him - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.high_severe == his - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.total() == los + lom + him + his - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="low severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.samples_seen == static_cast<int>(x.size()) - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_severe == los - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_mild == lom - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.high_mild == him - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.high_severe == his - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.total() == los + lom + him + his - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="low mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.samples_seen == static_cast<int>(x.size()) - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="re-enter after failed section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_severe == los + testCase2.isOpen() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_mild == lom + s1b.isOpen() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_mild == him + ctx.completedCycle() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_severe == his + testCase.isComplete() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.total() == los + lom + him + his + testCase.isSuccessfullyCompleted() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <OverallResults successes="5" failures="0" expectedFailures="0"/> </Section> - <Section name="high mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="fail one section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="re-enter after failed section and find next section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.samples_seen == static_cast<int>(x.size()) + testCase2.isOpen() </Original> <Expanded> - 6 == 6 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_severe == los + s1b.isOpen() == false </Original> <Expanded> - 0 == 0 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_mild == lom + s2.isOpen() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_mild == him + ctx.completedCycle() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_severe == his + testCase.isComplete() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.total() == los + lom + him + his + testCase.isSuccessfullyCompleted() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Section name="high severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.samples_seen == static_cast<int>(x.size()) - </Original> - <Expanded> - 6 == 6 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_severe == los - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.low_mild == lom - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - o.high_mild == him - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="11" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_severe == his + testCase2.isOpen() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.total() == los + lom + him + his + s1b.isOpen() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="mixed" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.samples_seen == static_cast<int>(x.size()) + s2b.isOpen() </Original> <Expanded> - 6 == 6 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_severe == los + ctx.completedCycle() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="Successfully close S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="10" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="successfully close one section, then find another" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isComplete() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Section name="Re-enter - skips S1 and enters S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.low_mild == lom + testCase2.isOpen() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_mild == him + s1b.isOpen() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.high_severe == his + s2b.isOpen() </Original> <Expanded> - 0 == 0 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - o.total() == los + lom + him + his + ctx.completedCycle() == false </Original> <Expanded> - 2 == 2 + false == false </Expanded> </Expression> - <OverallResults successes="6" failures="0" expectedFailures="0"/> + <Section name="fail S2" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + ctx.completedCycle() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isComplete() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2b.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase2.isSuccessfullyCompleted() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase3.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s2c.isOpen() == false + </Original> + <Expanded> + false == false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase3.isSuccessfullyCompleted() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="12" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="comparisons between const int variables" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="14" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + testCase.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Original> + s1.isOpen() + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Section name="open a nested section" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - unsigned_char_var == 1 + s2.isOpen() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - unsigned_short_var == 1 + s2.isComplete() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - unsigned_int_var == 1 + s1.isComplete() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - unsigned_long_var == 1 + s1.isComplete() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="comparisons between int variables" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - long_var == unsigned_char_var + testCase.isComplete() == false </Original> <Expanded> - 1 == 1 + false == false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/PartTracker.tests.cpp" > <Original> - long_var == unsigned_short_var + testCase.isComplete() </Original> <Expanded> - 1 == 1 + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > - <Original> - long_var == unsigned_int_var + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Trim strings" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(std::string(no_whitespace)) == no_whitespace + </Original> + <Expanded> + "There is no extra whitespace here" +== +"There is no extra whitespace here" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(std::string(leading_whitespace)) == no_whitespace + </Original> + <Expanded> + "There is no extra whitespace here" +== +"There is no extra whitespace here" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(std::string(trailing_whitespace)) == no_whitespace + </Original> + <Expanded> + "There is no extra whitespace here" +== +"There is no extra whitespace here" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(std::string(whitespace_at_both_ends)) == no_whitespace + </Original> + <Expanded> + "There is no extra whitespace here" +== +"There is no extra whitespace here" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(StringRef(no_whitespace)) == StringRef(no_whitespace) + </Original> + <Expanded> + There is no extra whitespace here +== +There is no extra whitespace here + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(StringRef(leading_whitespace)) == StringRef(no_whitespace) + </Original> + <Expanded> + There is no extra whitespace here +== +There is no extra whitespace here + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(StringRef(trailing_whitespace)) == StringRef(no_whitespace) + </Original> + <Expanded> + There is no extra whitespace here +== +There is no extra whitespace here + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) + </Original> + <Expanded> + There is no extra whitespace here +== +There is no extra whitespace here + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Unexpected exceptions can be translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + 3.14 + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Upcasting special member functions" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + bptr->i == 3 </Original> <Expanded> - 1 == 1 + 3 == 3 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - long_var == unsigned_long_var + bptr->i == 3 </Original> <Expanded> - 1 == 1 + 3 == 3 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="erfc_inv" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AllMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - erfc_inv(1.103560) == Approx(-0.09203687623843015) + data, AllMatch(SizeIs(5)) </Original> <Expanded> - -0.0920368762 == Approx( -0.0920368762 ) + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } all match has size == 5 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - erfc_inv(1.067400) == Approx(-0.05980291115763361) + data, !AllMatch(Contains(0) && Contains(1)) </Original> <Expanded> - -0.0598029112 == Approx( -0.0598029112 ) + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - erfc_inv(0.050000) == Approx(1.38590382434967796) + needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) </Original> <Expanded> - 1.3859038243 == Approx( 1.3859038243 ) + { 1, 2, 3, 4, 5 } all match matches undescribed predicate </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="estimate_clock_resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, allMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } all match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked, !allMatch + </Original> + <Expanded> + { 1, 2, 3, 4, 5 } not all match matches undescribed predicate + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of AnyMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - res.mean.count() == rate + data, AnyMatch(SizeIs(5)) </Original> <Expanded> - 2000.0 == 2000 (0x<hex digits>) + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - res.outliers.total() == 0 + data, !AnyMatch(Contains(0) && Contains(10)) </Original> <Expanded> - 0 == 0 + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="even more nested SECTION tests" tags="[sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="c" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="d (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="c" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="e (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="f (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="first tag" tags="[tag1]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="has printf" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > -loose text artifact - <OverallResult success="false"/> - </TestCase> - <TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - Previous info should not be seen - </Failure> - <OverallResult success="false"/> - </TestCase> - <TestCase name="just failure after unscoped info" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - previous unscoped info SHOULD not be seen - </Failure> - <OverallResult success="false"/> - </TestCase> - <TestCase name="just info" tags="[info][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="just unscoped info" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="long long" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - l == std::numeric_limits<long long>::max() + needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) </Original> <Expanded> - 9223372036854775807 (0x<hex digits>) -== -9223372036854775807 (0x<hex digits>) + { 1, 2, 3, 4, 5 } any match matches undescribed predicate </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="looped SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="b is currently: 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked, !anyMatch </Original> <Expanded> - 0 > 1 + { 1, 2, 3, 4, 5 } not any match matches undescribed predicate </Expanded> </Expression> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="b is currently: 1" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked.derefed[0] </Original> <Expanded> - 1 > 1 + true </Expanded> </Expression> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="b is currently: 2" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked.derefed[1] </Original> <Expanded> - 2 > 1 + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 3" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked.derefed[3] </Original> <Expanded> - 3 > 1 + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 4" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked.derefed[4] </Original> <Expanded> - 4 > 1 + true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Section name="b is currently: 5" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + mocked, anyMatch </Original> <Expanded> - 5 > 1 + { 1, 2, 3, 4, 5 } any match matches undescribed predicate </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 6" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + !(mocked.derefed[1]) </Original> <Expanded> - 6 > 1 + !false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 7" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + !(mocked.derefed[2]) </Original> <Expanded> - 7 > 1 + !false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 8" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + !(mocked.derefed[3]) </Original> <Expanded> - 8 > 1 + !false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="b is currently: 9" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - b > a + !(mocked.derefed[4]) </Original> <Expanded> - 9 > 1 + !false </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="looped tests" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Info> - Testing if fib[0] (1) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - ( fib[i] % 2 ) == 0 - </Original> - <Expanded> - 1 == 0 - </Expanded> - </Expression> - <Info> - Testing if fib[1] (1) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - ( fib[i] % 2 ) == 0 - </Original> - <Expanded> - 1 == 0 - </Expanded> - </Expression> - <Info> - Testing if fib[2] (2) is even - </Info> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - ( fib[i] % 2 ) == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Info> - Testing if fib[3] (3) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - ( fib[i] % 2 ) == 0 - </Original> - <Expanded> - 1 == 0 - </Expanded> - </Expression> - <Info> - Testing if fib[4] (5) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - ( fib[i] % 2 ) == 0 - </Original> - <Expanded> - 1 == 0 - </Expanded> - </Expression> - <Info> - Testing if fib[5] (8) is even - </Info> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of NoneMatch range matcher" tags="[matchers][quantifiers][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ( fib[i] % 2 ) == 0 + data, NoneMatch(SizeIs(6)) </Original> <Expanded> - 0 == 0 + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 </Expanded> </Expression> - <Info> - Testing if fib[6] (13) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ( fib[i] % 2 ) == 0 + data, !NoneMatch(Contains(0) && Contains(1)) </Original> <Expanded> - 1 == 0 + { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) </Expanded> </Expression> - <Info> - Testing if fib[7] (21) is even - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found begin and end" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - ( fib[i] % 2 ) == 0 + needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) </Original> <Expanded> - 1 == 0 + { 1, 2, 3, 4, 5 } none match matches undescribed predicate </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="make_unique reimplementation" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Section name="From lvalue copies" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="All are read" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - !(lval.has_moved) + mocked, noneMatch </Original> <Expanded> - !false + { 1, 2, 3, 4, 5 } none match matches undescribed predicate </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="From rvalue moves" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - rval.has_moved + mocked.derefed[0] </Original> <Expanded> true </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[1] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[2] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[3] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[4] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <Section name="Variadic constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Shortcircuiting" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Short-circuited" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - *ptr == std::tuple<int, double, int>{1, 2., 3} + mocked, !noneMatch </Original> <Expanded> - {?} == {?} + { 1, 2, 3, 4, 5 } not none match matches undescribed predicate </Expanded> </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + mocked.derefed[0] + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[1]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[2]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[3]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Original> + !(mocked.derefed[4]) + </Original> + <Expanded> + !false + </Expanded> + </Expression> + <OverallResults successes="6" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="mean" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Usage of the SizeIs range matcher" tags="[matchers][size][templated]" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Section name="Some with stdlib containers" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - m == 19. + empty_vec, SizeIs(0) </Original> <Expanded> - 19.0 == 19.0 + { } has size == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="measure" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - x == 17 + empty_vec, !SizeIs(2) </Original> <Expanded> - 17 == 17 + { } not has size == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - x == 23 + empty_vec, SizeIs(Lt(2)) </Original> <Expanded> - 23 == 23 + { } size matches is less than 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - r.elapsed.count() == 42 + arr, SizeIs(2) </Original> <Expanded> - 42 == 42 + { 0, 0 } has size == 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - r.result == 23 + arr, SizeIs( Lt(3)) </Original> <Expanded> - 23 == 23 + { 0, 0 } size matches is less than 3 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - r.iterations == 1 + arr, !SizeIs(!Lt(3)) </Original> <Expanded> - 1 == 1 + { 0, 0 } not size matches not is less than 3 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s.elapsed.count() == 69 + map, SizeIs(3) </Original> <Expanded> - 69 == 69 + { {?}, {?}, {?} } has size == 3 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type requires ADL found size free function" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s.result == 17 + unrelated::ADL_size{}, SizeIs(12) </Original> <Expanded> - 17 == 17 + {?} has size == 12 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Type has size member" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Original> - s.iterations == 1 + has_size{}, SizeIs(13) </Original> <Expanded> - 1 == 1 + {?} has size == 13 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="mix info, unscoped info and warning" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - info - </Info> - <Info> - unscoped info - </Info> - <Warning> - and warn may mix - </Warning> - <Info> - info - </Info> - <Info> - unscoped info - </Info> - <Warning> - they are not cleared after warnings - </Warning> - <OverallResult success="false"/> - </TestCase> - <TestCase name="more nested SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a == b - </Original> - <Expanded> - 1 == 2 - </Expanded> - </Expression> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <OverallResults successes="0" failures="1" expectedFailures="0"/> - </Section> - <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a != b - </Original> - <Expanded> - 1 != 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="1" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Use a custom approx" tags="[Approx][custom]" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == approx( 1.23 ) + </Original> + <Expanded> + 1.23 == Approx( 1.23 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == approx( 1.22 ) + </Original> + <Expanded> + 1.23 == Approx( 1.22 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d == approx( 1.24 ) + </Original> + <Expanded> + 1.23 == Approx( 1.24 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + d != approx( 1.25 ) + </Original> + <Expanded> + 1.23 != Approx( 1.25 ) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + approx( d ) == 1.23 + </Original> + <Expanded> + Approx( 1.23 ) == 1.23 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + approx( d ) == 1.22 + </Original> + <Expanded> + Approx( 1.23 ) == 1.22 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + approx( d ) == 1.24 + </Original> + <Expanded> + Approx( 1.23 ) == 1.24 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Approx.tests.cpp" > + <Original> + approx( d ) != 1.25 + </Original> + <Expanded> + Approx( 1.23 ) != 1.25 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Variadic macros" tags="[sections][variadic]" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <Section name="Section with one argument" filename="tests/<exe-name>/UsageTests/VariadicMacros.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Vector Approx matcher" tags="[approx][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Empty vector is roughly equal to an empty vector" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + empty, Approx( empty ) + </Original> + <Expanded> + { } is approx: { } + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="A vector is approx equal to itself" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, Approx( v1 ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, Approx<double>( { 1., 2., 3. } ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } is approx: { 1.0, 2.0, 3.0 } + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="less than" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a < b - </Original> - <Expanded> - 1 < 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Different length" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, !Approx( temp ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } not is approx: { 1.0, 2.0, 3.0, 4.0 } + </Expanded> + </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="false"/> - </TestCase> - <TestCase name="nested SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Vectors with elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Same length, different elements" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, !Approx( v2 ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } not is approx: { 1.5, 2.5, 3.5 } + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - a != b + v1, Approx( v2 ).margin( 0.5 ) </Original> <Expanded> - 1 != 2 + { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - b != a + v1, Approx( v2 ).epsilon( 0.5 ) </Original> <Expanded> - 2 != 1 + { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } </Expanded> </Expression> - <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a != b - </Original> - <Expanded> - 1 != 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="3" failures="0" expectedFailures="0"/> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) + </Original> + <Expanded> + { 1.0, 2.0, 3.0 } is approx: { 1.5, 2.5, 3.5 } + </Expanded> + </Expression> + <OverallResults successes="4" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="non streamable - with conv. op" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResults successes="4" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Vector Approx matcher -- failing" tags="[.][approx][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Empty and non empty vectors are not approx equal" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - s == "7" + empty, Approx( t1 ) </Original> <Expanded> - "7" == "7" + { } is approx: { 1.0, 2.0 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="non-copyable objects" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="Just different vectors" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - ti == typeid(int) + v1, Approx( v2 ) </Original> <Expanded> - {?} == {?} + { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="normal_cdf" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Vector matchers" tags="[matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_cdf(0.000000) == Approx(0.50000000000000000) + v, VectorContains( 1 ) </Original> <Expanded> - 0.5 == Approx( 0.5 ) + { 1, 2, 3 } Contains: 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_cdf(1.000000) == Approx(0.84134474606854293) + v, VectorContains( 2 ) </Original> <Expanded> - 0.8413447461 == Approx( 0.8413447461 ) + { 1, 2, 3 } Contains: 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_cdf(-1.000000) == Approx(0.15865525393145705) + v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) </Original> <Expanded> - 0.1586552539 == Approx( 0.1586552539 ) + { 1, 2, 3 } Contains: 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contains (vector)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_cdf(2.809729) == Approx(0.99752083845315409) + v, Contains( v2 ) </Original> <Expanded> - 0.9975208385 == Approx( 0.9975208385 ) + { 1, 2, 3 } Contains: { 1, 2 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_cdf(-1.352570) == Approx(0.08809652095066035) + v, Contains<int>( { 1, 2 } ) </Original> <Expanded> - 0.088096521 == Approx( 0.088096521 ) + { 1, 2, 3 } Contains: { 1, 2 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="normal_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_quantile(0.551780) == Approx(0.13015979861484198) + v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) </Original> <Expanded> - 0.1301597986 == Approx( 0.1301597986 ) + { 1, 2, 3 } Contains: { 1, 2 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_quantile(0.533700) == Approx(0.08457408802851875) + v, Contains( v2 ) </Original> <Expanded> - 0.084574088 == Approx( 0.084574088 ) + { 1, 2, 3 } Contains: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - normal_quantile(0.025000) == Approx(-1.95996398454005449) + v, Contains( empty ) </Original> <Expanded> - -1.9599639845 == Approx( -1.9599639845 ) + { 1, 2, 3 } Contains: { } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="not allowed" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="true"/> - </TestCase> - <TestCase name="not prints unscoped info from previous failures" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this MAY be seen only for the FIRST assertion IF info is printed for passing assertions - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + empty, Contains( empty ) </Original> <Expanded> - true + { } Contains: { } </Expanded> </Expression> - <Info> - this MAY be seen only for the SECOND assertion IF info is printed for passing assertions - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + v5, ( Contains<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) </Original> <Expanded> - true + { 1, 2, 3 } Contains: { 1, 2, 3 } </Expanded> </Expression> - <Info> - this SHOULD be seen - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - false + v5, Contains( v6 ) </Original> <Expanded> - false + { 1, 2, 3 } Contains: { 1, 2 } </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="null strings" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="8" failures="0" expectedFailures="0"/> + </Section> + <Section name="Contains (element), composed" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - makeString( false ) != static_cast<char*>(0) + v, VectorContains( 1 ) && VectorContains( 2 ) </Original> <Expanded> - "valid string" != {null string} + { 1, 2, 3 } ( Contains: 1 and Contains: 2 ) </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Equals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - makeString( true ) == static_cast<char*>(0) + v, Equals( v ) </Original> <Expanded> - {null string} == {null string} + { 1, 2, 3 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="null_ptr" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - ptr.get() == 0 + empty, Equals( empty ) </Original> <Expanded> - 0 == 0 + { } Equals: { } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="pair<pair<int,const char *,pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" + v, Equals<int>( { 1, 2, 3 } ) </Original> <Expanded> - "{ { 42, "Arthur" }, { "Ford", 24 } }" -== -"{ { 42, "Arthur" }, { "Ford", 24 } }" + { 1, 2, 3 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="parseEnums" tags="[enums][Strings]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Section name="No enums" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) - </Original> - <Expanded> - { } Equals: { } - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="One enum value" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) - </Original> - <Expanded> - { Value1 } Equals: { Value1 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) - </Original> - <Expanded> - { Value1 } Equals: { Value1 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) - </Original> - <Expanded> - { Value1 } Equals: { Value1 } - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Multiple enum values" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) - </Original> - <Expanded> - { Value1, Value2 } Equals: { Value1, Value2 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) - </Original> - <Expanded> - { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 } - </Expanded> - </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > - <Original> - parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) - </Original> - <Expanded> - { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 } - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="pointer to class" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - p == 0 + v, Equals( v2 ) </Original> <Expanded> - 0 == 0 + { 1, 2, 3 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="print unscoped info if passing unscoped info is printed" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this MAY be seen IF info is printed for passing assertions - </Info> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + v5, ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) </Original> <Expanded> - true + { 1, 2, 3 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="prints unscoped info on failure" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this SHOULD be seen - </Info> - <Info> - this SHOULD also be seen - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - false + v5, Equals( v6 ) </Original> <Expanded> - false + { 1, 2, 3 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="prints unscoped info only for the first assertion" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - this SHOULD be seen only ONCE - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="UnorderedEquals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - false + v, UnorderedEquals( v ) </Original> <Expanded> - false + { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + v, UnorderedEquals<int>( { 3, 2, 1 } ) </Original> <Expanded> - true + { 1, 2, 3 } UnorderedEquals: { 3, 2, 1 } </Expanded> </Expression> - <Info> - this MAY also be seen only ONCE IF info is printed for passing assertions - </Info> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + empty, UnorderedEquals( empty ) </Original> <Expanded> - true + { } UnorderedEquals: { } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - true + permuted, UnorderedEquals( v ) </Original> <Expanded> - true + { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } </Expanded> - </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="random SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a != b - </Original> - <Expanded> - 1 != 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - b != a - </Original> - <Expanded> - 2 != 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - a != b - </Original> - <Expanded> - 1 != 2 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="replaceInPlace" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Section name="replace single char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(letters, "b", "z") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == "azcdefcg" - </Original> - <Expanded> - "azcdefcg" == "azcdefcg" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="replace two chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(letters, "c", "z") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == "abzdefzg" - </Original> - <Expanded> - "abzdefzg" == "abzdefzg" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="replace first char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(letters, "a", "z") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == "zbcdefcg" - </Original> - <Expanded> - "zbcdefcg" == "zbcdefcg" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="replace last char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(letters, "g", "z") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == "abcdefcz" - </Original> - <Expanded> - "abcdefcz" == "abcdefcz" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="replace all chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(letters, letters, "replaced") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == "replaced" - </Original> - <Expanded> - "replaced" == "replaced" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="replace no chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - !(Catch::replaceInPlace(letters, "x", "z")) - </Original> - <Expanded> - !false - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - letters == letters - </Original> - <Expanded> - "abcdefcg" == "abcdefcg" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="escape '" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - Catch::replaceInPlace(s, "'", "|'") - </Original> - <Expanded> - true - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Original> - s == "didn|'t" - </Original> - <Expanded> - "didn|'t" == "didn|'t" - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + </Expression> + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res.size() == count + permuted, UnorderedEquals( v ) </Original> <Expanded> - 10 == 10 + { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v5, ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( permuted ) ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v5_permuted, UnorderedEquals( v5 ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="7" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Vector matchers that fail" tags="[.][failing][matchers][vector]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Section name="Contains (element)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v, VectorContains( -1 ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 2, 3 } Contains: -1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + empty, VectorContains( 1 ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { } Contains: 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <Section name="Contains (vector)" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + empty, Contains( v ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { } Contains: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v, Contains( v2 ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 2, 3 } Contains: { 1, 2, 4 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="0" failures="2" expectedFailures="0"/> + </Section> + <Section name="Equals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v, Equals( v2 ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 2, 3 } Equals: { 1, 2 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + v2, Equals( v ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { 1, 2 } Equals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - res[i] == rate + empty, Equals( v ) </Original> <Expanded> - 1000.0 == 1000 (0x<hex digits>) + { } Equals: { 1, 2, 3 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="run_for_at_least, chronometer" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - meter.runs() >= old_runs + v, Equals( empty ) </Original> <Expanded> - 1 >= 1 + { 1, 2, 3 } Equals: { } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="0" failures="4" expectedFailures="0"/> + </Section> + <Section name="UnorderedEquals" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - meter.runs() >= old_runs + v, UnorderedEquals( empty ) </Original> <Expanded> - 2 >= 1 + { 1, 2, 3 } UnorderedEquals: { } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - meter.runs() >= old_runs + empty, UnorderedEquals( v ) </Original> <Expanded> - 4 >= 2 + { } UnorderedEquals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > <Original> - meter.runs() >= old_runs + permuted, UnorderedEquals( v ) </Original> <Expanded> - 8 >= 4 + { 1, 3 } UnorderedEquals: { 1, 2, 3 } </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="false" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" > + <Original> + permuted, UnorderedEquals( v ) + </Original> + <Expanded> + { 3, 1 } UnorderedEquals: { 1, 2, 3 } + </Expanded> + </Expression> + <OverallResults successes="0" failures="4" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When checked exceptions are thrown they can be expected or unexpected" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS_AS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows(), std::domain_error + </Original> + <Expanded> + thisThrows(), std::domain_error + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_NOTHROW" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisDoesntThrow() + </Original> + <Expanded> + thisDoesntThrow() + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() + </Original> + <Expanded> + thisThrows() + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown directly they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + unexpected exception + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown during a CHECK the test should continue" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown during a REQUIRE the test should abort fail" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown from functions they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Original> + thisThrows() == 0 + </Original> + <Expanded> + thisThrows() == 0 + </Expanded> + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + expected exception + </Exception> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown from sections they are always failures" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Section name="section name" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + unexpected exception + </Exception> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="Where the LHS is not a simple value" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Warning> + Uncomment the code in this test to check that it gives a sensible compiler error + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="Where there is more to the expression after the RHS" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Warning> + Uncomment the code in this test to check that it gives a sensible compiler error + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="X/level/0/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/0/b" tags="[fizz][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/1/a" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="X/level/1/b" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="XmlEncode" tags="[XML]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Section name="normal string" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - meter.runs() >= old_runs + encode( "normal string" ) == "normal string" </Original> <Expanded> - 16 >= 8 + "normal string" == "normal string" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="empty string" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - meter.runs() >= old_runs + encode( "" ) == "" </Original> <Expanded> - 32 >= 16 + "" == "" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with ampersand" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - meter.runs() >= old_runs + encode( "smith & jones" ) == "smith &amp; jones" </Original> <Expanded> - 64 >= 32 + "smith &amp; jones" == "smith &amp; jones" </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with less-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - meter.runs() >= old_runs + encode( "smith < jones" ) == "smith &lt; jones" </Original> <Expanded> - 128 >= 64 + "smith &lt; jones" == "smith &lt; jones" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with greater-than" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - Timing.elapsed >= time + encode( "smith > jones" ) == "smith > jones" </Original> <Expanded> - 128 ns >= 100 ns + "smith > jones" == "smith > jones" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "smith ]]> jones" ) == "smith ]]&gt; jones" + </Original> + <Expanded> + "smith ]]&gt; jones" +== +"smith ]]&gt; jones" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with quotes" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - Timing.result == Timing.iterations + 17 + encode( stringWithQuotes ) == stringWithQuotes </Original> <Expanded> - 145 == 145 + "don't "quote" me on that" +== +"don't "quote" me on that" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > <Original> - Timing.iterations >= time.count() + encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't &quot;quote&quot; me on that" </Original> <Expanded> - 128 >= 100 + "don't &quot;quote&quot; me on that" +== +"don't &quot;quote&quot; me on that" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="run_for_at_least, int" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with control char (1)" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "[\x01]" ) == "[\\x01]" + </Original> + <Expanded> + "[\x01]" == "[\x01]" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="string with control char (x7F)" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + encode( "[\x7F]" ) == "[\\x7F]" + </Original> + <Expanded> + "[\x7F]" == "[\x7F]" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="XmlWriter writes boolean attributes as true/false" tags="[XML][XmlWriter]" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Xml.tests.cpp" > + <Original> + stream.str(), Contains(R"(attr1="true")") && Contains(R"(attr2="false")") + </Original> + <Expanded> + "<?xml version="1.0" encoding="UTF-8"?> +<Element1 attr1="true" attr2="false"/> +" ( contains: "attr1="true"" and contains: "attr2="false"" ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="analyse no analysis" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.point.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.lower_bound.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.mean.upper_bound.count() == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.point.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.lower_bound.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.standard_deviation.upper_bound.count() == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.total() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.low_mild == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.low_severe == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.high_mild == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.high_severe == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outliers.samples_seen == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + analysis.outlier_variance == 0 + </Original> + <Expanded> + 0.0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="array<int, N> -> toString" tags="[array][containers][toString]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + Catch::Detail::stringify( empty ) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + Catch::Detail::stringify( oneValue ) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" + </Original> + <Expanded> + "{ 42, 250 }" == "{ 42, 250 }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="atomic if" tags="[0][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + x == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="benchmark function call" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="without chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.started == 1 </Original> <Expanded> - 1 >= 1 + 1 == 1 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.finished == 0 </Original> <Expanded> - 2 >= 1 + 0 == 0 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.started == 1 </Original> <Expanded> - 4 >= 2 + 1 == 1 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.finished == 1 </Original> <Expanded> - 8 >= 4 + 1 == 1 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + called == 1 </Original> <Expanded> - 16 >= 8 + 1 == 1 </Expanded> </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="with chronometer" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.started == 0 </Original> <Expanded> - 32 >= 16 + 0 == 0 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.finished == 0 </Original> <Expanded> - 64 >= 32 + 0 == 0 </Expanded> </Expression> <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - x >= old_x + model.started == 0 </Original> <Expanded> - 128 >= 64 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - Timing.elapsed >= time + model.finished == 0 </Original> <Expanded> - 128 ns >= 100 ns + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - Timing.result == Timing.iterations + 17 + called == 1 </Original> <Expanded> - 145 == 145 + 1 == 1 </Expanded> </Expression> + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="boolean member" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + obj.prop != 0 + </Original> + <Expanded> + 0x<hex digits> != 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="checkedElse" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedElse( true ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="checkedElse, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_ELSE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedElse( false ) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="checkedIf" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedIf( true ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="checkedIf, failing" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + flag + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + testCheckedIf( false ) + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="classify_outliers" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Section name="none" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - Timing.iterations >= time.count() + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> - 128 >= 100 + 6 == 6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="second tag" tags="[tag2]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResult success="false"/> - </TestCase> - <TestCase name="send a single char to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Info> - 3 - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - false + o.low_severe == los </Original> <Expanded> - false + 0 == 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="sends information to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - hi - </Info> - <Info> - i := 7 - </Info> - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - false + o.low_mild == lom </Original> <Expanded> - false + 0 == 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="shortened hide tags are split apart" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > - <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) + o.high_mild == him </Original> <Expanded> - { ., magic-tag } ( Contains: magic-tag and Contains: . ) + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="splitString" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - splitStringRef("", ','), Equals(std::vector<StringRef>()) + o.high_severe == his </Original> <Expanded> - { } Equals: { } + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) + o.total() == los + lom + him + his </Original> <Expanded> - { abc } Equals: { abc } + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="low severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> - { abc, def } Equals: { abc, def } + 6 == 6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stacks unscoped info in loops" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > - <Info> - Count 1 to 3... - </Info> - <Info> - 1 - </Info> - <Info> - 2 - </Info> - <Info> - 3 - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - false + o.low_severe == los </Original> <Expanded> - false + 1 == 1 </Expanded> </Expression> - <Info> - Count 4 to 6... - </Info> - <Info> - 4 - </Info> - <Info> - 5 - </Info> - <Info> - 6 - </Info> - <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - false + o.low_mild == lom </Original> <Expanded> - false + 0 == 0 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="std::map is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( emptyMap ) == "{ }" - </Original> - <Expanded> - "{ }" == "{ }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" - </Original> - <Expanded> - "{ { "one", 1 } }" == "{ { "one", 1 } }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="several items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" - </Original> - <Expanded> - "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" -== -"{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="std::pair<int,const std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" + o.high_mild == him </Original> <Expanded> - "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="std::pair<int,std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" + o.high_severe == his </Original> <Expanded> - "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="std::set is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( emptySet ) == "{ }" - </Original> - <Expanded> - "{ }" == "{ }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( set ) == "{ \"one\" }" - </Original> - <Expanded> - "{ "one" }" == "{ "one" }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="several items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > - <Original> - Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" - </Original> - <Expanded> - "{ "abc", "def", "ghi" }" -== -"{ "abc", "def", "ghi" }" - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="std::vector<std::pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" + o.total() == los + lom + him + his </Original> <Expanded> - "{ { "green", 55 } }" -== -"{ { "green", 55 } }" + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="string literals of different sizes can be compared" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > - <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="low mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - std::string( "first" ) == "second" + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> - "first" == "second" + 6 == 6 </Expanded> </Expression> - <OverallResult success="false"/> - </TestCase> - <TestCase name="stringify ranges" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" + o.low_severe == los </Original> <Expanded> - "op<<(streamable_range)" -== -"op<<(streamable_range)" + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" + o.low_mild == lom </Original> <Expanded> - "stringmaker(streamable_range)" -== -"stringmaker(streamable_range)" + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" + o.high_mild == him </Original> <Expanded> - "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(disabled_range{}) == "{?}" + o.high_severe == his </Original> <Expanded> - "{?}" == "{?}" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_maker )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" + o.total() == los + lom + him + his </Original> <Expanded> - "StringMaker<has_maker>" -== -"StringMaker<has_maker>" + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="high mild" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> - "StringMaker<has_maker_and_operator>" -== -"StringMaker<has_maker_and_operator>" + 6 == 6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_neither )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify(item) == "{?}" + o.low_severe == los </Original> <Expanded> - "{?}" == "{?}" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" + o.low_mild == lom </Original> <Expanded> - "operator<<( has_operator )" -== -"operator<<( has_operator )" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_template_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" + o.high_mild == him </Original> <Expanded> - "operator<<( has_template_operator )" -== -"operator<<( has_template_operator )" + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( vectors<has_maker> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" + o.high_severe == his </Original> <Expanded> - "{ StringMaker<has_maker> }" -== -"{ StringMaker<has_maker> }" + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( vectors<has_maker_and_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" + o.total() == los + lom + him + his </Original> <Expanded> - "{ StringMaker<has_maker_and_operator> }" -== -"{ StringMaker<has_maker_and_operator> }" + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( vectors<has_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="high severe" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> - "{ operator<<( has_operator ) }" -== -"{ operator<<( has_operator ) }" + 6 == 6 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="strlen3" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - data.str.size() == data.len + o.low_severe == los </Original> <Expanded> - 3 == 3 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - data.str.size() == data.len + o.low_mild == lom </Original> <Expanded> - 3 == 3 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - data.str.size() == data.len + o.high_mild == him </Original> <Expanded> - 5 == 5 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - data.str.size() == data.len + o.high_severe == his </Original> <Expanded> - 4 == 4 + 1 == 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + o.total() == los + lom + him + his </Original> <Expanded> - 5 == 5 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="mixed" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + o.samples_seen == static_cast<int>(x.size()) </Original> <Expanded> 6 == 6 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + o.low_severe == los </Original> <Expanded> - 5 == 5 + 1 == 1 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + o.low_mild == lom </Original> <Expanded> - 6 == 6 + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="thrown std::strings are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > - Why would you throw a std::string? - </Exception> - <OverallResult success="false"/> - </TestCase> - <TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - result == "\"wide load\"" + o.high_mild == him </Original> <Expanded> - ""wide load"" == ""wide load"" + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + o.high_severe == his + </Original> + <Expanded> + 0 == 0 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString on const wchar_t pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > <Original> - result == "\"wide load\"" + o.total() == los + lom + him + his </Original> <Expanded> - ""wide load"" == ""wide load"" + 2 == 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString on wchar_t const pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="comparisons between const int variables" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_char_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_short_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_int_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + unsigned_long_var == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="comparisons between int variables" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_char_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_short_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_int_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Condition.tests.cpp" > + <Original> + long_var == unsigned_long_var + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="convertToBits" tags="[conversion][floating-point]" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( 0.f ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( -0.f ) == ( 1ULL << 31 ) + </Original> + <Expanded> + 2147483648 (0x<hex digits>) +== +2147483648 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( 0. ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( -0. ) == ( 1ULL << 63 ) + </Original> + <Expanded> + 9223372036854775808 (0x<hex digits>) +== +9223372036854775808 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/FloatingPoint.tests.cpp" > + <Original> + convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="empty tags are not allowed" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) + </Original> + <Expanded> + Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="erfc_inv" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(1.103560) == Approx(-0.09203687623843015) + </Original> + <Expanded> + -0.0920368762 == Approx( -0.0920368762 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(1.067400) == Approx(-0.05980291115763361) + </Original> + <Expanded> + -0.0598029112 == Approx( -0.0598029112 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + erfc_inv(0.050000) == Approx(1.38590382434967796) + </Original> + <Expanded> + 1.3859038243 == Approx( 1.3859038243 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="estimate_clock_resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.mean.count() == rate + </Original> + <Expanded> + 2000.0 == 2000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.outliers.total() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="even more nested SECTION tests" tags="[sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="c" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="d (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="c" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="e (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="f (leaf)" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="first tag" tags="[tag1]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="has printf" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > +loose text artifact + <OverallResult success="false"/> + </TestCase> + <TestCase name="just failure" tags="[.][fail][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + Previous info should not be seen + </Failure> + <OverallResult success="false"/> + </TestCase> + <TestCase name="just failure after unscoped info" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Failure filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + previous unscoped info SHOULD not be seen + </Failure> + <OverallResult success="false"/> + </TestCase> + <TestCase name="just info" tags="[info][isolated info][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="just unscoped info" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="long long" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + l == std::numeric_limits<long long>::max() + </Original> + <Expanded> + 9223372036854775807 (0x<hex digits>) +== +9223372036854775807 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="looped SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="b is currently: 0" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - result == "\"wide load\"" + b > a </Original> <Expanded> - ""wide load"" == ""wide load"" + 0 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString on wchar_t returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="b is currently: 1" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - result == "\"wide load\"" + b > a </Original> <Expanded> - ""wide load"" == ""wide load"" + 1 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString(enum class w/operator<<)" tags="[enum][enumClass][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="b is currently: 2" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e0) == "E2/V0" + b > a </Original> <Expanded> - "E2/V0" == "E2/V0" + 2 > 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 3" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e1) == "E2/V1" + b > a </Original> <Expanded> - "E2/V1" == "E2/V1" + 3 > 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 4" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e3) == "Unknown enum value 10" + b > a </Original> <Expanded> - "Unknown enum value 10" -== -"Unknown enum value 10" + 4 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString(enum class)" tags="[enum][enumClass][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 5" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e0) == "0" + b > a </Original> <Expanded> - "0" == "0" + 5 > 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 6" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e1) == "1" + b > a </Original> <Expanded> - "1" == "1" + 6 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString(enum w/operator<<)" tags="[enum][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 7" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e0) == "E2{0}" + b > a </Original> <Expanded> - "E2{0}" == "E2{0}" + 7 > 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 8" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e1) == "E2{1}" + b > a </Original> <Expanded> - "E2{1}" == "E2{1}" + 8 > 1 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="toString(enum)" tags="[enum][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="b is currently: 9" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(e0) == "0" + b > a + </Original> + <Expanded> + 9 > 1 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="looped tests" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Info> + Testing if fib[0] (1) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[1] (1) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[2] (2) is even + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[3] (3) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[4] (5) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[5] (8) is even + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[6] (13) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <Info> + Testing if fib[7] (21) is even + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + ( fib[i] % 2 ) == 0 + </Original> + <Expanded> + 1 == 0 + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="make_unique reimplementation" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="From lvalue copies" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(lval.has_moved) </Original> <Expanded> - "0" == "0" + !false </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="From rvalue moves" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - ::Catch::Detail::stringify(e1) == "1" + rval.has_moved </Original> <Expanded> - "1" == "1" + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Variadic constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - "{ }" == ::Catch::Detail::stringify(type{}) + *ptr == std::tuple<int, double, int>{1, 2., 3} </Original> <Expanded> - "{ }" == "{ }" + {?} == {?} </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="mean" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + m == 19. + </Original> + <Expanded> + 19.0 == 19.0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="measure" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x == 17 + </Original> + <Expanded> + 17 == 17 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x == 23 + </Original> + <Expanded> + 23 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.elapsed.count() == 42 + </Original> + <Expanded> + 42 == 42 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.result == 23 + </Original> + <Expanded> + 23 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + r.iterations == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.elapsed.count() == 69 + </Original> + <Expanded> + 69 == 69 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.result == 17 + </Original> + <Expanded> + 17 == 17 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + s.iterations == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="mix info, unscoped info and warning" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + info + </Info> + <Info> + unscoped info + </Info> + <Warning> + and warn may mix + </Warning> + <Info> + info + </Info> + <Info> + unscoped info + </Info> + <Warning> + they are not cleared after warnings + </Warning> + <OverallResult success="false"/> + </TestCase> + <TestCase name="more nested SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a == b + </Original> + <Expanded> + 1 == 2 + </Expanded> + </Expression> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <OverallResults successes="0" failures="1" expectedFailures="0"/> + </Section> + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a != b + </Original> + <Expanded> + 1 != 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="less than" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a < b + </Original> + <Expanded> + 1 < 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="false"/> + </TestCase> + <TestCase name="nested SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - "{ }" == ::Catch::Detail::stringify(value) + a != b </Original> <Expanded> - "{ }" == "{ }" + 1 != 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<float,int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - "1.2f" == ::Catch::Detail::stringify(float(1.2)) + b != a </Original> <Expanded> - "1.2f" == "1.2f" + 2 != 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + a != b + </Original> + <Expanded> + 1 != 2 + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="non streamable - with conv. op" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + s == "7" + </Original> + <Expanded> + "7" == "7" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="non-copyable objects" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + ti == typeid(int) + </Original> + <Expanded> + {?} == {?} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="normal_cdf" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(0.000000) == Approx(0.50000000000000000) + </Original> + <Expanded> + 0.5 == Approx( 0.5 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(1.000000) == Approx(0.84134474606854293) + </Original> + <Expanded> + 0.8413447461 == Approx( 0.8413447461 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(-1.000000) == Approx(0.15865525393145705) + </Original> + <Expanded> + 0.1586552539 == Approx( 0.1586552539 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(2.809729) == Approx(0.99752083845315409) + </Original> + <Expanded> + 0.9975208385 == Approx( 0.9975208385 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_cdf(-1.352570) == Approx(0.08809652095066035) + </Original> + <Expanded> + 0.088096521 == Approx( 0.088096521 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="normal_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.551780) == Approx(0.13015979861484198) + </Original> + <Expanded> + 0.1301597986 == Approx( 0.1301597986 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.533700) == Approx(0.08457408802851875) + </Original> + <Expanded> + 0.084574088 == Approx( 0.084574088 ) + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + normal_quantile(0.025000) == Approx(-1.95996398454005449) + </Original> + <Expanded> + -1.9599639845 == Approx( -1.9599639845 ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="not allowed" tags="[!throws]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="not prints unscoped info from previous failures" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this MAY be seen only for the FIRST assertion IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this MAY be seen only for the SECOND assertion IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this SHOULD be seen + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="null strings" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + makeString( false ) != static_cast<char*>(0) + </Original> + <Expanded> + "valid string" != {null string} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + makeString( true ) == static_cast<char*>(0) + </Original> + <Expanded> + {null string} == {null string} + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="null_ptr" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="pair<pair<int,const char *,pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Original> + ::Catch::Detail::stringify( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" + </Original> + <Expanded> + "{ { 42, "Arthur" }, { "Ford", 24 } }" +== +"{ { 42, "Arthur" }, { "Ford", 24 } }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="parseEnums" tags="[enums][Strings]" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Section name="No enums" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Original> - "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) + parseEnums( "" ), Equals( std::vector<Catch::StringRef>{} ) </Original> <Expanded> - "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + { } Equals: { } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="One enum value" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Original> - "{ 0 }" == ::Catch::Detail::stringify(type{0}) + parseEnums( "ClassName::EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) </Original> <Expanded> - "{ 0 }" == "{ 0 }" + { Value1 } Equals: { Value1 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<0,int,const char *>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Original> - "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) + parseEnums( "Value1" ), Equals( std::vector<Catch::StringRef>{"Value1"} ) </Original> <Expanded> - "{ 0, 42, "Catch me" }" -== -"{ 0, 42, "Catch me" }" + { Value1 } Equals: { Value1 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<string,string>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > <Original> - "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) + parseEnums( "EnumName::Value1" ), Equals(std::vector<Catch::StringRef>{"Value1"} ) </Original> <Expanded> - "{ "hello", "world" }" -== -"{ "hello", "world" }" + { Value1 } Equals: { Value1 } </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="tuple<tuple<int>,tuple<>,float>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Multiple enum values" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2"} ) + </Original> + <Expanded> + { Value1, Value2 } Equals: { Value1, Value2 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1, ClassName::EnumName::Value2, ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) + </Original> + <Expanded> + { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" > + <Original> + parseEnums( "ClassName::EnumName::Value1,ClassName::EnumName::Value2 , ClassName::EnumName::Value3" ), Equals( std::vector<Catch::StringRef>{"Value1", "Value2", "Value3"} ) + </Original> + <Expanded> + { Value1, Value2, Value3 } Equals: { Value1, Value2, Value3 } + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="pointer to class" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + p == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="print unscoped info if passing unscoped info is printed" tags="[info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this MAY be seen IF info is printed for passing assertions + </Info> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="prints unscoped info on failure" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this SHOULD be seen + </Info> + <Info> + this SHOULD also be seen + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="prints unscoped info only for the first assertion" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + this SHOULD be seen only ONCE + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Info> + this MAY also be seen only ONCE IF info is printed for passing assertions + </Info> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + true + </Original> + <Expanded> + true + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="random SECTION tests" tags="[.][failing][sections]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="doesn't equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) + a != b </Original> <Expanded> - "{ { 42 }, { }, 1.2f }" -== -"{ { 42 }, { }, 1.2f }" + 1 != 2 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="uniform samples" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - e.point == 23 + b != a </Original> <Expanded> - 23.0 == 23 + 2 != 1 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="not equal" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - e.upper_bound == 23 + a != b </Original> <Expanded> - 23.0 == 23 + 1 != 2 </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="replaceInPlace" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Section name="replace single char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - e.lower_bound == 23 + Catch::replaceInPlace(letters, "b", "z") </Original> <Expanded> - 23.0 == 23 + true </Expanded> </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - e.confidence_interval == 0.95 + letters == "azcdefcg" </Original> <Expanded> - 0.95 == 0.95 + "azcdefcg" == "azcdefcg" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="unique_ptr reimplementation: basic functionality" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Section name="Default constructed unique_ptr is empty" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - !(ptr) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() == naked_ptr - </Original> - <Expanded> - 0x<hex digits> == 0x<hex digits> - </Expanded> - </Expression> - <Section name="Plain reset deallocates" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - !(ptr) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="5" failures="0" expectedFailures="0"/> - </Section> - <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() == naked_ptr - </Original> - <Expanded> - 0x<hex digits> == 0x<hex digits> - </Expanded> - </Expression> - <Section name="Reset replaces ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() != 0 - </Original> - <Expanded> - 0x<hex digits> != 0 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <OverallResults successes="6" failures="0" expectedFailures="0"/> - </Section> - <Section name="Release releases ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - !(ptr) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr.get() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - !(ptr1) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr2 - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="Move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - !(ptr2) - </Original> - <Expanded> - !{?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - ptr1 - </Original> - <Expanded> - {?} - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr1 == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <OverallResults successes="3" failures="0" expectedFailures="0"/> - </Section> - <Section name="free swap" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr1 == 2 - </Original> - <Expanded> - 2 == 2 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > - <Original> - *ptr2 == 1 - </Original> - <Expanded> - 1 == 1 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vec<vec<string,alloc>> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="replace two chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + Catch::replaceInPlace(letters, "c", "z") + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(v) == "{ }" + letters == "abzdefzg" </Original> <Expanded> - "{ }" == "{ }" + "abzdefzg" == "abzdefzg" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="replace first char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" + Catch::replaceInPlace(letters, "a", "z") </Original> <Expanded> - "{ { "hello" }, { "world" } }" -== -"{ { "hello" }, { "world" } }" + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vector<bool> -> toString" tags="[containers][toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(bools) == "{ }" + letters == "zbcdefcg" </Original> <Expanded> - "{ }" == "{ }" + "zbcdefcg" == "zbcdefcg" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="replace last char" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(bools) == "{ true }" + Catch::replaceInPlace(letters, "g", "z") </Original> <Expanded> - "{ true }" == "{ true }" + true </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(bools) == "{ true, false }" + letters == "abcdefcz" </Original> <Expanded> - "{ true, false }" == "{ true, false }" + "abcdefcz" == "abcdefcz" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vector<int,allocator> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="replace all chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ }" + Catch::replaceInPlace(letters, letters, "replaced") </Original> <Expanded> - "{ }" == "{ }" + true + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + letters == "replaced" + </Original> + <Expanded> + "replaced" == "replaced" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="replace no chars" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + !(Catch::replaceInPlace(letters, "x", "z")) + </Original> + <Expanded> + !false </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ 42 }" + letters == letters </Original> <Expanded> - "{ 42 }" == "{ 42 }" + "abcdefcg" == "abcdefcg" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="escape '" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ 42, 250 }" + Catch::replaceInPlace(s, "'", "|'") </Original> <Expanded> - "{ 42, 250 }" == "{ 42, 250 }" + true </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vector<int> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + s == "didn|'t" + </Original> + <Expanded> + "didn|'t" == "didn|'t" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="resolution" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res.size() == count + </Original> + <Expanded> + 10 == 10 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + res[i] == rate + </Original> + <Expanded> + 1000.0 == 1000 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="run_for_at_least, chronometer" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 4 >= 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 8 >= 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 16 >= 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 32 >= 16 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 64 >= 32 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + meter.runs() >= old_runs + </Original> + <Expanded> + 128 >= 64 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.elapsed >= time + </Original> + <Expanded> + 128 ns >= 100 ns + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.result == Timing.iterations + 17 + </Original> + <Expanded> + 145 == 145 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.iterations >= time.count() + </Original> + <Expanded> + 128 >= 100 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="run_for_at_least, int" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 1 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 2 >= 1 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 4 >= 2 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 8 >= 4 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 16 >= 8 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 32 >= 16 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 64 >= 32 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + x >= old_x + </Original> + <Expanded> + 128 >= 64 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.elapsed >= time + </Original> + <Expanded> + 128 ns >= 100 ns + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.result == Timing.iterations + 17 + </Original> + <Expanded> + 145 == 145 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + Timing.iterations >= time.count() + </Original> + <Expanded> + 128 >= 100 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="second tag" tags="[tag2]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResult success="false"/> + </TestCase> + <TestCase name="send a single char to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Info> + 3 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="sends information to INFO" tags="[.][failing]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + hi + </Info> + <Info> + i := 7 + </Info> + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="shortened hide tags are split apart" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr) + </Original> + <Expanded> + { ., magic-tag } ( Contains: magic-tag and Contains: . ) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="splitString" tags="[string-manip]" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("", ','), Equals(std::vector<StringRef>()) + </Original> + <Expanded> + { } Equals: { } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("abc", ','), Equals(std::vector<StringRef>{"abc"}) + </Original> + <Expanded> + { abc } Equals: { abc } + </Expanded> + </Expression> + <Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/IntrospectiveTests/StringManip.tests.cpp" > + <Original> + splitStringRef("abc,def", ','), Equals(std::vector<StringRef>{"abc", "def"}) + </Original> + <Expanded> + { abc, def } Equals: { abc, def } + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stacks unscoped info in loops" tags="[.][failing][info][unscoped]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Info> + Count 1 to 3... + </Info> + <Info> + 1 + </Info> + <Info> + 2 + </Info> + <Info> + 3 + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <Info> + Count 4 to 6... + </Info> + <Info> + 4 + </Info> + <Info> + 5 + </Info> + <Info> + 6 + </Info> + <Expression success="false" type="CHECK" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > + <Original> + false + </Original> + <Expanded> + false + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="std::map is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ }" + Catch::Detail::stringify( emptyMap ) == "{ }" </Original> <Expanded> "{ }" == "{ }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ 42 }" + Catch::Detail::stringify( map ) == "{ { \"one\", 1 } }" </Original> <Expanded> - "{ 42 }" == "{ 42 }" + "{ { "one", 1 } }" == "{ { "one", 1 } }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="several items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ 42, 250 }" + Catch::Detail::stringify( map ) == "{ { \"abc\", 1 }, { \"def\", 2 }, { \"ghi\", 3 } }" </Original> <Expanded> - "{ 42, 250 }" == "{ 42, 250 }" + "{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" +== +"{ { "abc", 1 }, { "def", 2 }, { "ghi", 3 } }" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vector<string> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="std::pair<int,const std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Original> + ::Catch::Detail::stringify(value) == "{ 34, \"xyzzy\" }" + </Original> + <Expanded> + "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="std::pair<int,std::string> -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Original> + ::Catch::Detail::stringify( value ) == "{ 34, \"xyzzy\" }" + </Original> + <Expanded> + "{ 34, "xyzzy" }" == "{ 34, "xyzzy" }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="std::set is convertible string" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Section name="empty" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ }" + Catch::Detail::stringify( emptySet ) == "{ }" </Original> <Expanded> "{ }" == "{ }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="single item" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ \"hello\" }" + Catch::Detail::stringify( set ) == "{ \"one\" }" </Original> <Expanded> - "{ "hello" }" == "{ "hello" }" + "{ "one" }" == "{ "one" }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="several items" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringGeneral.tests.cpp" > <Original> - ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" + Catch::Detail::stringify( set ) == "{ \"abc\", \"def\", \"ghi\" }" </Original> <Expanded> - "{ "hello", "world" }" + "{ "abc", "def", "ghi" }" +== +"{ "abc", "def", "ghi" }" + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="std::vector<std::pair<std::string,int> > -> toString" tags="[pair][toString]" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringPair.tests.cpp" > + <Original> + ::Catch::Detail::stringify( pr ) == "{ { \"green\", 55 } }" + </Original> + <Expanded> + "{ { "green", 55 } }" +== +"{ { "green", 55 } }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="string literals of different sizes can be compared" tags="[.][failing][Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Expression success="false" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > + <Original> + std::string( "first" ) == "second" + </Original> + <Expanded> + "first" == "second" + </Expanded> + </Expression> + <OverallResult success="false"/> + </TestCase> + <TestCase name="stringify ranges" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" + </Original> + <Expanded> + "op<<(streamable_range)" +== +"op<<(streamable_range)" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" + </Original> + <Expanded> + "stringmaker(streamable_range)" +== +"stringmaker(streamable_range)" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" + </Original> + <Expanded> + "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(disabled_range{}) == "{?}" + </Original> + <Expanded> + "{?}" == "{?}" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_maker )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" + </Original> + <Expanded> + "StringMaker<has_maker>" +== +"StringMaker<has_maker>" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" + </Original> + <Expanded> + "StringMaker<has_maker_and_operator>" +== +"StringMaker<has_maker_and_operator>" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_neither )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify(item) == "{?}" + </Original> + <Expanded> + "{?}" == "{?}" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" + </Original> + <Expanded> + "operator<<( has_operator )" +== +"operator<<( has_operator )" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( has_template_operator )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( item ) == "operator<<( has_template_operator )" + </Original> + <Expanded> + "operator<<( has_template_operator )" +== +"operator<<( has_template_operator )" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_maker> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" + </Original> + <Expanded> + "{ StringMaker<has_maker> }" +== +"{ StringMaker<has_maker> }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_maker_and_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" + </Original> + <Expanded> + "{ StringMaker<has_maker_and_operator> }" +== +"{ StringMaker<has_maker_and_operator> }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_operator> )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Original> + ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" + </Original> + <Expanded> + "{ operator<<( has_operator ) }" +== +"{ operator<<( has_operator ) }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="strlen3" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 3 == 3 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + data.str.size() == data.len + </Original> + <Expanded> + 4 == 4 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tables" tags="[generators]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" > + <Original> + strlen(std::get<0>(data)) == static_cast<size_t>(std::get<1>(data)) + </Original> + <Expanded> + 6 == 6 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tags with dots in later positions are not parsed as hidden" tags="[tags]" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags.size() == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/Tag.tests.cpp" > + <Original> + testcase.tags[0].original == "magic.tag"_catch_sr + </Original> + <Expanded> + magic.tag == magic.tag + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="thrown std::strings are translated" tags="[!throws][.][failing]" filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + <Exception filename="tests/<exe-name>/UsageTests/Exception.tests.cpp" > + Why would you throw a std::string? + </Exception> + <OverallResult success="false"/> + </TestCase> + <TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + result == "\"wide load\"" + </Original> + <Expanded> + ""wide load"" == ""wide load"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString on const wchar_t pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + result == "\"wide load\"" + </Original> + <Expanded> + ""wide load"" == ""wide load"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString on wchar_t const pointer returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + result == "\"wide load\"" + </Original> + <Expanded> + ""wide load"" == ""wide load"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString on wchar_t returns the string contents" tags="[toString]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + result == "\"wide load\"" + </Original> + <Expanded> + ""wide load"" == ""wide load"" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString(enum class w/operator<<)" tags="[enum][enumClass][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "E2/V0" + </Original> + <Expanded> + "E2/V0" == "E2/V0" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e1) == "E2/V1" + </Original> + <Expanded> + "E2/V1" == "E2/V1" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e3) == "Unknown enum value 10" + </Original> + <Expanded> + "Unknown enum value 10" +== +"Unknown enum value 10" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString(enum class)" tags="[enum][enumClass][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "0" + </Original> + <Expanded> + "0" == "0" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e1) == "1" + </Original> + <Expanded> + "1" == "1" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString(enum w/operator<<)" tags="[enum][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "E2{0}" + </Original> + <Expanded> + "E2{0}" == "E2{0}" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e1) == "E2{1}" + </Original> + <Expanded> + "E2{1}" == "E2{1}" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString(enum)" tags="[enum][toString]" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e0) == "0" + </Original> + <Expanded> + "0" == "0" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/EnumToString.tests.cpp" > + <Original> + ::Catch::Detail::stringify(e1) == "1" + </Original> + <Expanded> + "1" == "1" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ }" == ::Catch::Detail::stringify(type{}) + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ }" == ::Catch::Detail::stringify(value) + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<float,int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "1.2f" == ::Catch::Detail::stringify(float(1.2)) + </Original> + <Expanded> + "1.2f" == "1.2f" + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) + </Original> + <Expanded> + "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<int>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ 0 }" == ::Catch::Detail::stringify(type{0}) + </Original> + <Expanded> + "{ 0 }" == "{ 0 }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<0,int,const char *>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) + </Original> + <Expanded> + "{ 0, 42, "Catch me" }" +== +"{ 0, 42, "Catch me" }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<string,string>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) + </Original> + <Expanded> + "{ "hello", "world" }" == "{ "hello", "world" }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="tuple<tuple<int>,tuple<>,float>" tags="[toString][tuple]" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/UsageTests/ToStringTuple.tests.cpp" > + <Original> + "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) + </Original> + <Expanded> + "{ { 42 }, { }, 1.2f }" +== +"{ { 42 }, { }, 1.2f }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="uniform samples" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.point == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.upper_bound == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.lower_bound == 23 + </Original> + <Expanded> + 23.0 == 23 + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + e.confidence_interval == 0.95 + </Original> + <Expanded> + 0.95 == 0.95 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="unique_ptr reimplementation: basic functionality" tags="[internals][unique-ptr]" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Section name="Default constructed unique_ptr is empty" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr) + </Original> + <Expanded> + !{?} </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="vectors can be sized and resized" tags="[vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.size() == 5 + ptr.get() == 0 </Original> <Expanded> - 5 == 5 + 0 == 0 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.capacity() >= 5 + ptr </Original> <Expanded> - 5 >= 5 + {?} </Expanded> </Expression> - <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == naked_ptr + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Section name="Plain reset deallocates" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.size() == 10 + !(ptr) </Original> <Expanded> - 10 == 10 + !{?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.capacity() >= 10 + ptr.get() == 0 </Original> <Expanded> - 10 >= 10 + 0 == 0 </Expanded> </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="5" failures="0" expectedFailures="0"/> + </Section> + <Section name="Take ownership of allocation" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.size() == 5 + ptr </Original> <Expanded> - 5 == 5 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.capacity() >= 5 + *ptr == 0 </Original> <Expanded> - 5 >= 5 + 0 == 0 </Expanded> </Expression> - <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == naked_ptr + </Original> + <Expanded> + 0x<hex digits> == 0x<hex digits> + </Expanded> + </Expression> + <Section name="Reset replaces ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.size() == 0 + ptr </Original> <Expanded> - 0 == 0 + {?} </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.capacity() >= 5 + ptr.get() != 0 </Original> <Expanded> - 5 >= 5 + 0x<hex digits> != 0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr == 2 + </Original> + <Expanded> + 2 == 2 </Expanded> </Expression> - <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() == 0 - </Original> - <Expanded> - 0 == 0 - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> <OverallResults successes="3" failures="0" expectedFailures="0"/> </Section> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="6" failures="0" expectedFailures="0"/> + </Section> + <Section name="Release releases ownership" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > <Original> - v.size() == 5 + !(ptr) </Original> <Expanded> - 5 == 5 + !{?} + </Expanded> + </Expression> + <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr.get() == 0 + </Original> + <Expanded> + 0 == 0 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Section name="Move constructor" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr1) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr2 + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr2 == 1 + </Original> + <Expanded> + 1 == 1 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="Move assignment" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + !(ptr2) + </Original> + <Expanded> + !{?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + ptr1 + </Original> + <Expanded> + {?} + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr1 == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Section name="free swap" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr1 == 2 + </Original> + <Expanded> + 2 == 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/UniquePtr.tests.cpp" > + <Original> + *ptr2 == 1 + </Original> + <Expanded> + 1 == 1 </Expanded> </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vec<vec<string,alloc>> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(v) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" + </Original> + <Expanded> + "{ { "hello" }, { "world" } }" +== +"{ { "hello" }, { "world" } }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vector<bool> -> toString" tags="[containers][toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(bools) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(bools) == "{ true }" + </Original> + <Expanded> + "{ true }" == "{ true }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(bools) == "{ true, false }" + </Original> + <Expanded> + "{ true, false }" == "{ true, false }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vector<int,allocator> -> toString" tags="[toString][vector,allocator]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42, 250 }" + </Original> + <Expanded> + "{ 42, 250 }" == "{ 42, 250 }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vector<int> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42 }" + </Original> + <Expanded> + "{ 42 }" == "{ 42 }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ 42, 250 }" + </Original> + <Expanded> + "{ 42, 250 }" == "{ 42, 250 }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vector<string> -> toString" tags="[toString][vector]" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ }" + </Original> + <Expanded> + "{ }" == "{ }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ \"hello\" }" + </Original> + <Expanded> + "{ "hello" }" == "{ "hello" }" + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringVector.tests.cpp" > + <Original> + ::Catch::Detail::stringify(vv) == "{ \"hello\", \"world\" }" + </Original> + <Expanded> + "{ "hello", "world" }" +== +"{ "hello", "world" }" + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="vectors can be sized and resized" tags="[vector]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing bigger changes size and capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.size() == 10 </Original> <Expanded> - 5 >= 5 + 10 == 10 </Expanded> </Expression> - <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.capacity() >= 10 - </Original> - <Expanded> - 10 >= 10 - </Expanded> - </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> - </Section> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.size() == 5 + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="resizing smaller changes size but not capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 0 </Original> <Expanded> - 5 == 5 + 0 == 0 </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > @@ -19639,85 +19786,146 @@ loose text artifact 5 >= 5 </Expanded> </Expression> - <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Original> - v.size() == 5 - </Original> - <Expanded> - 5 == 5 - </Expanded> - </Expression> + <Section name="We can use the 'swap trick' to reset the capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - v.capacity() >= 5 + v.capacity() == 0 </Original> <Expanded> - 5 >= 5 + 0 == 0 </Expanded> </Expression> - <OverallResults successes="2" failures="0" expectedFailures="0"/> + <OverallResults successes="1" failures="0" expectedFailures="0"/> </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="warmup" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Original> - (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() - </Original> - <Expanded> - 160000000 (0x<hex digits>) > 100 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <OverallResults successes="3" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving bigger changes capacity but not size" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - (end - start) > Catch::Benchmark::Detail::warmup_time + v.size() == 5 </Original> <Expanded> - 310016000 ns > 100 ms + 5 == 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="weighted_average_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - q1 == 14.5 - </Original> - <Expanded> - 14.5 == 14.5 - </Expanded> - </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + v.capacity() >= 10 + </Original> + <Expanded> + 10 >= 10 + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.size() == 5 + </Original> + <Expanded> + 5 == 5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Original> + v.capacity() >= 5 + </Original> + <Expanded> + 5 >= 5 + </Expanded> + </Expression> + <Section name="reserving smaller does not change size or capacity" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - med == 18. + v.size() == 5 </Original> <Expanded> - 18.0 == 18.0 + 5 == 5 </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - q3 == 23. + v.capacity() >= 5 </Original> <Expanded> - 23.0 == 23.0 + 5 >= 5 </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="xmlentitycheck" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <Section name="embedded xml: <test>it should be possible to embed xml characters, such as <, " or &, or even whole <xml>documents</xml> within an attribute</test>" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="encoded chars: these should all be encoded: &&&"""<<<&"<<&"" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <OverallResults successes="1936" failures="149" expectedFailures="21"/> - <OverallResultsCases successes="266" failures="86" expectedFailures="4"/> - </Group> - <OverallResults successes="1936" failures="148" expectedFailures="21"/> - <OverallResultsCases successes="266" failures="86" expectedFailures="4"/> -</Catch> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="warmup" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + (iterations * rate) > Catch::Benchmark::Detail::warmup_time.count() + </Original> + <Expanded> + 160000000 (0x<hex digits>) > 100 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + (end - start) > Catch::Benchmark::Detail::warmup_time + </Original> + <Expanded> + 310016000 ns > 100 ms + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="weighted_average_quantile" tags="[benchmark]" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + q1 == 14.5 + </Original> + <Expanded> + 14.5 == 14.5 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + med == 18. + </Original> + <Expanded> + 18.0 == 18.0 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp" > + <Original> + q3 == 23. + </Original> + <Expanded> + 23.0 == 23.0 + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="xmlentitycheck" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <Section name="embedded xml: <test>it should be possible to embed xml characters, such as <, " or &, or even whole <xml>documents</xml> within an attribute</test>" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="encoded chars: these should all be encoded: &&&"""<<<&"<<&"" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <OverallResults successes="1951" failures="146" expectedFailures="23"/> + <OverallResultsCases successes="276" failures="86" expectedFailures="6"/> +</Catch2TestRun> diff --git a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/10.tests.cpp b/packages/Catch2/tests/SelfTest/CompileTimePerfTests/10.tests.cpp deleted file mode 100644 index 01cd072d9fbd307f749290f1b0a33d6564c5e348..0000000000000000000000000000000000000000 --- a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/10.tests.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Include set of usage tests multiple times - for compile-time performance testing -// (do not run) - -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" -#include "All.tests.cpp" diff --git a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/100.tests.cpp b/packages/Catch2/tests/SelfTest/CompileTimePerfTests/100.tests.cpp deleted file mode 100644 index e03ca838284c64d6e5bcc572c4a97d75699080ed..0000000000000000000000000000000000000000 --- a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/100.tests.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// Include set of usage tests multiple times - for compile-time performance testing -// (do not run) - -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" -#include "10.tests.cpp" diff --git a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/All.tests.cpp b/packages/Catch2/tests/SelfTest/CompileTimePerfTests/All.tests.cpp deleted file mode 100644 index 2b6a1029141d1772766271b2f1ae22b83941a57e..0000000000000000000000000000000000000000 --- a/packages/Catch2/tests/SelfTest/CompileTimePerfTests/All.tests.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// include set of usage tests into one file for compiler performance test purposes -// This whole file can now be included multiple times in 10.tests.cpp, and *that* -// file included multiple times (in 100.tests.cpp) - -// Note that the intention is only for these files to be compiled. They will -// fail at runtime due to the re-user of test case names - -#include "../UsageTests/Approx.tests.cpp" -#include "../UsageTests/BDD.tests.cpp" -#include "../UsageTests/Class.tests.cpp" -#include "../UsageTests/Compilation.tests.cpp" -#include "../UsageTests/Condition.tests.cpp" -#include "../UsageTests/Exception.tests.cpp" -#include "../UsageTests/Matchers.tests.cpp" -#include "../UsageTests/Misc.tests.cpp" diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7a1ca110a265270c35125c96a8281bad23f8577d --- /dev/null +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/FloatingPoint.tests.cpp @@ -0,0 +1,66 @@ +#include <catch2/catch_test_macros.hpp> +#include <catch2/catch_template_test_macros.hpp> +#include <catch2/internal/catch_floating_point_helpers.hpp> + + +TEST_CASE("convertToBits", "[floating-point][conversion]") { + using Catch::Detail::convertToBits; + + CHECK( convertToBits( 0.f ) == 0 ); + CHECK( convertToBits( -0.f ) == ( 1ULL << 31 ) ); + CHECK( convertToBits( 0. ) == 0 ); + CHECK( convertToBits( -0. ) == ( 1ULL << 63 ) ); + CHECK( convertToBits( std::numeric_limits<float>::denorm_min() ) == 1 ); + CHECK( convertToBits( std::numeric_limits<double>::denorm_min() ) == 1 ); +} + +TEMPLATE_TEST_CASE("type-shared ulpDistance tests", "[floating-point][ulp][approvals]", float, double) { + using FP = TestType; + using Catch::ulpDistance; + + // Distance between zeros is zero + CHECK( ulpDistance( FP{}, FP{} ) == 0 ); + CHECK( ulpDistance( FP{}, -FP{} ) == 0 ); + CHECK( ulpDistance( -FP{}, -FP{} ) == 0 ); + + // Distance between same-sign infinities is zero + static constexpr FP infinity = std::numeric_limits<FP>::infinity(); + CHECK( ulpDistance( infinity, infinity ) == 0 ); + CHECK( ulpDistance( -infinity, -infinity ) == 0 ); + + // Distance between max-finite-val and same sign infinity is 1 + static constexpr FP max_finite = std::numeric_limits<FP>::max(); + CHECK( ulpDistance( max_finite, infinity ) == 1 ); + CHECK( ulpDistance( -max_finite, -infinity ) == 1 ); + + // Distance between X and 0 is half of distance between X and -X + CHECK( ulpDistance( -infinity, infinity ) == + 2 * ulpDistance( infinity, FP{} ) ); + CHECK( 2 * ulpDistance( FP{ -2. }, FP{} ) == + ulpDistance( FP{ -2. }, FP{ 2. } ) ); + CHECK( 2 * ulpDistance( FP{ 2. }, FP{} ) == + ulpDistance( FP{ -2. }, FP{ 2. } ) ); + + // Denorms are supported + CHECK( ulpDistance( std::numeric_limits<FP>::denorm_min(), FP{} ) == 1 ); + CHECK( ulpDistance( std::numeric_limits<FP>::denorm_min(), -FP{} ) == 1 ); + CHECK( ulpDistance( -std::numeric_limits<FP>::denorm_min(), FP{} ) == 1 ); + CHECK( ulpDistance( -std::numeric_limits<FP>::denorm_min(), -FP{} ) == 1 ); + CHECK( ulpDistance( std::numeric_limits<FP>::denorm_min(), + -std::numeric_limits<FP>::denorm_min() ) == 2 ); + + // Machine epsilon + CHECK( ulpDistance( FP{ 1. }, + FP{ 1. } + std::numeric_limits<FP>::epsilon() ) == 1 ); + CHECK( ulpDistance( -FP{ 1. }, + -FP{ 1. } - std::numeric_limits<FP>::epsilon() ) == 1 ); +} + +TEST_CASE("UlpDistance", "[floating-point][ulp][approvals]") { + using Catch::ulpDistance; + + CHECK( ulpDistance( 1., 2. ) == 0x10'00'00'00'00'00'00 ); + CHECK( ulpDistance( -2., 2. ) == 0x80'00'00'00'00'00'00'00 ); + CHECK( ulpDistance( 1.f, 2.f ) == 0x80'00'00 ); + CHECK( ulpDistance( -2.f, 2.f ) == 0x80'00'00'00 ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp index 0a3895a854c4bb5a6e71872af5421c87ea333b70..19fa8f9531999931a51e34b5d7bd6139d1d17410 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/InternalBenchmark.tests.cpp @@ -412,3 +412,29 @@ TEST_CASE("run benchmark", "[benchmark][approvals]") { CHECK((end - start).count() == 2867251000); } + +TEST_CASE("Failing benchmarks", "[!benchmark][.approvals]") { + SECTION("empty", "Benchmark that has been optimized away (because it is empty)") { + BENCHMARK("Empty benchmark") {}; + } + SECTION("throw", "Benchmark that throws an exception") { + BENCHMARK("Throwing benchmark") { + throw "just a plain literal, bleh"; + }; + } + SECTION("assert", "Benchmark that asserts inside") { + BENCHMARK("Asserting benchmark") { + REQUIRE(1 == 2); + }; + } + SECTION("fail", "Benchmark that fails inside") { + BENCHMARK("FAIL'd benchmark") { + FAIL("This benchmark only fails, nothing else"); + }; + } +} + +TEST_CASE( "Failing benchmark respects should-fail", + "[!shouldfail][!benchmark][.approvals]" ) { + BENCHMARK( "Asserting benchmark" ) { REQUIRE( 1 == 2 ); }; +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp index dbc8190b3706d3c073e17f42e287650674344d46..4b9cc0e3668690a52ee1c6228328de93e0e2612e 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/String.tests.cpp @@ -10,29 +10,23 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { StringRef empty; REQUIRE( empty.empty() ); REQUIRE( empty.size() == 0 ); - REQUIRE( empty.isNullTerminated() ); - REQUIRE( std::strcmp( empty.c_str(), "" ) == 0 ); + REQUIRE( std::strcmp( empty.data(), "" ) == 0 ); } SECTION( "From string literal" ) { StringRef s = "hello"; REQUIRE( s.empty() == false ); REQUIRE( s.size() == 5 ); - REQUIRE( s.isNullTerminated() ); auto rawChars = s.data(); REQUIRE( std::strcmp( rawChars, "hello" ) == 0 ); - REQUIRE_NOTHROW(s.c_str()); - REQUIRE(s.c_str() == rawChars); REQUIRE(s.data() == rawChars); } SECTION( "From sub-string" ) { StringRef original = StringRef( "original string" ).substr(0, 8); REQUIRE( original == "original" ); - REQUIRE_FALSE(original.isNullTerminated()); - REQUIRE_THROWS(original.c_str()); REQUIRE_NOTHROW(original.data()); } @@ -51,7 +45,7 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { SECTION( "non-zero-based substring") { ss = s.substr( 6, 6 ); REQUIRE( ss.size() == 6 ); - REQUIRE( std::strcmp( ss.c_str(), "world!" ) == 0 ); + REQUIRE( std::strcmp( ss.data(), "world!" ) == 0 ); } SECTION( "Pointer values of full refs should match" ) { @@ -69,7 +63,7 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { SECTION("Substring off the end are trimmed") { ss = s.substr(6, 123); - REQUIRE(std::strcmp(ss.c_str(), "world!") == 0); + REQUIRE(std::strcmp(ss.data(), "world!") == 0); } SECTION("substring start after the end is empty") { REQUIRE(s.substr(1'000'000, 1).empty()); @@ -147,7 +141,6 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") { constexpr StringRef stringref(abc, 3); STATIC_REQUIRE(stringref.size() == 3); - STATIC_REQUIRE(stringref.isNullTerminated()); STATIC_REQUIRE(stringref.data() == abc); STATIC_REQUIRE(stringref.begin() == abc); STATIC_REQUIRE(stringref.begin() != stringref.end()); @@ -160,19 +153,15 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") { STATIC_REQUIRE(shortened.size() == 2); STATIC_REQUIRE(shortened.data() == abc); STATIC_REQUIRE(shortened.begin() != shortened.end()); - STATIC_REQUIRE_FALSE(shortened.isNullTerminated()); - STATIC_REQUIRE_FALSE(shortened.substr(1, 3).isNullTerminated()); } SECTION("UDL construction") { constexpr auto sr1 = "abc"_catch_sr; STATIC_REQUIRE_FALSE(sr1.empty()); STATIC_REQUIRE(sr1.size() == 3); - STATIC_REQUIRE(sr1.isNullTerminated()); using Catch::operator"" _sr; constexpr auto sr2 = ""_sr; STATIC_REQUIRE(sr2.empty()); STATIC_REQUIRE(sr2.size() == 0); - STATIC_REQUIRE(sr2.isNullTerminated()); } } diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp index 15d37c98b67c9929fe95a75ccca0506886f55b4b..a74b31599e0e99f1ddeb030da14fc6a712d4c008 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Tag.tests.cpp @@ -39,14 +39,33 @@ TEST_CASE( "Tag alias can be registered against tag patterns" ) { } } -TEST_CASE("shortened hide tags are split apart") { +// Dummy line info for creating dummy test cases below +constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; + +TEST_CASE("shortened hide tags are split apart", "[tags]") { using Catch::StringRef; using Catch::Matchers::VectorContains; - auto testcase = Catch::makeTestCaseInfo("", {"fake test name", "[.magic-tag]"}, CATCH_INTERNAL_LINEINFO); - // Transform ... + Catch::TestCaseInfo testcase("", {"fake test name", "[.magic-tag]"}, dummySourceLineInfo); + + // Extract parsed tags into strings std::vector<StringRef> tags; - for (auto const& tag : testcase->tags) { - tags.push_back(tag.original); + for (auto const& tag : testcase.tags) { + tags.push_back(tag.lowerCased); } REQUIRE_THAT(tags, VectorContains("magic-tag"_catch_sr) && VectorContains("."_catch_sr)); } + +TEST_CASE("tags with dots in later positions are not parsed as hidden", "[tags]") { + using Catch::StringRef; + using Catch::Matchers::VectorContains; + Catch::TestCaseInfo testcase("", { "fake test name", "[magic.tag]" }, dummySourceLineInfo); + + REQUIRE(testcase.tags.size() == 1); + REQUIRE(testcase.tags[0].original == "magic.tag"_catch_sr); +} + +TEST_CASE( "empty tags are not allowed", "[tags]" ) { + REQUIRE_THROWS( + Catch::TestCaseInfo("", { "test with an empty tag", "[]" }, dummySourceLineInfo) + ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp index 47dfdd37f6ae9c1a71e17df297a66b59df2991d6..c0415dc329a13fff0c1d92670d1e0b89ca4fda32 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp @@ -1,6 +1,7 @@ #include <catch2/internal/catch_enum_values_registry.hpp> #include <catch2/matchers/catch_matchers_vector.hpp> #include <catch2/catch_test_macros.hpp> +#include <catch2/catch_template_test_macros.hpp> enum class EnumClass3 { Value1, Value2, Value3, Value4 }; @@ -50,4 +51,39 @@ TEST_CASE( "Directly creating an EnumInfo" ) { TEST_CASE("Range type with sentinel") { CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" ); -} \ No newline at end of file +} + +TEST_CASE("convertIntoString stringification helper", "[toString][approvals]") { + using namespace std::string_literals; + using Catch::Detail::convertIntoString; + using namespace Catch; + + SECTION("No escaping") { + CHECK(convertIntoString(""_sr, false) == R"("")"s); + CHECK(convertIntoString("abcd"_sr, false) == R"("abcd")"s); + CHECK(convertIntoString("ab\ncd"_sr, false) == "\"ab\ncd\""s); + CHECK(convertIntoString("ab\r\ncd"_sr, false) == "\"ab\r\ncd\""s); + CHECK(convertIntoString("ab\"cd"_sr, false) == R"("ab"cd")"s); + } + SECTION("Escaping invisibles") { + CHECK(convertIntoString(""_sr, true) == R"("")"s); + CHECK(convertIntoString("ab\ncd"_sr, true) == R"("ab\ncd")"s); + CHECK(convertIntoString("ab\r\ncd"_sr, true) == R"("ab\r\ncd")"s); + CHECK(convertIntoString("ab\tcd"_sr, true) == R"("ab\tcd")"s); + CHECK(convertIntoString("ab\fcd"_sr, true) == R"("ab\fcd")"s); + CHECK(convertIntoString("ab\"cd"_sr, true) == R"("ab"cd")"s); + } +} + +TEMPLATE_TEST_CASE( "Stringifying char arrays with statically known sizes", + "[toString]", + char, + signed char, + unsigned char ) { + using namespace std::string_literals; + TestType with_null_terminator[10] = "abc"; + CHECK( ::Catch::Detail::stringify( with_null_terminator ) == R"("abc")"s ); + + TestType no_null_terminator[3] = { 'a', 'b', 'c' }; + CHECK( ::Catch::Detail::stringify( no_null_terminator ) == R"("abc")"s ); +} diff --git a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp index 2d375a22918a69097a3a24df6eda569a18a00bb3..c98d66ef2a87ce52f439d7aa9fe86202c2863d25 100644 --- a/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp +++ b/packages/Catch2/tests/SelfTest/IntrospectiveTests/Xml.tests.cpp @@ -2,6 +2,9 @@ #include <catch2/internal/catch_xmlwriter.hpp> #include <catch2/internal/catch_stream.hpp> +#include <catch2/matchers/catch_matchers_string.hpp> + +#include <sstream> static std::string encode( std::string const& str, Catch::XmlEncode::ForWhat forWhat = Catch::XmlEncode::ForTextNodes ) { Catch::ReusableStringStream oss; @@ -112,3 +115,19 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { } #undef ESC } + +TEST_CASE("XmlWriter writes boolean attributes as true/false", "[XML][XmlWriter]") { + using Catch::Matchers::Contains; + std::stringstream stream; + { + Catch::XmlWriter xml(stream); + + xml.scopedElement("Element1") + .writeAttribute("attr1", true) + .writeAttribute("attr2", false); + } + + REQUIRE_THAT( stream.str(), + Contains(R"(attr1="true")") && + Contains(R"(attr2="false")") ); +} diff --git a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp index cb8376bdb51f399e79f3d7861e0d250c1d4e130e..45a01c027289f52d0c1da305ef45c9600057e983 100644 --- a/packages/Catch2/tests/SelfTest/TestRegistrations.cpp +++ b/packages/Catch2/tests/SelfTest/TestRegistrations.cpp @@ -1,14 +1,21 @@ -/* - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 #include <catch2/catch_tag_alias_autoregistrar.hpp> #include <catch2/reporters/catch_reporter_event_listener.hpp> +#include <catch2/internal/catch_enforce.hpp> +#include <catch2/catch_test_case_info.hpp> +#include <catch2/catch_reporter_registrars.hpp> + // Some example tag aliases -CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" ) -CATCH_REGISTER_TAG_ALIAS( "[@tricky]", "[tricky]~[.]" ) +CATCH_REGISTER_TAG_ALIAS("[@nhf]", "[failing]~[.]") +CATCH_REGISTER_TAG_ALIAS("[@tricky]", "[tricky]~[.]") #ifdef __clang__ # pragma clang diagnostic ignored "-Wpadded" @@ -16,11 +23,155 @@ CATCH_REGISTER_TAG_ALIAS( "[@tricky]", "[tricky]~[.]" ) # pragma clang diagnostic ignored "-Wc++98-compat" #endif +/** + * Event listener that internally counts and validates received events. + * + * Currently only performs validation by counting received events, rather + * than performing full matching. This means that it won't fail if the *Ended + * events are provided in wrong order, as long as they come in the right amount + * and with the right nesting. + */ +class ValidatingTestListener : public Catch::EventListenerBase { + struct EventCounter { + int starting = 0; + int ended = 0; + + bool hasActiveEvent() const { + return starting > ended; + } + bool hasSingleActiveEvent() const { + return starting - 1 == ended; + } + bool allEventsEnded() const { + return starting == ended; + } + }; + +public: + ValidatingTestListener(Catch::ReporterConfig const& config) : + EventListenerBase(config) { + m_preferences.shouldReportAllAssertions = true; + } + + void testRunStarting( Catch::TestRunInfo const& ) override { + CATCH_ENFORCE( m_testRunCounter.starting == 0, + "Test run can only start once" ); + ++m_testRunCounter.starting; + } + void testCaseStarting(Catch::TestCaseInfo const&) override { + CATCH_ENFORCE( m_testRunCounter.hasActiveEvent(), + "Test case can only be started if the test run has already started" ); + CATCH_ENFORCE( m_testCaseCounter.allEventsEnded(), + "Test case cannot start if there is an unfinished one" ); + + ++m_testCaseCounter.starting; + + // Reset the part tracking for partial test case events + m_lastSeenPartNumber = -1; + } + + void testCasePartialStarting(Catch::TestCaseInfo const&, + uint64_t partNumber) override { + CATCH_ENFORCE( m_testCaseCounter.hasSingleActiveEvent(), + "Test case can only be partially started if the test case has fully started already" ); + CATCH_ENFORCE( m_lastSeenPartNumber + 1 == partNumber, + "Partial test case started out of order" ); + + ++m_testCasePartialCounter.starting; + m_lastSeenPartNumber = partNumber; + } + + void sectionStarting(Catch::SectionInfo const&) override { + CATCH_ENFORCE( m_testCaseCounter.hasSingleActiveEvent(), + "Section can only start in a test case" ); + CATCH_ENFORCE( m_testCasePartialCounter.hasSingleActiveEvent(), + "Section can only start in a test case" ); + + ++m_sectionCounter.starting; + } + + void assertionStarting(Catch::AssertionInfo const&) override { + CATCH_ENFORCE( m_testCaseCounter.hasSingleActiveEvent(), + "Assertion can only start if test case is started" ); -struct TestListener : Catch::EventListenerBase { - using EventListenerBase::EventListenerBase; + ++m_assertionCounter.starting; + } + void assertionEnded(Catch::AssertionStats const&) override { + // todo: + // * Check that assertions are balanced + // * Check that assertions has started + ++m_assertionCounter.ended; + } + + void sectionEnded(Catch::SectionStats const&) override { + CATCH_ENFORCE( m_sectionCounter.hasActiveEvent(), + "Section ended without corresponding start" ); + // TODO: Check that all assertions ended + + ++m_sectionCounter.ended; + } + + + void testCasePartialEnded(Catch::TestCaseStats const&, + uint64_t partNumber) override { + CATCH_ENFORCE( m_lastSeenPartNumber == partNumber, + "Partial test case ended out of order" ); + CATCH_ENFORCE( m_testCasePartialCounter.hasSingleActiveEvent(), + "Partial test case ended without corresponding start" ); + CATCH_ENFORCE( m_sectionCounter.allEventsEnded(), + "Partial test case ended with unbalanced sections" ); + // TODO: Check that all assertions ended + + ++m_testCasePartialCounter.ended; + } + + + void testCaseEnded(Catch::TestCaseStats const&) override { + CATCH_ENFORCE( m_testCaseCounter.hasSingleActiveEvent(), + "Test case end is not matched with test case start" ); + CATCH_ENFORCE( m_testCasePartialCounter.allEventsEnded(), + "A partial test case has not ended" ); + CATCH_ENFORCE( m_sectionCounter.allEventsEnded(), + "Test case ended with unbalanced sections" ); + + // TODO: Check that all assertions ended + + ++m_testCaseCounter.ended; + } + void testRunEnded( Catch::TestRunStats const& ) override { + CATCH_ENFORCE( m_testRunCounter.hasSingleActiveEvent(), + "Test run end is not matched with test run start" ); + CATCH_ENFORCE( m_testRunCounter.ended == 0, + "Test run can only end once" ); + + ++m_testRunCounter.ended; + } + + ~ValidatingTestListener() override; + +private: + EventCounter m_testRunCounter; + EventCounter m_testCaseCounter; + EventCounter m_testCasePartialCounter; + uint64_t m_lastSeenPartNumber = 0; + EventCounter m_sectionCounter; + EventCounter m_assertionCounter; }; -#include <catch2/catch_reporter_registrars.hpp> -CATCH_REGISTER_LISTENER( TestListener ) +ValidatingTestListener::~ValidatingTestListener() { + // Throwing from noexcept destructor terminates, but we don't mind + // because this is test-only check and we don't need to try and recover + // from assumption violation here. + + CATCH_ENFORCE( m_testRunCounter.ended < 2, + "Test run should be started at most once" ); + CATCH_ENFORCE( m_testRunCounter.allEventsEnded(), + "The test run has not finished" ); + CATCH_ENFORCE( m_testCaseCounter.allEventsEnded(), + "A test case did not finish" ); + + // TODO: other counters being balanced? +} + +CATCH_REGISTER_LISTENER( ValidatingTestListener ) diff --git a/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp b/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp index d8b958beda5b317be89a426fa2f663b5b6266875..1c82e0e912b1249c613b80118d7d19bff2da05c2 100644 --- a/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp +++ b/packages/Catch2/tests/SelfTest/TimingTests/Sleep.tests.cpp @@ -16,8 +16,8 @@ TEST_CASE( "sleep_for_100ms", "[.min_duration_test][approvals]" ) CHECK( true ); } -TEST_CASE( "sleep_for_250ms", "[.min_duration_test][approvals]" ) +TEST_CASE( "sleep_for_1000ms", "[.min_duration_test][approvals]" ) { - std::this_thread::sleep_for( std::chrono::milliseconds( 250 ) ); + std::this_thread::sleep_for( std::chrono::milliseconds( 1'000 ) ); CHECK( true ); } diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp index f0d8919c4f132ebfc7f52efb9c8fa86ac7f96e7b..1ae5fe04e6a903a01c337f954d04f655d12383df 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Approx.tests.cpp @@ -13,13 +13,9 @@ using Catch::Approx; -namespace { namespace ApproxTests { - -#ifndef APPROX_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define APPROX_TEST_HELPERS_INCLUDED - - inline double divide( double a, double b ) { - return a/b; +namespace { + static double divide(double a, double b) { + return a / b; } class StrongDoubleTypedef { @@ -30,11 +26,10 @@ namespace { namespace ApproxTests { explicit operator double() const { return d_; } }; - inline std::ostream& operator<<( std::ostream& os, StrongDoubleTypedef td ) { + static std::ostream& operator<<(std::ostream& os, StrongDoubleTypedef td) { return os << "StrongDoubleTypedef(" << static_cast<double>(td) << ")"; } - -#endif +} // end unnamed namespace using namespace Catch::literals; @@ -215,4 +210,9 @@ TEST_CASE( "Comparison with explicitly convertible types", "[Approx]" ) } -}} // namespace ApproxTests +TEST_CASE("Approx::operator() is const correct", "[Approx][.approvals]") { + const Approx ap = Approx(0.0).margin(0.01); + + // As long as this compiles, the test should be considered passing + REQUIRE(1.0 == ap(1.0)); +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp index 131340fa1906c1de8f634a60a69a1175568f8a71..eba58d382c16c00f99fededa8665631e42db5599 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/BDD.tests.cpp @@ -5,103 +5,99 @@ #include <catch2/catch_test_macros.hpp> -namespace { namespace BDDTests { +namespace { -#ifndef BDD_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define BDD_TEST_HELPERS_INCLUDED + static bool itDoesThis() { return true; } - inline bool itDoesThis() { return true; } + static bool itDoesThat() { return true; } - inline bool itDoesThat() { return true; } + // a trivial fixture example to support SCENARIO_METHOD tests + struct Fixture { + Fixture(): d_counter( 0 ) {} - namespace { + int counter() { return d_counter++; } -// a trivial fixture example to support SCENARIO_METHOD tests - struct Fixture { - Fixture() - : d_counter(0) { - } + int d_counter; + }; - int counter() { - return d_counter++; - } +} - int d_counter; - }; - } -#endif - - SCENARIO("Do that thing with the thing", "[Tags]") { - GIVEN("This stuff exists") { - // make stuff exist - AND_GIVEN("And some assumption") { - // Validate assumption - WHEN("I do this") { - // do this - THEN("it should do this") { - REQUIRE(itDoesThis()); - AND_THEN("do that")REQUIRE(itDoesThat()); +SCENARIO("Do that thing with the thing", "[Tags]") { + GIVEN("This stuff exists") { + // make stuff exist + AND_GIVEN("And some assumption") { + // Validate assumption + WHEN("I do this") { + // do this + THEN("it should do this") { + REQUIRE(itDoesThis()); + AND_THEN("do that") { + REQUIRE(itDoesThat()); } } } } } - - SCENARIO("Vector resizing affects size and capacity", "[vector][bdd][size][capacity]") { - GIVEN("an empty vector") { - std::vector<int> v; - REQUIRE(v.size() == 0); - - WHEN("it is made larger") { - v.resize(10); - THEN("the size and capacity go up") { - REQUIRE(v.size() == 10); - REQUIRE(v.capacity() >= 10); - - AND_WHEN("it is made smaller again") { - v.resize(5); - THEN("the size goes down but the capacity stays the same") { - REQUIRE(v.size() == 5); - REQUIRE(v.capacity() >= 10); - } +} + +SCENARIO( "Vector resizing affects size and capacity", + "[vector][bdd][size][capacity]" ) { + GIVEN( "an empty vector" ) { + std::vector<int> v; + REQUIRE( v.size() == 0 ); + + WHEN( "it is made larger" ) { + v.resize( 10 ); + THEN( "the size and capacity go up" ) { + REQUIRE( v.size() == 10 ); + REQUIRE( v.capacity() >= 10 ); + + AND_WHEN( "it is made smaller again" ) { + v.resize( 5 ); + THEN( + "the size goes down but the capacity stays the same" ) { + REQUIRE( v.size() == 5 ); + REQUIRE( v.capacity() >= 10 ); } } } + } - WHEN("we reserve more space") { - v.reserve(10); - THEN("The capacity is increased but the size remains the same") { - REQUIRE(v.capacity() >= 10); - REQUIRE(v.size() == 0); - } + WHEN( "we reserve more space" ) { + v.reserve( 10 ); + THEN( "The capacity is increased but the size remains the same" ) { + REQUIRE( v.capacity() >= 10 ); + REQUIRE( v.size() == 0 ); } } } - - SCENARIO("This is a really long scenario name to see how the list command deals with wrapping", - "[very long tags][lots][long][tags][verbose]" - "[one very long tag name that should cause line wrapping writing out using the list command]" - "[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter]") { - GIVEN("A section name that is so long that it cannot fit in a single console width")WHEN( - "The test headers are printed as part of the normal running of the scenario")THEN( - "The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent")SUCCEED( - "boo!"); +} + +SCENARIO("This is a really long scenario name to see how the list command deals with wrapping", + "[very long tags][lots][long][tags][verbose]" + "[one very long tag name that should cause line wrapping writing out using the list command]" + "[anotherReallyLongTagNameButThisOneHasNoObviousWrapPointsSoShouldSplitWithinAWordUsingADashCharacter]") { + GIVEN("A section name that is so long that it cannot fit in a single console width") { + WHEN("The test headers are printed as part of the normal running of the scenario") { + THEN("The, deliberately very long and overly verbose (you see what I did there?) section names must wrap, along with an indent") { + SUCCEED("boo!"); + } + } } - - SCENARIO_METHOD(Fixture, - "BDD tests requiring Fixtures to provide commonly-accessed data or methods", - "[bdd][fixtures]") { - const int before(counter()); - GIVEN("No operations precede me") { - REQUIRE(before == 0); - WHEN("We get the count") { - const int after(counter()); - THEN("Subsequently values are higher") { - REQUIRE(after > before); - } +} + +SCENARIO_METHOD(Fixture, + "BDD tests requiring Fixtures to provide commonly-accessed data or methods", + "[bdd][fixtures]") { + const int before(counter()); + GIVEN("No operations precede me") { + REQUIRE(before == 0); + WHEN("We get the count") { + const int after(counter()); + THEN("Subsequently values are higher") { + REQUIRE(after > before); } } } - -}} // namespace BDDtests +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp index b6009e0b7cbe369aa8a5539ec8306472624f5886..94e83051b75897c48d56fbbe4e4f5daab92454d1 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Class.tests.cpp @@ -7,68 +7,47 @@ #include <catch2/catch_template_test_macros.hpp> #include <array> -namespace{ namespace ClassTests { +namespace { -#ifndef CLASS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define CLASS_TEST_HELPERS_INCLUDED + class TestClass { + std::string s; -class TestClass -{ - std::string s; + public: + TestClass(): s( "hello" ) {} -public: - TestClass() - : s( "hello" ) - {} + void succeedingCase() { REQUIRE( s == "hello" ); } + void failingCase() { REQUIRE( s == "world" ); } + }; - void succeedingCase() - { - REQUIRE( s == "hello" ); - } - void failingCase() - { - REQUIRE( s == "world" ); - } -}; + struct Fixture { + Fixture(): m_a( 1 ) {} -struct Fixture -{ - Fixture() : m_a( 1 ) {} + int m_a; + }; - int m_a; -}; + template <typename T> struct Template_Fixture { + Template_Fixture(): m_a( 1 ) {} -template< typename T > -struct Template_Fixture { - Template_Fixture(): m_a(1) {} + T m_a; + }; - T m_a; -}; + template <typename T> struct Template_Fixture_2 { + Template_Fixture_2() {} -template<typename T> -struct Template_Fixture_2 { - Template_Fixture_2() {} + T m_a; + }; - T m_a; -}; + template <typename T> struct Template_Foo { + size_t size() { return 0; } + }; -template< typename T> -struct Template_Foo { - size_t size() { return 0; } -}; - -template< typename T, size_t V> -struct Template_Foo_2 { - size_t size() { return V; } -}; - -template <int V> -struct Nttp_Fixture{ - int value = V; -}; -#endif + template <typename T, size_t V> struct Template_Foo_2 { + size_t size() { return V; } + }; + template <int V> struct Nttp_Fixture { int value = V; }; +} // end unnamed namespace METHOD_AS_TEST_CASE( TestClass::succeedingCase, "A METHOD_AS_TEST_CASE based test run that succeeds", "[class]" ) METHOD_AS_TEST_CASE( TestClass::failingCase, "A METHOD_AS_TEST_CASE based test run that fails", "[.][class][failing]" ) @@ -129,7 +108,3 @@ namespace Inner REQUIRE(Template_Fixture_2<TestType>{}.m_a.size() < 2); } } - - - -}} // namespace ClassTests diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp index 0f339cb8d472e61faf40f89c2cf1b84807884fdf..c40c09f81ad700a277838569459e0dbdde544ca3 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -33,60 +33,44 @@ std::ostream& operator<<(std::ostream& out, foo::helper_1403 const&) { #include <cstring> -namespace { namespace CompilationTests { - -#ifndef COMPILATION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define COMPILATION_TEST_HELPERS_INCLUDED - - // Comparison operators can return non-booleans. - // This is unusual, but should be supported. - struct logic_t { - logic_t operator< (logic_t) const { return {}; } - logic_t operator<=(logic_t) const { return {}; } - logic_t operator> (logic_t) const { return {}; } - logic_t operator>=(logic_t) const { return {}; } - logic_t operator==(logic_t) const { return {}; } - logic_t operator!=(logic_t) const { return {}; } - explicit operator bool() const { return true; } - }; - - -// This is a minimal example for an issue we have found in 1.7.0 - struct foo { - int i; - }; - - template<typename T> - bool operator==(const T &val, foo f) { - return val == f.i; - } - - void throws_int(bool b) { - if (b) { - throw 1; - } +// Comparison operators can return non-booleans. +// This is unusual, but should be supported. +struct logic_t { + logic_t operator< (logic_t) const { return {}; } + logic_t operator<=(logic_t) const { return {}; } + logic_t operator> (logic_t) const { return {}; } + logic_t operator>=(logic_t) const { return {}; } + logic_t operator==(logic_t) const { return {}; } + logic_t operator!=(logic_t) const { return {}; } + explicit operator bool() const { return true; } +}; + + +void throws_int(bool b) { + if (b) { + throw 1; } +} - template<typename T> - bool templated_tests(T t) { - int a = 3; - REQUIRE(a == t); - CHECK(a == t); - REQUIRE_THROWS(throws_int(true)); - CHECK_THROWS_AS(throws_int(true), int); - REQUIRE_NOTHROW(throws_int(false)); - REQUIRE_THAT("aaa", Catch::Matchers::EndsWith("aaa")); - return true; - } +template<typename T> +bool templated_tests(T t) { + int a = 3; + REQUIRE(a == t); + CHECK(a == t); + REQUIRE_THROWS(throws_int(true)); + CHECK_THROWS_AS(throws_int(true), int); + REQUIRE_NOTHROW(throws_int(false)); + REQUIRE_THAT("aaa", Catch::Matchers::EndsWith("aaa")); + return true; +} - struct A { - }; +struct A {}; - std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; } +std::ostream &operator<<(std::ostream &o, const A &) { return o << 0; } - struct B : private A { - bool operator==(int) const { return true; } - }; +struct B : private A { + bool operator==(int) const { return true; } +}; #ifdef __clang__ #pragma clang diagnostic push @@ -98,24 +82,32 @@ namespace { namespace CompilationTests { #pragma GCC diagnostic ignored "-Wunused-function" #endif - B f(); +B f(); - std::ostream g(); +std::ostream g(); #ifdef __clang__ #pragma clang diagnostic pop #endif - template <typename, typename> - struct Fixture_1245 {}; +template <typename, typename> +struct Fixture_1245 {}; -#endif +// This is a minimal example for an issue we have found in 1.7.0 +struct dummy_809 { + int i; +}; - TEST_CASE("#809") { - foo f; - f.i = 42; - REQUIRE(42 == f); - } +template<typename T> +bool operator==(const T& val, dummy_809 f) { + return val == f.i; +} + +TEST_CASE("#809") { + dummy_809 f; + f.i = 42; + REQUIRE(42 == f); +} // ------------------------------------------------------------------ @@ -129,65 +121,63 @@ namespace { namespace CompilationTests { // Test containing example where original stream insertable check breaks compilation +TEST_CASE("#872") { + A dummy; + CAPTURE(dummy); + B x; + REQUIRE (x == 4); +} +TEST_CASE("#1027: Bitfields can be captured") { + struct Y { + uint32_t v : 1; + }; + Y y{ 0 }; + REQUIRE(y.v == 0); + REQUIRE(0 == y.v); +} - TEST_CASE("#872") { - A dummy; - CAPTURE(dummy); - B x; - REQUIRE (x == 4); - } - - TEST_CASE("#1027: Bitfields can be captured") { - struct Y { - uint32_t v : 1; - }; - Y y{ 0 }; - REQUIRE(y.v == 0); - REQUIRE(0 == y.v); - } - - // Comparison operators can return non-booleans. - // This is unusual, but should be supported. - TEST_CASE("#1147") { - logic_t t1, t2; - REQUIRE(t1 == t2); - REQUIRE(t1 != t2); - REQUIRE(t1 < t2); - REQUIRE(t1 > t2); - REQUIRE(t1 <= t2); - REQUIRE(t1 >= t2); - } +// Comparison operators can return non-booleans. +// This is unusual, but should be supported. +TEST_CASE("#1147") { + logic_t t1, t2; + REQUIRE(t1 == t2); + REQUIRE(t1 != t2); + REQUIRE(t1 < t2); + REQUIRE(t1 > t2); + REQUIRE(t1 <= t2); + REQUIRE(t1 >= t2); +} - // unsigned array - TEST_CASE("#1238") { - unsigned char uarr[] = "123"; - CAPTURE(uarr); - signed char sarr[] = "456"; - CAPTURE(sarr); +// unsigned array +TEST_CASE("#1238") { + unsigned char uarr[] = "123"; + CAPTURE(uarr); + signed char sarr[] = "456"; + CAPTURE(sarr); - REQUIRE(std::memcmp(uarr, "123", sizeof(uarr)) == 0); - REQUIRE(std::memcmp(sarr, "456", sizeof(sarr)) == 0); - } + REQUIRE(std::memcmp(uarr, "123", sizeof(uarr)) == 0); + REQUIRE(std::memcmp(sarr, "456", sizeof(sarr)) == 0); +} - TEST_CASE_METHOD((Fixture_1245<int, int>), "#1245", "[compilation]") { - SUCCEED(); - } +TEST_CASE_METHOD((Fixture_1245<int, int>), "#1245", "[compilation]") { + SUCCEED(); +} - TEST_CASE("#1403", "[compilation]") { - ::foo::helper_1403 h1, h2; - REQUIRE(h1 == h2); - } +TEST_CASE("#1403", "[compilation]") { + ::foo::helper_1403 h1, h2; + REQUIRE(h1 == h2); +} - TEST_CASE("Optionally static assertions", "[compilation]") { - STATIC_REQUIRE( std::is_void<void>::value ); - STATIC_REQUIRE_FALSE( std::is_void<int>::value ); - } +TEST_CASE("Optionally static assertions", "[compilation]") { + STATIC_REQUIRE( std::is_void<void>::value ); + STATIC_REQUIRE_FALSE( std::is_void<int>::value ); +} - TEST_CASE("#1548", "[compilation]") { - using namespace bar; - REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value); - } +TEST_CASE("#1548", "[compilation]") { + using namespace bar; + REQUIRE(std::is_same<TypeList<int>, TypeList<int>>::value); +} // #925 using signal_t = void (*) (void*); @@ -214,17 +204,16 @@ namespace { namespace CompilationTests { #pragma warning(pop) #endif - TEST_CASE("#1319: Sections can have description (even if it is not saved", "[compilation]") { - SECTION("SectionName", "This is a long form section description") { - SUCCEED(); - } - } - - TEST_CASE("Lambdas in assertions") { - REQUIRE([]() { return true; }()); +TEST_CASE( "#1319: Sections can have description (even if it is not saved", + "[compilation]" ) { + SECTION( "SectionName", "This is a long form section description" ) { + SUCCEED(); } +} -}} // namespace CompilationTests +TEST_CASE("Lambdas in assertions") { + REQUIRE([]() { return true; }()); +} namespace { struct HasBitOperators { @@ -259,3 +248,60 @@ TEST_CASE("Assertion macros support bit operators and bool conversions", "[compi REQUIRE_FALSE(lhs ^ lhs); } +namespace { + struct ImmovableType { + ImmovableType() = default; + + ImmovableType(ImmovableType const&) = delete; + ImmovableType& operator=(ImmovableType const&) = delete; + ImmovableType(ImmovableType&&) = delete; + ImmovableType& operator=(ImmovableType&&) = delete; + + friend bool operator==(ImmovableType const&, ImmovableType const&) { + return true; + } + }; +} + +TEST_CASE("Immovable types are supported in basic assertions", "[compilation][.approvals]") { + REQUIRE(ImmovableType{} == ImmovableType{}); +} + +namespace adl { + +struct always_true { + explicit operator bool() const { return true; } +}; + +#define COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(op) \ +template <class T, class U> \ +auto operator op (T&&, U&&) { \ + return always_true{}; \ +} + +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(==) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(!=) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(<=) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(>=) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(|) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(&) +COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR(^) + +#undef COMPILATION_TEST_DEFINE_UNIVERSAL_OPERATOR + +} + +TEST_CASE("ADL universal operators don't hijack expression deconstruction", "[compilation][.approvals]") { + REQUIRE(adl::always_true{}); + REQUIRE(0 == adl::always_true{}); + REQUIRE(0 != adl::always_true{}); + REQUIRE(0 < adl::always_true{}); + REQUIRE(0 > adl::always_true{}); + REQUIRE(0 <= adl::always_true{}); + REQUIRE(0 >= adl::always_true{}); + REQUIRE(0 | adl::always_true{}); + REQUIRE(0 & adl::always_true{}); + REQUIRE(0 ^ adl::always_true{}); +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp index 7c6a1d73ef073f118032065d919b9160e4bec217..167752e18d9a710847f8e326ecef9809efca51d8 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Condition.tests.cpp @@ -20,31 +20,28 @@ using Catch::Approx; #include <limits> #include <cstdint> -namespace { namespace ConditionTests { - -#ifndef CONDITION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define CONDITION_TEST_HELPERS_INCLUDED - -struct TestData { - int int_seven = 7; - std::string str_hello = "hello"; - float float_nine_point_one = 9.1f; - double double_pi = 3.1415926535; -}; - -struct TestDef { - TestDef& operator + ( const std::string& ) { - return *this; - } - TestDef& operator[]( const std::string& ) { - return *this; - } -}; - -inline const char* returnsConstNull(){ return nullptr; } -inline char* returnsNull(){ return nullptr; } +namespace { -#endif + struct TestData { + int int_seven = 7; + std::string str_hello = "hello"; + float float_nine_point_one = 9.1f; + double double_pi = 3.1415926535; + }; + + struct TestDef { + TestDef& operator + (const std::string&) { + return *this; + } + TestDef& operator[](const std::string&) { + return *this; + } + }; + + static const char* returnsConstNull() { return nullptr; } + static char* returnsNull() { return nullptr; } + +} // end unnamed namespace // The "failing" tests all use the CHECK macro, which continues if the specific test fails. // This allows us to see all results, even if an earlier check fails @@ -330,5 +327,3 @@ TEST_CASE( "'Not' checks that should fail", "[.][failing]" ) CHECK( !(1 == 1) ); CHECK_FALSE( 1 == 1 ); } - -}} // namespace ConditionTests diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp index 1f6b4fa263c30fa01a6be1351d373f59df380844..206bd9c8143810f28133bbc2b80afd1b35c3c48f 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Exception.tests.cpp @@ -20,55 +20,50 @@ #pragma clang diagnostic ignored "-Wunreachable-code" #endif -namespace { namespace ExceptionTests { +namespace { -#ifndef EXCEPTION_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define EXCEPTION_TEST_HELPERS_INCLUDED + int thisThrows() { + throw std::domain_error("expected exception"); + return 1; + } -int thisThrows() { - throw std::domain_error( "expected exception" ); - return 1; -} + int thisDoesntThrow() { + return 0; + } -int thisDoesntThrow() { - return 0; -} + class CustomException { + public: + explicit CustomException(const std::string& msg) + : m_msg(msg) {} -class CustomException { -public: - explicit CustomException( const std::string& msg ) - : m_msg( msg ) - {} + std::string getMessage() const { + return m_msg; + } - std::string getMessage() const { - return m_msg; - } + private: + std::string m_msg; + }; -private: - std::string m_msg; -}; + class CustomStdException : public std::exception { + public: + explicit CustomStdException(const std::string& msg) + : m_msg(msg) {} + ~CustomStdException() noexcept override {} -class CustomStdException : public std::exception { -public: - explicit CustomStdException( const std::string& msg ) - : m_msg( msg ) - {} - ~CustomStdException() noexcept override {} + std::string getMessage() const { + return m_msg; + } - std::string getMessage() const { - return m_msg; - } + private: + std::string m_msg; + }; -private: - std::string m_msg; -}; + [[noreturn]] void throwCustom() { + throw CustomException("custom exception - not std"); + } -[[noreturn]] void throwCustom() { - throw CustomException( "custom exception - not std" ); } -#endif - TEST_CASE( "When checked exceptions are thrown they can be expected or unexpected", "[!throws]" ) { REQUIRE_THROWS_AS( thisThrows(), std::domain_error ); REQUIRE_NOTHROW( thisDoesntThrow() ); @@ -198,8 +193,6 @@ TEST_CASE( "#748 - captures with unexpected exceptions", "[.][failing][!throws][ } } -}} // namespace ExceptionTests - #ifdef __clang__ #pragma clang diagnostic pop #endif diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp index acfef8a9bff366a63007f029d61d197b3520f31e..b2154a1a164b89b63ea6b527a0c2c35fa65e6b65 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Generators.tests.cpp @@ -62,12 +62,12 @@ TEST_CASE("tables", "[generators]") { // Structured bindings make the table utility much nicer to use TEST_CASE( "strlen2", "[approvals][generators]" ) { - auto [test_input, expected] = GENERATE( table<std::string, size_t>({ - {"one", 3}, - {"two", 3}, - {"three", 5}, - {"four", 4} - })); + using tuple_type = std::tuple<std::string, int>; // see above workaround + auto [test_input, expected] = + GENERATE( table<std::string, size_t>( { tuple_type{ "one", 3 }, + tuple_type{ "two", 3 }, + tuple_type{ "three", 5 }, + tuple_type{ "four", 4 } } ) ); REQUIRE( test_input.size() == expected ); } @@ -103,11 +103,9 @@ TEST_CASE( "strlen3", "[generators]" ) { static auto eatCucumbers( int start, int eat ) -> int { return start-eat; } SCENARIO("Eating cucumbers", "[generators][approvals]") { - - auto [start, eat, left] = GENERATE( table<int,int,int> ({ - { 12, 5, 7 }, - { 20, 5, 15 } - })); + using tuple_type = std::tuple<int, int, int>; + auto [start, eat, left] = GENERATE( table<int, int, int>( + { tuple_type{ 12, 5, 7 }, tuple_type{ 20, 5, 15 } } ) ); GIVEN( "there are " << start << " cucumbers" ) WHEN( "I eat " << eat << " cucumbers" ) diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp index 935434344d22f70e507a297ece25640a648e833f..6f83279f33d3d2c71aa88fed7fce94fd51329f2a 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Matchers.tests.cpp @@ -4,6 +4,7 @@ */ #include <catch2/catch_test_macros.hpp> +#include <catch2/catch_template_test_macros.hpp> #include <catch2/matchers/catch_matchers_exception.hpp> #include <catch2/matchers/catch_matchers_floating_point.hpp> #include <catch2/matchers/catch_matchers_predicate.hpp> @@ -12,41 +13,37 @@ #include <catch2/matchers/catch_matchers_templated.hpp> #include <algorithm> +#include <exception> #include <cmath> #include <list> #include <sstream> #ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wweak-vtables" -#pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wweak-vtables" +# pragma clang diagnostic ignored "-Wpadded" #endif -namespace { namespace MatchersTests { - -#ifndef MATCHERS_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define MATCHERS_TEST_HELPERS_INCLUDED +namespace { - inline const char *testStringForMatching() { + static const char* testStringForMatching() { return "this string contains 'abc' as a substring"; } - inline const char *testStringForMatching2() { + static const char* testStringForMatching2() { return "some completely different text that contains one common word"; } - inline bool alwaysTrue(int) { return true; } - inline bool alwaysFalse(int) { return false; } - + static bool alwaysTrue( int ) { return true; } + static bool alwaysFalse( int ) { return false; } #ifdef _MSC_VER -#pragma warning(disable:4702) // Unreachable code -- MSVC 19 (VS 2015) sees right through the indirection +# pragma warning( disable : 4702 ) // Unreachable code -- MSVC 19 (VS 2015) + // sees right through the indirection #endif -#include <exception> - struct SpecialException : std::exception { - SpecialException(int i_) : i(i_) {} + SpecialException( int i_ ): i( i_ ) {} char const* what() const noexcept override { return "SpecialException::what"; @@ -61,29 +58,26 @@ namespace { namespace MatchersTests { } }; - void doesNotThrow() {} + static void doesNotThrow() {} - [[noreturn]] - void throwsSpecialException(int i) { - throw SpecialException{i}; + [[noreturn]] static void throwsSpecialException( int i ) { + throw SpecialException{ i }; } - [[noreturn]] - void throwsAsInt(int i) { - throw i; - } + [[noreturn]] static void throwsAsInt( int i ) { throw i; } - [[noreturn]] - void throwsDerivedException() { + [[noreturn]] static void throwsDerivedException() { throw DerivedException{}; } - class ExceptionMatcher : public Catch::Matchers::MatcherBase<SpecialException> { + class ExceptionMatcher + : public Catch::Matchers::MatcherBase<SpecialException> { int m_expected; + public: - ExceptionMatcher(int i) : m_expected(i) {} + ExceptionMatcher( int i ): m_expected( i ) {} - bool match(SpecialException const &se) const override { + bool match( SpecialException const& se ) const override { return se.i == m_expected; } @@ -94,938 +88,1012 @@ namespace { namespace MatchersTests { } }; -#endif - using namespace Catch::Matchers; #ifdef __DJGPP__ - float nextafter(float from, float to) - { - return ::nextafterf(from, to); + static float nextafter( float from, float to ) { + return ::nextafterf( from, to ); } - double nextafter(double from, double to) - { - return ::nextafter(from, to); + static double nextafter( double from, double to ) { + return ::nextafter( from, to ); } #else using std::nextafter; #endif - TEST_CASE("String matchers", "[matchers]") { - REQUIRE_THAT(testStringForMatching(), Contains("string")); - REQUIRE_THAT(testStringForMatching(), Contains("string", Catch::CaseSensitive::No)); - CHECK_THAT(testStringForMatching(), Contains("abc")); - CHECK_THAT(testStringForMatching(), Contains("aBC", Catch::CaseSensitive::No)); - - CHECK_THAT(testStringForMatching(), StartsWith("this")); - CHECK_THAT(testStringForMatching(), StartsWith("THIS", Catch::CaseSensitive::No)); - CHECK_THAT(testStringForMatching(), EndsWith("substring")); - CHECK_THAT(testStringForMatching(), EndsWith(" SuBsTrInG", Catch::CaseSensitive::No)); - } - - TEST_CASE("Contains string matcher", "[.][failing][matchers]") { - CHECK_THAT(testStringForMatching(), Contains("not there", Catch::CaseSensitive::No)); - CHECK_THAT(testStringForMatching(), Contains("STRING")); - } - - TEST_CASE("StartsWith string matcher", "[.][failing][matchers]") { - CHECK_THAT(testStringForMatching(), StartsWith("This String")); - CHECK_THAT(testStringForMatching(), StartsWith("string", Catch::CaseSensitive::No)); - } +} // end unnamed namespace + +TEST_CASE( "String matchers", "[matchers]" ) { + REQUIRE_THAT( testStringForMatching(), Contains( "string" ) ); + REQUIRE_THAT( testStringForMatching(), + Contains( "string", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), Contains( "abc" ) ); + CHECK_THAT( testStringForMatching(), + Contains( "aBC", Catch::CaseSensitive::No ) ); + + CHECK_THAT( testStringForMatching(), StartsWith( "this" ) ); + CHECK_THAT( testStringForMatching(), + StartsWith( "THIS", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), EndsWith( "substring" ) ); + CHECK_THAT( testStringForMatching(), + EndsWith( " SuBsTrInG", Catch::CaseSensitive::No ) ); +} + +TEST_CASE( "Contains string matcher", "[.][failing][matchers]" ) { + CHECK_THAT( testStringForMatching(), + Contains( "not there", Catch::CaseSensitive::No ) ); + CHECK_THAT( testStringForMatching(), Contains( "STRING" ) ); +} + +TEST_CASE( "StartsWith string matcher", "[.][failing][matchers]" ) { + CHECK_THAT( testStringForMatching(), StartsWith( "This String" ) ); + CHECK_THAT( testStringForMatching(), + StartsWith( "string", Catch::CaseSensitive::No ) ); +} + +TEST_CASE( "EndsWith string matcher", "[.][failing][matchers]" ) { + CHECK_THAT( testStringForMatching(), EndsWith( "Substring" ) ); + CHECK_THAT( testStringForMatching(), + EndsWith( "this", Catch::CaseSensitive::No ) ); +} + +TEST_CASE( "Equals string matcher", "[.][failing][matchers]" ) { + CHECK_THAT( testStringForMatching(), + Equals( "this string contains 'ABC' as a substring" ) ); + CHECK_THAT( testStringForMatching(), + Equals( "something else", Catch::CaseSensitive::No ) ); +} + +TEST_CASE( "Equals", "[matchers]" ) { + CHECK_THAT( testStringForMatching(), + Equals( "this string contains 'abc' as a substring" ) ); + CHECK_THAT( testStringForMatching(), + Equals( "this string contains 'ABC' as a substring", + Catch::CaseSensitive::No ) ); +} + +TEST_CASE( "Regex string matcher -- libstdc++-4.8 workaround", + "[matchers][approvals]" ) { +// DJGPP has similar problem with its regex support as libstdc++ 4.8 +#ifndef __DJGPP__ + REQUIRE_THAT( testStringForMatching(), + Matches( "this string contains 'abc' as a substring" ) ); + REQUIRE_THAT( testStringForMatching(), + Matches( "this string CONTAINS 'abc' as a substring", + Catch::CaseSensitive::No ) ); + REQUIRE_THAT( testStringForMatching(), + Matches( "^this string contains 'abc' as a substring$" ) ); + REQUIRE_THAT( testStringForMatching(), Matches( "^.* 'abc' .*$" ) ); + REQUIRE_THAT( testStringForMatching(), + Matches( "^.* 'ABC' .*$", Catch::CaseSensitive::No ) ); +#endif - TEST_CASE("EndsWith string matcher", "[.][failing][matchers]") { - CHECK_THAT(testStringForMatching(), EndsWith("Substring")); - CHECK_THAT(testStringForMatching(), EndsWith("this", Catch::CaseSensitive::No)); + REQUIRE_THAT( testStringForMatching2(), + !Matches( "this string contains 'abc' as a substring" ) ); +} + +TEST_CASE( "Regex string matcher", "[matchers][.failing]" ) { + CHECK_THAT( testStringForMatching(), + Matches( "this STRING contains 'abc' as a substring" ) ); + CHECK_THAT( testStringForMatching(), + Matches( "contains 'abc' as a substring" ) ); + CHECK_THAT( testStringForMatching(), + Matches( "this string contains 'abc' as a" ) ); +} + +TEST_CASE( "Matchers can be (AllOf) composed with the && operator", + "[matchers][operators][operator&&]" ) { + CHECK_THAT( testStringForMatching(), + Contains( "string" ) && Contains( "abc" ) && + Contains( "substring" ) && Contains( "contains" ) ); +} + +TEST_CASE( "Matchers can be (AnyOf) composed with the || operator", + "[matchers][operators][operator||]" ) { + CHECK_THAT( testStringForMatching(), + Contains( "string" ) || Contains( "different" ) || + Contains( "random" ) ); + CHECK_THAT( testStringForMatching2(), + Contains( "string" ) || Contains( "different" ) || + Contains( "random" ) ); +} + +TEST_CASE( "Matchers can be composed with both && and ||", + "[matchers][operators][operator||][operator&&]" ) { + CHECK_THAT( testStringForMatching(), + ( Contains( "string" ) || Contains( "different" ) ) && + Contains( "substring" ) ); +} + +TEST_CASE( "Matchers can be composed with both && and || - failing", + "[matchers][operators][operator||][operator&&][.failing]" ) { + CHECK_THAT( testStringForMatching(), + ( Contains( "string" ) || Contains( "different" ) ) && + Contains( "random" ) ); +} + +TEST_CASE( "Matchers can be negated (Not) with the ! operator", + "[matchers][operators][not]" ) { + CHECK_THAT( testStringForMatching(), !Contains( "different" ) ); +} + +TEST_CASE( "Matchers can be negated (Not) with the ! operator - failing", + "[matchers][operators][not][.failing]" ) { + CHECK_THAT( testStringForMatching(), !Contains( "substring" ) ); +} + +template <typename T> struct CustomAllocator : private std::allocator<T> { + using size_type = size_t; + using difference_type = ptrdiff_t; + using pointer = T*; + using const_pointer = const T*; + using reference = T&; + using const_reference = const T&; + using value_type = T; + + template <typename U> struct rebind { using other = CustomAllocator<U>; }; + + using propagate_on_container_move_assignment = std::true_type; + using is_always_equal = std::true_type; + + CustomAllocator() = default; + + CustomAllocator( const CustomAllocator& other ): + std::allocator<T>( other ) {} + + template <typename U> CustomAllocator( const CustomAllocator<U>& ) {} + + ~CustomAllocator() = default; + + using std::allocator<T>::allocate; + using std::allocator<T>::deallocate; +}; + +TEST_CASE( "Vector matchers", "[matchers][vector]" ) { + std::vector<int> v; + v.push_back( 1 ); + v.push_back( 2 ); + v.push_back( 3 ); + + std::vector<int> v2; + v2.push_back( 1 ); + v2.push_back( 2 ); + + std::vector<double> v3; + v3.push_back( 1 ); + v3.push_back( 2 ); + v3.push_back( 3 ); + + std::vector<double> v4; + v4.push_back( 1 + 1e-8 ); + v4.push_back( 2 + 1e-8 ); + v4.push_back( 3 + 1e-8 ); + + std::vector<int, CustomAllocator<int>> v5; + v5.push_back( 1 ); + v5.push_back( 2 ); + v5.push_back( 3 ); + + std::vector<int, CustomAllocator<int>> v6; + v6.push_back( 1 ); + v6.push_back( 2 ); + + std::vector<int> empty; + + SECTION( "Contains (element)" ) { + CHECK_THAT( v, VectorContains( 1 ) ); + CHECK_THAT( v, VectorContains( 2 ) ); + CHECK_THAT( v5, ( VectorContains<int, CustomAllocator<int>>( 2 ) ) ); } - - TEST_CASE("Equals string matcher", "[.][failing][matchers]") { - CHECK_THAT(testStringForMatching(), Equals("this string contains 'ABC' as a substring")); - CHECK_THAT(testStringForMatching(), Equals("something else", Catch::CaseSensitive::No)); + SECTION( "Contains (vector)" ) { + CHECK_THAT( v, Contains( v2 ) ); + CHECK_THAT( v, Contains<int>( { 1, 2 } ) ); + CHECK_THAT( v5, + ( Contains<int, std::allocator<int>, CustomAllocator<int>>( + v2 ) ) ); + + v2.push_back( 3 ); // now exactly matches + CHECK_THAT( v, Contains( v2 ) ); + + CHECK_THAT( v, Contains( empty ) ); + CHECK_THAT( empty, Contains( empty ) ); + + CHECK_THAT( v5, + ( Contains<int, std::allocator<int>, CustomAllocator<int>>( + v2 ) ) ); + CHECK_THAT( v5, Contains( v6 ) ); } - - TEST_CASE("Equals", "[matchers]") { - CHECK_THAT(testStringForMatching(), Equals("this string contains 'abc' as a substring")); - CHECK_THAT(testStringForMatching(), - Equals("this string contains 'ABC' as a substring", Catch::CaseSensitive::No)); + SECTION( "Contains (element), composed" ) { + CHECK_THAT( v, VectorContains( 1 ) && VectorContains( 2 ) ); } -// <regex> does not work in libstdc++ 4.8, so we have to enable these tests only when they -// are expected to pass and cannot have them in baselines - TEST_CASE("Regex string matcher -- libstdc++-4.8 workaround", "[matchers][approvals]") { - -// This is fiiiine -// Taken from an answer at -// https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions -#if (!defined(__GNUC__)) || \ - (__cplusplus >= 201103L && \ - (!defined(__GLIBCXX__) || (__cplusplus >= 201402L) || \ - (defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \ - defined(_GLIBCXX_REGEX_STATE_LIMIT) || \ - (defined(_GLIBCXX_RELEASE) && \ - _GLIBCXX_RELEASE > 4)))) - -// DJGPP meets the above condition but <regex> does not work properly anyway -#ifndef __DJGPP__ - REQUIRE_THAT(testStringForMatching(), Matches("this string contains 'abc' as a substring")); - REQUIRE_THAT(testStringForMatching(), - Matches("this string CONTAINS 'abc' as a substring", Catch::CaseSensitive::No)); - REQUIRE_THAT(testStringForMatching(), Matches("^this string contains 'abc' as a substring$")); - REQUIRE_THAT(testStringForMatching(), Matches("^.* 'abc' .*$")); - REQUIRE_THAT(testStringForMatching(), Matches("^.* 'ABC' .*$", Catch::CaseSensitive::No)); -#endif - -#endif - - REQUIRE_THAT(testStringForMatching2(), !Matches("this string contains 'abc' as a substring")); - } - - TEST_CASE("Regex string matcher", "[matchers][.failing]") { - CHECK_THAT(testStringForMatching(), Matches("this STRING contains 'abc' as a substring")); - CHECK_THAT(testStringForMatching(), Matches("contains 'abc' as a substring")); - CHECK_THAT(testStringForMatching(), Matches("this string contains 'abc' as a")); - } - - TEST_CASE("Matchers can be (AllOf) composed with the && operator", "[matchers][operators][operator&&]") { - CHECK_THAT(testStringForMatching(), - Contains("string") && - Contains("abc") && - Contains("substring") && - Contains("contains")); - } - - TEST_CASE("Matchers can be (AnyOf) composed with the || operator", "[matchers][operators][operator||]") { - CHECK_THAT(testStringForMatching(), Contains("string") || Contains("different") || Contains("random")); - CHECK_THAT(testStringForMatching2(), Contains("string") || Contains("different") || Contains("random")); - } - - TEST_CASE("Matchers can be composed with both && and ||", "[matchers][operators][operator||][operator&&]") { - CHECK_THAT(testStringForMatching(), (Contains("string") || Contains("different")) && Contains("substring")); - } - - TEST_CASE("Matchers can be composed with both && and || - failing", - "[matchers][operators][operator||][operator&&][.failing]") { - CHECK_THAT(testStringForMatching(), (Contains("string") || Contains("different")) && Contains("random")); - } - - TEST_CASE("Matchers can be negated (Not) with the ! operator", "[matchers][operators][not]") { - CHECK_THAT(testStringForMatching(), !Contains("different")); - } + SECTION( "Equals" ) { - TEST_CASE("Matchers can be negated (Not) with the ! operator - failing", - "[matchers][operators][not][.failing]") { - CHECK_THAT(testStringForMatching(), !Contains("substring")); - } - - template<typename T> - struct CustomAllocator : private std::allocator<T> - { - using size_type = size_t; - using difference_type = ptrdiff_t; - using pointer = T*; - using const_pointer = const T*; - using reference = T&; - using const_reference = const T&; - using value_type = T; - - template<typename U> - struct rebind - { using other = CustomAllocator<U>; }; - - using propagate_on_container_move_assignment = std::true_type; - using is_always_equal = std::true_type; - - CustomAllocator() = default; - - CustomAllocator(const CustomAllocator& other) - : std::allocator<T>(other) { } - - template<typename U> - CustomAllocator(const CustomAllocator<U>&) { } - - ~CustomAllocator() = default; - - using std::allocator<T>::address; - using std::allocator<T>::allocate; - using std::allocator<T>::construct; - using std::allocator<T>::deallocate; - using std::allocator<T>::max_size; - using std::allocator<T>::destroy; - }; - - TEST_CASE("Vector matchers", "[matchers][vector]") { - std::vector<int> v; - v.push_back(1); - v.push_back(2); - v.push_back(3); - - std::vector<int> v2; - v2.push_back(1); - v2.push_back(2); - - std::vector<double> v3; - v3.push_back(1); - v3.push_back(2); - v3.push_back(3); - - std::vector<double> v4; - v4.push_back(1 + 1e-8); - v4.push_back(2 + 1e-8); - v4.push_back(3 + 1e-8); - - std::vector<int, CustomAllocator<int>> v5; - v5.push_back(1); - v5.push_back(2); - v5.push_back(3); - - std::vector<int, CustomAllocator<int>> v6; - v6.push_back(1); - v6.push_back(2); - - std::vector<int> empty; - - SECTION("Contains (element)") { - CHECK_THAT(v, VectorContains(1)); - CHECK_THAT(v, VectorContains(2)); - CHECK_THAT(v5, (VectorContains<int, CustomAllocator<int>>(2))); - } - SECTION("Contains (vector)") { - CHECK_THAT(v, Contains(v2)); - CHECK_THAT(v, Contains<int>({ 1, 2 })); - CHECK_THAT(v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2))); - - v2.push_back(3); // now exactly matches - CHECK_THAT(v, Contains(v2)); - - CHECK_THAT(v, Contains(empty)); - CHECK_THAT(empty, Contains(empty)); - - CHECK_THAT(v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2))); - CHECK_THAT(v5, Contains(v6)); - } - SECTION("Contains (element), composed") { - CHECK_THAT(v, VectorContains(1) && VectorContains(2)); - } - - SECTION("Equals") { - - // Same vector - CHECK_THAT(v, Equals(v)); - - CHECK_THAT(empty, Equals(empty)); - - // Different vector with same elements - CHECK_THAT(v, Equals<int>({ 1, 2, 3 })); - v2.push_back(3); - CHECK_THAT(v, Equals(v2)); - - CHECK_THAT(v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2))); - - v6.push_back(3); - CHECK_THAT(v5, Equals(v6)); - } - SECTION("UnorderedEquals") { - CHECK_THAT(v, UnorderedEquals(v)); - CHECK_THAT(v, UnorderedEquals<int>({ 3, 2, 1 })); - CHECK_THAT(empty, UnorderedEquals(empty)); - - auto permuted = v; - std::next_permutation(begin(permuted), end(permuted)); - REQUIRE_THAT(permuted, UnorderedEquals(v)); - - std::reverse(begin(permuted), end(permuted)); - REQUIRE_THAT(permuted, UnorderedEquals(v)); - - CHECK_THAT(v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted))); - - auto v5_permuted = v5; - std::next_permutation(begin(v5_permuted), end(v5_permuted)); - CHECK_THAT(v5_permuted, UnorderedEquals(v5)); - } - } + // Same vector + CHECK_THAT( v, Equals( v ) ); - TEST_CASE("Vector matchers that fail", "[matchers][vector][.][failing]") { - std::vector<int> v; - v.push_back(1); - v.push_back(2); - v.push_back(3); + CHECK_THAT( empty, Equals( empty ) ); - std::vector<int> v2; - v2.push_back(1); - v2.push_back(2); + // Different vector with same elements + CHECK_THAT( v, Equals<int>( { 1, 2, 3 } ) ); + v2.push_back( 3 ); + CHECK_THAT( v, Equals( v2 ) ); - std::vector<double> v3; - v3.push_back(1); - v3.push_back(2); - v3.push_back(3); + CHECK_THAT( + v5, + ( Equals<int, std::allocator<int>, CustomAllocator<int>>( v2 ) ) ); - std::vector<double> v4; - v4.push_back(1.1); - v4.push_back(2.1); - v4.push_back(3.1); - - std::vector<int> empty; + v6.push_back( 3 ); + CHECK_THAT( v5, Equals( v6 ) ); + } + SECTION( "UnorderedEquals" ) { + CHECK_THAT( v, UnorderedEquals( v ) ); + CHECK_THAT( v, UnorderedEquals<int>( { 3, 2, 1 } ) ); + CHECK_THAT( empty, UnorderedEquals( empty ) ); + + auto permuted = v; + std::next_permutation( begin( permuted ), end( permuted ) ); + REQUIRE_THAT( permuted, UnorderedEquals( v ) ); + + std::reverse( begin( permuted ), end( permuted ) ); + REQUIRE_THAT( permuted, UnorderedEquals( v ) ); + + CHECK_THAT( + v5, + ( UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>( + permuted ) ) ); + + auto v5_permuted = v5; + std::next_permutation( begin( v5_permuted ), end( v5_permuted ) ); + CHECK_THAT( v5_permuted, UnorderedEquals( v5 ) ); + } +} - SECTION("Contains (element)") { - CHECK_THAT(v, VectorContains(-1)); - CHECK_THAT(empty, VectorContains(1)); - } - SECTION("Contains (vector)") { - CHECK_THAT(empty, Contains(v)); - v2.push_back(4); - CHECK_THAT(v, Contains(v2)); - } +TEST_CASE( "Vector matchers that fail", "[matchers][vector][.][failing]" ) { + std::vector<int> v; + v.push_back( 1 ); + v.push_back( 2 ); + v.push_back( 3 ); - SECTION("Equals") { + std::vector<int> v2; + v2.push_back( 1 ); + v2.push_back( 2 ); - CHECK_THAT(v, Equals(v2)); - CHECK_THAT(v2, Equals(v)); - CHECK_THAT(empty, Equals(v)); - CHECK_THAT(v, Equals(empty)); - } - SECTION("UnorderedEquals") { - CHECK_THAT(v, UnorderedEquals(empty)); - CHECK_THAT(empty, UnorderedEquals(v)); + std::vector<double> v3; + v3.push_back( 1 ); + v3.push_back( 2 ); + v3.push_back( 3 ); - auto permuted = v; - std::next_permutation(begin(permuted), end(permuted)); - permuted.pop_back(); - CHECK_THAT(permuted, UnorderedEquals(v)); + std::vector<double> v4; + v4.push_back( 1.1 ); + v4.push_back( 2.1 ); + v4.push_back( 3.1 ); - std::reverse(begin(permuted), end(permuted)); - CHECK_THAT(permuted, UnorderedEquals(v)); - } - } - - TEST_CASE("Exception matchers that succeed", "[matchers][exceptions][!throws]") { - CHECK_THROWS_MATCHES(throwsSpecialException(1), SpecialException, ExceptionMatcher{1}); - REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, ExceptionMatcher{2}); - } - - TEST_CASE("Exception matchers that fail", "[matchers][exceptions][!throws][.failing]") { - SECTION("No exception") { - CHECK_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1}); - REQUIRE_THROWS_MATCHES(doesNotThrow(), SpecialException, ExceptionMatcher{1}); - } - SECTION("Type mismatch") { - CHECK_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1}); - REQUIRE_THROWS_MATCHES(throwsAsInt(1), SpecialException, ExceptionMatcher{1}); - } - SECTION("Contents are wrong") { - CHECK_THROWS_MATCHES(throwsSpecialException(3), SpecialException, ExceptionMatcher{1}); - REQUIRE_THROWS_MATCHES(throwsSpecialException(4), SpecialException, ExceptionMatcher{1}); - } - } + std::vector<int> empty; - TEST_CASE("Floating point matchers: float", "[matchers][floating-point]") { - SECTION("Relative") { - REQUIRE_THAT(10.f, WithinRel(11.1f, 0.1f)); - REQUIRE_THAT(10.f, !WithinRel(11.2f, 0.1f)); - REQUIRE_THAT( 1.f, !WithinRel(0.f, 0.99f)); - REQUIRE_THAT(-0.f, WithinRel(0.f)); - SECTION("Some subnormal values") { - auto v1 = std::numeric_limits<float>::min(); - auto v2 = v1; - for (int i = 0; i < 5; ++i) { - v2 = std::nextafter(v1, 0.f); - } - REQUIRE_THAT(v1, WithinRel(v2)); - } - } - SECTION("Margin") { - REQUIRE_THAT(1.f, WithinAbs(1.f, 0)); - REQUIRE_THAT(0.f, WithinAbs(1.f, 1)); - - REQUIRE_THAT(0.f, !WithinAbs(1.f, 0.99f)); - REQUIRE_THAT(0.f, !WithinAbs(1.f, 0.99f)); - - REQUIRE_THAT(0.f, WithinAbs(-0.f, 0)); - - REQUIRE_THAT(11.f, !WithinAbs(10.f, 0.5f)); - REQUIRE_THAT(10.f, !WithinAbs(11.f, 0.5f)); - REQUIRE_THAT(-10.f, WithinAbs(-10.f, 0.5f)); - REQUIRE_THAT(-10.f, WithinAbs(-9.6f, 0.5f)); - } - SECTION("ULPs") { - REQUIRE_THAT(1.f, WithinULP(1.f, 0)); + SECTION( "Contains (element)" ) { + CHECK_THAT( v, VectorContains( -1 ) ); + CHECK_THAT( empty, VectorContains( 1 ) ); + } + SECTION( "Contains (vector)" ) { + CHECK_THAT( empty, Contains( v ) ); + v2.push_back( 4 ); + CHECK_THAT( v, Contains( v2 ) ); + } - REQUIRE_THAT(nextafter(1.f, 2.f), WithinULP(1.f, 1)); - REQUIRE_THAT(0.f, WithinULP(nextafter(0.f, 1.f), 1)); - REQUIRE_THAT(1.f, WithinULP(nextafter(1.f, 0.f), 1)); - REQUIRE_THAT(1.f, !WithinULP(nextafter(1.f, 2.f), 0)); + SECTION( "Equals" ) { - REQUIRE_THAT(1.f, WithinULP(1.f, 0)); - REQUIRE_THAT(-0.f, WithinULP(0.f, 0)); - } - SECTION("Composed") { - REQUIRE_THAT(1.f, WithinAbs(1.f, 0.5) || WithinULP(1.f, 1)); - REQUIRE_THAT(1.f, WithinAbs(2.f, 0.5) || WithinULP(1.f, 0)); - REQUIRE_THAT(0.0001f, WithinAbs(0.f, 0.001f) || WithinRel(0.f, 0.1f)); - } - SECTION("Constructor validation") { - REQUIRE_NOTHROW(WithinAbs(1.f, 0.f)); - REQUIRE_THROWS_AS(WithinAbs(1.f, -1.f), std::domain_error); + CHECK_THAT( v, Equals( v2 ) ); + CHECK_THAT( v2, Equals( v ) ); + CHECK_THAT( empty, Equals( v ) ); + CHECK_THAT( v, Equals( empty ) ); + } + SECTION( "UnorderedEquals" ) { + CHECK_THAT( v, UnorderedEquals( empty ) ); + CHECK_THAT( empty, UnorderedEquals( v ) ); - REQUIRE_NOTHROW(WithinULP(1.f, 0)); - REQUIRE_THROWS_AS(WithinULP(1.f, static_cast<uint64_t>(-1)), std::domain_error); + auto permuted = v; + std::next_permutation( begin( permuted ), end( permuted ) ); + permuted.pop_back(); + CHECK_THAT( permuted, UnorderedEquals( v ) ); - REQUIRE_NOTHROW(WithinRel(1.f, 0.f)); - REQUIRE_THROWS_AS(WithinRel(1.f, -0.2f), std::domain_error); - REQUIRE_THROWS_AS(WithinRel(1.f, 1.f), std::domain_error); + std::reverse( begin( permuted ), end( permuted ) ); + CHECK_THAT( permuted, UnorderedEquals( v ) ); + } +} + +TEST_CASE( "Exception matchers that succeed", + "[matchers][exceptions][!throws]" ) { + CHECK_THROWS_MATCHES( + throwsSpecialException( 1 ), SpecialException, ExceptionMatcher{ 1 } ); + REQUIRE_THROWS_MATCHES( + throwsSpecialException( 2 ), SpecialException, ExceptionMatcher{ 2 } ); +} + +TEST_CASE( "Exception matchers that fail", + "[matchers][exceptions][!throws][.failing]" ) { + SECTION( "No exception" ) { + CHECK_THROWS_MATCHES( + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ); + REQUIRE_THROWS_MATCHES( + doesNotThrow(), SpecialException, ExceptionMatcher{ 1 } ); + } + SECTION( "Type mismatch" ) { + CHECK_THROWS_MATCHES( + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ); + REQUIRE_THROWS_MATCHES( + throwsAsInt( 1 ), SpecialException, ExceptionMatcher{ 1 } ); + } + SECTION( "Contents are wrong" ) { + CHECK_THROWS_MATCHES( throwsSpecialException( 3 ), + SpecialException, + ExceptionMatcher{ 1 } ); + REQUIRE_THROWS_MATCHES( throwsSpecialException( 4 ), + SpecialException, + ExceptionMatcher{ 1 } ); + } +} + +TEST_CASE( "Floating point matchers: float", "[matchers][floating-point]" ) { + SECTION( "Relative" ) { + REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) ); + REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) ); + REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) ); + REQUIRE_THAT( -0.f, WithinRel( 0.f ) ); + SECTION( "Some subnormal values" ) { + auto v1 = std::numeric_limits<float>::min(); + auto v2 = v1; + for ( int i = 0; i < 5; ++i ) { + v2 = std::nextafter( v1, 0.f ); } + REQUIRE_THAT( v1, WithinRel( v2 ) ); } + } + SECTION( "Margin" ) { + REQUIRE_THAT( 1.f, WithinAbs( 1.f, 0 ) ); + REQUIRE_THAT( 0.f, WithinAbs( 1.f, 1 ) ); - TEST_CASE("Floating point matchers: double", "[matchers][floating-point]") { - SECTION("Relative") { - REQUIRE_THAT(10., WithinRel(11.1, 0.1)); - REQUIRE_THAT(10., !WithinRel(11.2, 0.1)); - REQUIRE_THAT(1., !WithinRel(0., 0.99)); - REQUIRE_THAT(-0., WithinRel(0.)); - SECTION("Some subnormal values") { - auto v1 = std::numeric_limits<double>::min(); - auto v2 = v1; - for (int i = 0; i < 5; ++i) { - v2 = std::nextafter(v1, 0); - } - REQUIRE_THAT(v1, WithinRel(v2)); - } - } - SECTION("Margin") { - REQUIRE_THAT(1., WithinAbs(1., 0)); - REQUIRE_THAT(0., WithinAbs(1., 1)); - - REQUIRE_THAT(0., !WithinAbs(1., 0.99)); - REQUIRE_THAT(0., !WithinAbs(1., 0.99)); + REQUIRE_THAT( 0.f, !WithinAbs( 1.f, 0.99f ) ); + REQUIRE_THAT( 0.f, !WithinAbs( 1.f, 0.99f ) ); - REQUIRE_THAT(11., !WithinAbs(10., 0.5)); - REQUIRE_THAT(10., !WithinAbs(11., 0.5)); - REQUIRE_THAT(-10., WithinAbs(-10., 0.5)); - REQUIRE_THAT(-10., WithinAbs(-9.6, 0.5)); - } - SECTION("ULPs") { - REQUIRE_THAT(1., WithinULP(1., 0)); + REQUIRE_THAT( 0.f, WithinAbs( -0.f, 0 ) ); - REQUIRE_THAT(nextafter(1., 2.), WithinULP(1., 1)); - REQUIRE_THAT(0., WithinULP(nextafter(0., 1.), 1)); - REQUIRE_THAT(1., WithinULP(nextafter(1., 0.), 1)); - REQUIRE_THAT(1., !WithinULP(nextafter(1., 2.), 0)); - - REQUIRE_THAT(1., WithinULP(1., 0)); - REQUIRE_THAT(-0., WithinULP(0., 0)); - } - SECTION("Composed") { - REQUIRE_THAT(1., WithinAbs(1., 0.5) || WithinULP(2., 1)); - REQUIRE_THAT(1., WithinAbs(2., 0.5) || WithinULP(1., 0)); - REQUIRE_THAT(0.0001, WithinAbs(0., 0.001) || WithinRel(0., 0.1)); - } - SECTION("Constructor validation") { - REQUIRE_NOTHROW(WithinAbs(1., 0.)); - REQUIRE_THROWS_AS(WithinAbs(1., -1.), std::domain_error); + REQUIRE_THAT( 11.f, !WithinAbs( 10.f, 0.5f ) ); + REQUIRE_THAT( 10.f, !WithinAbs( 11.f, 0.5f ) ); + REQUIRE_THAT( -10.f, WithinAbs( -10.f, 0.5f ) ); + REQUIRE_THAT( -10.f, WithinAbs( -9.6f, 0.5f ) ); + } + SECTION( "ULPs" ) { + REQUIRE_THAT( 1.f, WithinULP( 1.f, 0 ) ); + REQUIRE_THAT(-1.f, WithinULP( -1.f, 0 ) ); - REQUIRE_NOTHROW(WithinULP(1., 0)); + REQUIRE_THAT( nextafter( 1.f, 2.f ), WithinULP( 1.f, 1 ) ); + REQUIRE_THAT( 0.f, WithinULP( nextafter( 0.f, 1.f ), 1 ) ); + REQUIRE_THAT( 1.f, WithinULP( nextafter( 1.f, 0.f ), 1 ) ); + REQUIRE_THAT( 1.f, !WithinULP( nextafter( 1.f, 2.f ), 0 ) ); - REQUIRE_NOTHROW(WithinRel(1., 0.)); - REQUIRE_THROWS_AS(WithinRel(1., -0.2), std::domain_error); - REQUIRE_THROWS_AS(WithinRel(1., 1.), std::domain_error); - } - } + REQUIRE_THAT( 1.f, WithinULP( 1.f, 0 ) ); + REQUIRE_THAT( -0.f, WithinULP( 0.f, 0 ) ); + } + SECTION( "Composed" ) { + REQUIRE_THAT( 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) ); + REQUIRE_THAT( 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) ); + REQUIRE_THAT( 0.0001f, + WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) ); + } + SECTION( "Constructor validation" ) { + REQUIRE_NOTHROW( WithinAbs( 1.f, 0.f ) ); + REQUIRE_THROWS_AS( WithinAbs( 1.f, -1.f ), std::domain_error ); - TEST_CASE("Floating point matchers that are problematic in approvals", "[approvals][matchers][floating-point]") { - REQUIRE_THAT(NAN, !WithinAbs(NAN, 0)); - REQUIRE_THAT(NAN, !(WithinAbs(NAN, 100) || WithinULP(NAN, 123))); - REQUIRE_THAT(NAN, !WithinULP(NAN, 123)); - REQUIRE_THAT(INFINITY, WithinRel(INFINITY)); - REQUIRE_THAT(-INFINITY, !WithinRel(INFINITY)); - REQUIRE_THAT(1., !WithinRel(INFINITY)); - REQUIRE_THAT(INFINITY, !WithinRel(1.)); - REQUIRE_THAT(NAN, !WithinRel(NAN)); - REQUIRE_THAT(1., !WithinRel(NAN)); - REQUIRE_THAT(NAN, !WithinRel(1.)); - } + REQUIRE_NOTHROW( WithinULP( 1.f, 0 ) ); + REQUIRE_THROWS_AS( WithinULP( 1.f, static_cast<uint64_t>( -1 ) ), + std::domain_error ); - TEST_CASE("Arbitrary predicate matcher", "[matchers][generic]") { - SECTION("Function pointer") { - REQUIRE_THAT(1, Predicate<int>(alwaysTrue, "always true")); - REQUIRE_THAT(1, !Predicate<int>(alwaysFalse, "always false")); - } - SECTION("Lambdas + different type") { - REQUIRE_THAT("Hello olleH", - Predicate<std::string>( - [] (std::string const& str) -> bool { return str.front() == str.back(); }, - "First and last character should be equal") - ); - - REQUIRE_THAT("This wouldn't pass", - !Predicate<std::string>( - [] (std::string const& str) -> bool { return str.front() == str.back(); } - ) - ); + REQUIRE_NOTHROW( WithinRel( 1.f, 0.f ) ); + REQUIRE_THROWS_AS( WithinRel( 1.f, -0.2f ), std::domain_error ); + REQUIRE_THROWS_AS( WithinRel( 1.f, 1.f ), std::domain_error ); + } +} + +TEST_CASE( "Floating point matchers: double", "[matchers][floating-point]" ) { + SECTION( "Relative" ) { + REQUIRE_THAT( 10., WithinRel( 11.1, 0.1 ) ); + REQUIRE_THAT( 10., !WithinRel( 11.2, 0.1 ) ); + REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) ); + REQUIRE_THAT( -0., WithinRel( 0. ) ); + SECTION( "Some subnormal values" ) { + auto v1 = std::numeric_limits<double>::min(); + auto v2 = v1; + for ( int i = 0; i < 5; ++i ) { + v2 = std::nextafter( v1, 0 ); } + REQUIRE_THAT( v1, WithinRel( v2 ) ); } + } + SECTION( "Margin" ) { + REQUIRE_THAT( 1., WithinAbs( 1., 0 ) ); + REQUIRE_THAT( 0., WithinAbs( 1., 1 ) ); - TEST_CASE("Regression test #1", "[matchers][vector]") { - // At some point, UnorderedEqualsMatcher skipped - // mismatched prefixed before doing the comparison itself - std::vector<char> actual = { 'a', 'b' }; - std::vector<char> expected = { 'c', 'b' }; + REQUIRE_THAT( 0., !WithinAbs( 1., 0.99 ) ); + REQUIRE_THAT( 0., !WithinAbs( 1., 0.99 ) ); - CHECK_THAT(actual, !UnorderedEquals(expected)); - } + REQUIRE_THAT( 11., !WithinAbs( 10., 0.5 ) ); + REQUIRE_THAT( 10., !WithinAbs( 11., 0.5 ) ); + REQUIRE_THAT( -10., WithinAbs( -10., 0.5 ) ); + REQUIRE_THAT( -10., WithinAbs( -9.6, 0.5 ) ); + } + SECTION( "ULPs" ) { + REQUIRE_THAT( 1., WithinULP( 1., 0 ) ); - TEST_CASE("Predicate matcher can accept const char*", "[matchers][compilation]") { - REQUIRE_THAT("foo", Predicate<const char*>([] (const char* const&) { return true; })); - } + REQUIRE_THAT( nextafter( 1., 2. ), WithinULP( 1., 1 ) ); + REQUIRE_THAT( 0., WithinULP( nextafter( 0., 1. ), 1 ) ); + REQUIRE_THAT( 1., WithinULP( nextafter( 1., 0. ), 1 ) ); + REQUIRE_THAT( 1., !WithinULP( nextafter( 1., 2. ), 0 ) ); - TEST_CASE("Vector Approx matcher", "[matchers][approx][vector]") { - using Catch::Matchers::Approx; - SECTION("Empty vector is roughly equal to an empty vector") { - std::vector<double> empty; - REQUIRE_THAT(empty, Approx(empty)); - } - SECTION("Vectors with elements") { - std::vector<double> v1({1., 2., 3.}); - SECTION("A vector is approx equal to itself") { - REQUIRE_THAT(v1, Approx(v1)); - REQUIRE_THAT(v1, Approx<double>({ 1., 2., 3. })); - } - std::vector<double> v2({1.5, 2.5, 3.5}); - SECTION("Different length") { - auto temp(v1); - temp.push_back(4); - REQUIRE_THAT(v1, !Approx(temp)); - } - SECTION("Same length, different elements") { - REQUIRE_THAT(v1, !Approx(v2)); - REQUIRE_THAT(v1, Approx(v2).margin(0.5)); - REQUIRE_THAT(v1, Approx(v2).epsilon(0.5)); - REQUIRE_THAT(v1, Approx(v2).epsilon(0.1).scale(500)); - } - } - } + REQUIRE_THAT( 1., WithinULP( 1., 0 ) ); + REQUIRE_THAT( -0., WithinULP( 0., 0 ) ); + } + SECTION( "Composed" ) { + REQUIRE_THAT( 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) ); + REQUIRE_THAT( 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) ); + REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) ); + } + SECTION( "Constructor validation" ) { + REQUIRE_NOTHROW( WithinAbs( 1., 0. ) ); + REQUIRE_THROWS_AS( WithinAbs( 1., -1. ), std::domain_error ); - TEST_CASE("Vector Approx matcher -- failing", "[matchers][approx][vector][.failing]") { - using Catch::Matchers::Approx; - SECTION("Empty and non empty vectors are not approx equal") { - std::vector<double> empty, t1({1, 2}); - CHECK_THAT(empty, Approx(t1)); - } - SECTION("Just different vectors") { - std::vector<double> v1({2., 4., 6.}), v2({1., 3., 5.}); - CHECK_THAT(v1, Approx(v2)); - } - } + REQUIRE_NOTHROW( WithinULP( 1., 0 ) ); - TEST_CASE("Exceptions matchers", "[matchers][exceptions][!throws]") { - REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, Message("DerivedException::what")); - REQUIRE_THROWS_MATCHES(throwsDerivedException(), DerivedException, !Message("derivedexception::what")); - REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, !Message("DerivedException::what")); - REQUIRE_THROWS_MATCHES(throwsSpecialException(2), SpecialException, Message("SpecialException::what")); + REQUIRE_NOTHROW( WithinRel( 1., 0. ) ); + REQUIRE_THROWS_AS( WithinRel( 1., -0.2 ), std::domain_error ); + REQUIRE_THROWS_AS( WithinRel( 1., 1. ), std::domain_error ); + } +} + +TEST_CASE( "Floating point matchers that are problematic in approvals", + "[approvals][matchers][floating-point]" ) { + REQUIRE_THAT( NAN, !WithinAbs( NAN, 0 ) ); + REQUIRE_THAT( NAN, !( WithinAbs( NAN, 100 ) || WithinULP( NAN, 123 ) ) ); + REQUIRE_THAT( NAN, !WithinULP( NAN, 123 ) ); + REQUIRE_THAT( INFINITY, WithinRel( INFINITY ) ); + REQUIRE_THAT( -INFINITY, !WithinRel( INFINITY ) ); + REQUIRE_THAT( 1., !WithinRel( INFINITY ) ); + REQUIRE_THAT( INFINITY, !WithinRel( 1. ) ); + REQUIRE_THAT( NAN, !WithinRel( NAN ) ); + REQUIRE_THAT( 1., !WithinRel( NAN ) ); + REQUIRE_THAT( NAN, !WithinRel( 1. ) ); +} + +TEST_CASE( "Arbitrary predicate matcher", "[matchers][generic]" ) { + SECTION( "Function pointer" ) { + REQUIRE_THAT( 1, Predicate<int>( alwaysTrue, "always true" ) ); + REQUIRE_THAT( 1, !Predicate<int>( alwaysFalse, "always false" ) ); + } + SECTION( "Lambdas + different type" ) { + REQUIRE_THAT( "Hello olleH", + Predicate<std::string>( + []( std::string const& str ) -> bool { + return str.front() == str.back(); + }, + "First and last character should be equal" ) ); + + REQUIRE_THAT( + "This wouldn't pass", + !Predicate<std::string>( []( std::string const& str ) -> bool { + return str.front() == str.back(); + } ) ); + } +} + +TEST_CASE( "Regression test #1", "[matchers][vector]" ) { + // At some point, UnorderedEqualsMatcher skipped + // mismatched prefixed before doing the comparison itself + std::vector<char> actual = { 'a', 'b' }; + std::vector<char> expected = { 'c', 'b' }; + + CHECK_THAT( actual, !UnorderedEquals( expected ) ); +} + +TEST_CASE( "Predicate matcher can accept const char*", + "[matchers][compilation]" ) { + REQUIRE_THAT( "foo", Predicate<const char*>( []( const char* const& ) { + return true; + } ) ); +} + +TEST_CASE( "Vector Approx matcher", "[matchers][approx][vector]" ) { + using Catch::Matchers::Approx; + SECTION( "Empty vector is roughly equal to an empty vector" ) { + std::vector<double> empty; + REQUIRE_THAT( empty, Approx( empty ) ); + } + SECTION( "Vectors with elements" ) { + std::vector<double> v1( { 1., 2., 3. } ); + SECTION( "A vector is approx equal to itself" ) { + REQUIRE_THAT( v1, Approx( v1 ) ); + REQUIRE_THAT( v1, Approx<double>( { 1., 2., 3. } ) ); } - - struct CheckedTestingMatcher : Catch::Matchers::MatcherBase<int> { - mutable bool matchCalled = false; - bool matchSucceeds = false; - - bool match(int const&) const override { - matchCalled = true; - return matchSucceeds; - } - std::string describe() const override { - return "CheckedTestingMatcher set to " + (matchSucceeds ? std::string("succeed") : std::string("fail")); - } - }; - - TEST_CASE("Composed matchers shortcircuit", "[matchers][composed]") { - // Check that if first returns false, second is not touched - CheckedTestingMatcher first, second; - SECTION("MatchAllOf") { - first.matchSucceeds = false; - - Detail::MatchAllOf<int> matcher = - Detail::MatchAllOf<int>{} && first && second; - CHECK_FALSE( matcher.match( 1 ) ); - - // These two assertions are the important ones - REQUIRE(first.matchCalled); - REQUIRE(!second.matchCalled); - } - // Check that if first returns true, second is not touched - SECTION("MatchAnyOf") { - first.matchSucceeds = true; - - Detail::MatchAnyOf<int> matcher = - Detail::MatchAnyOf<int>{} || first || second; - CHECK( matcher.match( 1 ) ); - - // These two assertions are the important ones - REQUIRE(first.matchCalled); - REQUIRE(!second.matchCalled); - } + std::vector<double> v2( { 1.5, 2.5, 3.5 } ); + SECTION( "Different length" ) { + auto temp( v1 ); + temp.push_back( 4 ); + REQUIRE_THAT( v1, !Approx( temp ) ); } - - struct CheckedTestingGenericMatcher : Catch::Matchers::MatcherGenericBase { - mutable bool matchCalled = false; - bool matchSucceeds = false; - - bool match(int const&) const { - matchCalled = true; - return matchSucceeds; - } - std::string describe() const override { - return "CheckedTestingGenericMatcher set to " + (matchSucceeds ? std::string("succeed") : std::string("fail")); - } - }; - - TEST_CASE("Composed generic matchers shortcircuit", "[matchers][composed][generic]") { - // Check that if first returns false, second is not touched - CheckedTestingGenericMatcher first, second; - SECTION("MatchAllOf") { - first.matchSucceeds = false; - - Detail::MatchAllOfGeneric<CheckedTestingGenericMatcher, - CheckedTestingGenericMatcher> - matcher{ first, second }; - - CHECK_FALSE( matcher.match( 1 ) ); - - // These two assertions are the important ones - REQUIRE(first.matchCalled); - REQUIRE(!second.matchCalled); - } - // Check that if first returns true, second is not touched - SECTION("MatchAnyOf") { - first.matchSucceeds = true; - - Detail::MatchAnyOfGeneric<CheckedTestingGenericMatcher, - CheckedTestingGenericMatcher> - matcher{ first, second }; - CHECK(matcher.match(1)); - - // These two assertions are the important ones - REQUIRE(first.matchCalled); - REQUIRE(!second.matchCalled); - } + SECTION( "Same length, different elements" ) { + REQUIRE_THAT( v1, !Approx( v2 ) ); + REQUIRE_THAT( v1, Approx( v2 ).margin( 0.5 ) ); + REQUIRE_THAT( v1, Approx( v2 ).epsilon( 0.5 ) ); + REQUIRE_THAT( v1, Approx( v2 ).epsilon( 0.1 ).scale( 500 ) ); } + } +} + +TEST_CASE( "Vector Approx matcher -- failing", + "[matchers][approx][vector][.failing]" ) { + using Catch::Matchers::Approx; + SECTION( "Empty and non empty vectors are not approx equal" ) { + std::vector<double> empty, t1( { 1, 2 } ); + CHECK_THAT( empty, Approx( t1 ) ); + } + SECTION( "Just different vectors" ) { + std::vector<double> v1( { 2., 4., 6. } ), v2( { 1., 3., 5. } ); + CHECK_THAT( v1, Approx( v2 ) ); + } +} + +TEST_CASE( "Exceptions matchers", "[matchers][exceptions][!throws]" ) { + REQUIRE_THROWS_MATCHES( throwsDerivedException(), + DerivedException, + Message( "DerivedException::what" ) ); + REQUIRE_THROWS_MATCHES( throwsDerivedException(), + DerivedException, + !Message( "derivedexception::what" ) ); + REQUIRE_THROWS_MATCHES( throwsSpecialException( 2 ), + SpecialException, + !Message( "DerivedException::what" ) ); + REQUIRE_THROWS_MATCHES( throwsSpecialException( 2 ), + SpecialException, + Message( "SpecialException::what" ) ); +} + +struct CheckedTestingMatcher : Catch::Matchers::MatcherBase<int> { + mutable bool matchCalled = false; + bool matchSucceeds = false; + + bool match( int const& ) const override { + matchCalled = true; + return matchSucceeds; + } + std::string describe() const override { + return "CheckedTestingMatcher set to " + + ( matchSucceeds ? std::string( "succeed" ) + : std::string( "fail" ) ); + } +}; +TEST_CASE( "Composed matchers shortcircuit", "[matchers][composed]" ) { + // Check that if first returns false, second is not touched + CheckedTestingMatcher first, second; + SECTION( "MatchAllOf" ) { + first.matchSucceeds = false; - template<typename Range> - struct EqualsRangeMatcher : Catch::Matchers::MatcherGenericBase { - - EqualsRangeMatcher(Range const& range) : m_range{ range } {} - - template<typename OtherRange> - bool match(OtherRange const& other) const { - using std::begin; - using std::end; - - return std::equal(begin(m_range), end(m_range), begin(other), end(other)); - } + Detail::MatchAllOf<int> matcher = + Detail::MatchAllOf<int>{} && first && second; + CHECK_FALSE( matcher.match( 1 ) ); - std::string describe() const override { - return "Equals: " + Catch::rangeToString(m_range); - } + // These two assertions are the important ones + REQUIRE( first.matchCalled ); + REQUIRE( !second.matchCalled ); + } + // Check that if first returns true, second is not touched + SECTION( "MatchAnyOf" ) { + first.matchSucceeds = true; - private: - Range const& m_range; - }; + Detail::MatchAnyOf<int> matcher = + Detail::MatchAnyOf<int>{} || first || second; + CHECK( matcher.match( 1 ) ); - template<typename Range> - auto EqualsRange(const Range& range) -> EqualsRangeMatcher<Range> { - return EqualsRangeMatcher<Range>{range}; + // These two assertions are the important ones + REQUIRE( first.matchCalled ); + REQUIRE( !second.matchCalled ); } +} - TEST_CASE("Combining templated matchers", "[matchers][templated]") { - std::array<int, 3> container{{ 1,2,3 }}; - - std::array<int, 3> a{{ 1,2,3 }}; - std::vector<int> b{ 0,1,2 }; - std::list<int> c{ 4,5,6 }; +struct CheckedTestingGenericMatcher : Catch::Matchers::MatcherGenericBase { + mutable bool matchCalled = false; + bool matchSucceeds = false; - REQUIRE_THAT(container, EqualsRange(a) || EqualsRange(b) || EqualsRange(c)); + bool match( int const& ) const { + matchCalled = true; + return matchSucceeds; } + std::string describe() const override { + return "CheckedTestingGenericMatcher set to " + + ( matchSucceeds ? std::string( "succeed" ) + : std::string( "fail" ) ); + } +}; - TEST_CASE("Combining templated and concrete matchers", "[matchers][templated]") { - std::vector<int> vec{ 1, 3, 5 }; +TEST_CASE( "Composed generic matchers shortcircuit", + "[matchers][composed][generic]" ) { + // Check that if first returns false, second is not touched + CheckedTestingGenericMatcher first, second; + SECTION( "MatchAllOf" ) { + first.matchSucceeds = false; - std::array<int, 3> a{{ 5, 3, 1 }}; + Detail::MatchAllOfGeneric<CheckedTestingGenericMatcher, + CheckedTestingGenericMatcher> + matcher{ first, second }; - REQUIRE_THAT(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)); + CHECK_FALSE( matcher.match( 1 ) ); - const std::string str = "foobar"; - const std::array<char, 6> arr{{ 'f', 'o', 'o', 'b', 'a', 'r' }}; - const std::array<char, 6> bad_arr{{ 'o', 'o', 'f', 'b', 'a', 'r' }}; + // These two assertions are the important ones + REQUIRE( first.matchCalled ); + REQUIRE( !second.matchCalled ); + } + // Check that if first returns true, second is not touched + SECTION( "MatchAnyOf" ) { + first.matchSucceeds = true; + + Detail::MatchAnyOfGeneric<CheckedTestingGenericMatcher, + CheckedTestingGenericMatcher> + matcher{ first, second }; + CHECK( matcher.match( 1 ) ); + + // These two assertions are the important ones + REQUIRE( first.matchCalled ); + REQUIRE( !second.matchCalled ); + } +} - using Catch::Matchers::StartsWith; - using Catch::Matchers::EndsWith; +template <typename Range> +struct EqualsRangeMatcher : Catch::Matchers::MatcherGenericBase { - REQUIRE_THAT(str, StartsWith("foo") && EqualsRange(arr) && EndsWith("bar")); - REQUIRE_THAT(str, StartsWith("foo") && !EqualsRange(bad_arr) && EndsWith("bar")); + EqualsRangeMatcher( Range const& range ): m_range{ range } {} - REQUIRE_THAT(str, EqualsRange(arr) && StartsWith("foo") && EndsWith("bar")); - REQUIRE_THAT(str, !EqualsRange(bad_arr) && StartsWith("foo") && EndsWith("bar")); + template <typename OtherRange> bool match( OtherRange const& other ) const { + using std::begin; + using std::end; - REQUIRE_THAT(str, EqualsRange(bad_arr) || (StartsWith("foo") && EndsWith("bar"))); - REQUIRE_THAT(str, (StartsWith("foo") && EndsWith("bar")) || EqualsRange(bad_arr)); + return std::equal( + begin( m_range ), end( m_range ), begin( other ), end( other ) ); } - TEST_CASE("Combining concrete matchers does not use templated matchers", "[matchers][templated]") { - using Catch::Matchers::StartsWith; - using Catch::Matchers::EndsWith; + std::string describe() const override { + return "Equals: " + Catch::rangeToString( m_range ); + } - STATIC_REQUIRE(std::is_same< - decltype(StartsWith("foo") || (StartsWith("bar") && EndsWith("bar") && !EndsWith("foo"))), - Catch::Matchers::Detail::MatchAnyOf<std::string> - >::value); +private: + Range const& m_range; +}; + +template <typename Range> +auto EqualsRange( const Range& range ) -> EqualsRangeMatcher<Range> { + return EqualsRangeMatcher<Range>{ range }; +} + +TEST_CASE( "Combining templated matchers", "[matchers][templated]" ) { + std::array<int, 3> container{ { 1, 2, 3 } }; + + std::array<int, 3> a{ { 1, 2, 3 } }; + std::vector<int> b{ 0, 1, 2 }; + std::list<int> c{ 4, 5, 6 }; + + REQUIRE_THAT( container, + EqualsRange( a ) || EqualsRange( b ) || EqualsRange( c ) ); +} + +TEST_CASE( "Combining templated and concrete matchers", + "[matchers][templated]" ) { + std::vector<int> vec{ 1, 3, 5 }; + + std::array<int, 3> a{ { 5, 3, 1 } }; + + REQUIRE_THAT( 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 ) ); + + const std::string str = "foobar"; + const std::array<char, 6> arr{ { 'f', 'o', 'o', 'b', 'a', 'r' } }; + const std::array<char, 6> bad_arr{ { 'o', 'o', 'f', 'b', 'a', 'r' } }; + + using Catch::Matchers::EndsWith; + using Catch::Matchers::StartsWith; + + REQUIRE_THAT( + str, StartsWith( "foo" ) && EqualsRange( arr ) && EndsWith( "bar" ) ); + REQUIRE_THAT( str, + StartsWith( "foo" ) && !EqualsRange( bad_arr ) && + EndsWith( "bar" ) ); + + REQUIRE_THAT( + str, EqualsRange( arr ) && StartsWith( "foo" ) && EndsWith( "bar" ) ); + REQUIRE_THAT( str, + !EqualsRange( bad_arr ) && StartsWith( "foo" ) && + EndsWith( "bar" ) ); + + REQUIRE_THAT( str, + EqualsRange( bad_arr ) || + ( StartsWith( "foo" ) && EndsWith( "bar" ) ) ); + REQUIRE_THAT( str, + ( StartsWith( "foo" ) && EndsWith( "bar" ) ) || + EqualsRange( bad_arr ) ); +} + +TEST_CASE( "Combining concrete matchers does not use templated matchers", + "[matchers][templated]" ) { + using Catch::Matchers::EndsWith; + using Catch::Matchers::StartsWith; + + STATIC_REQUIRE( + std::is_same<decltype( StartsWith( "foo" ) || + ( StartsWith( "bar" ) && EndsWith( "bar" ) && + !EndsWith( "foo" ) ) ), + Catch::Matchers::Detail::MatchAnyOf<std::string>>::value ); +} + +struct MatcherA : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { + return "equals: (int) 1 or (float) 1.0f"; + } + bool match( int i ) const { return i == 1; } + bool match( float f ) const { return f == 1.0f; } +}; + +struct MatcherB : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { return "equals: (long long) 1"; } + bool match( long long l ) const { return l == 1ll; } +}; + +struct MatcherC : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { return "equals: (T) 1"; } + template <typename T> bool match( T t ) const { return t == T{ 1 }; } +}; + +struct MatcherD : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { return "equals: true"; } + bool match( bool b ) const { return b == true; } +}; + +TEST_CASE( "Combining only templated matchers", "[matchers][templated]" ) { + STATIC_REQUIRE( + std::is_same<decltype( MatcherA() || MatcherB() ), + Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB>>::value ); + + REQUIRE_THAT( 1, MatcherA() || MatcherB() ); + + STATIC_REQUIRE( + std::is_same<decltype( MatcherA() && MatcherB() ), + Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB>>::value ); + + REQUIRE_THAT( 1, MatcherA() && MatcherB() ); + + STATIC_REQUIRE( + std::is_same< + decltype( MatcherA() || !MatcherB() ), + Catch::Matchers::Detail::MatchAnyOfGeneric< + MatcherA, + Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>>>::value ); + + REQUIRE_THAT( 1, MatcherA() || !MatcherB() ); +} + +TEST_CASE( "Combining MatchAnyOfGeneric does not nest", + "[matchers][templated]" ) { + // MatchAnyOfGeneric LHS + some matcher RHS + STATIC_REQUIRE( + std::is_same< + decltype( ( MatcherA() || MatcherB() ) || MatcherC() ), + Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value ); + + REQUIRE_THAT( 1, ( MatcherA() || MatcherB() ) || MatcherC() ); + + // some matcher LHS + MatchAnyOfGeneric RHS + STATIC_REQUIRE( + std::is_same< + decltype( MatcherA() || ( MatcherB() || MatcherC() ) ), + Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC>>::value ); + + REQUIRE_THAT( 1, MatcherA() || ( MatcherB() || MatcherC() ) ); + + // MatchAnyOfGeneric LHS + MatchAnyOfGeneric RHS + STATIC_REQUIRE( + std::is_same< + decltype( ( MatcherA() || MatcherB() ) || + ( MatcherC() || MatcherD() ) ), + Catch::Matchers::Detail:: + MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: + value ); + + REQUIRE_THAT( + 1, ( MatcherA() || MatcherB() ) || ( MatcherC() || MatcherD() ) ); +} + +TEST_CASE( "Combining MatchAllOfGeneric does not nest", + "[matchers][templated]" ) { + // MatchAllOfGeneric lhs + some matcher RHS + STATIC_REQUIRE( + std::is_same< + decltype( ( MatcherA() && MatcherB() ) && MatcherC() ), + Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value ); + + REQUIRE_THAT( 1, ( MatcherA() && MatcherB() ) && MatcherC() ); + + // some matcher LHS + MatchAllOfGeneric RSH + STATIC_REQUIRE( + std::is_same< + decltype( MatcherA() && ( MatcherB() && MatcherC() ) ), + Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB, MatcherC>>::value ); + + REQUIRE_THAT( 1, MatcherA() && ( MatcherB() && MatcherC() ) ); + + // MatchAllOfGeneric LHS + MatchAllOfGeneric RHS + STATIC_REQUIRE( + std::is_same< + decltype( ( MatcherA() && MatcherB() ) && + ( MatcherC() && MatcherD() ) ), + Catch::Matchers::Detail:: + MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD>>:: + value ); + + REQUIRE_THAT( + 1, ( MatcherA() && MatcherB() ) && ( MatcherC() && MatcherD() ) ); +} + +TEST_CASE( "Combining MatchNotOfGeneric does not nest", + "[matchers][templated]" ) { + STATIC_REQUIRE( + std::is_same< + decltype( !MatcherA() ), + Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value ); + + REQUIRE_THAT( 0, !MatcherA() ); + + STATIC_REQUIRE( + std::is_same<decltype( !!MatcherA() ), MatcherA const&>::value ); + + REQUIRE_THAT( 1, !!MatcherA() ); + + STATIC_REQUIRE( + std::is_same< + decltype( !!!MatcherA() ), + Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA>>::value ); + + REQUIRE_THAT( 0, !!!MatcherA() ); + + STATIC_REQUIRE( + std::is_same<decltype( !!!!MatcherA() ), MatcherA const&>::value ); + + REQUIRE_THAT( 1, !!!!MatcherA() ); +} + +struct EvilAddressOfOperatorUsed : std::exception { + EvilAddressOfOperatorUsed() {} + const char* what() const noexcept override { + return "overloaded address-of operator of matcher was used instead of " + "std::addressof"; } +}; - struct MatcherA : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { return "equals: (int) 1 or (float) 1.0f"; } - bool match(int i) const { return i == 1; } - bool match(float f) const { return f == 1.0f; } - }; +struct EvilCommaOperatorUsed : std::exception { + EvilCommaOperatorUsed() {} + const char* what() const noexcept override { + return "overloaded comma operator of matcher was used"; + } +}; - struct MatcherB : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { return "equals: (long long) 1"; } - bool match(long long l) const { return l == 1ll; } - }; +struct EvilMatcher : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { return "equals: 45"; } - struct MatcherC : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { return "equals: (T) 1"; } - template<typename T> - bool match(T t) const { return t == T{1}; } - }; + bool match( int i ) const { return i == 45; } - struct MatcherD : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { return "equals: true"; } - bool match(bool b) const { return b == true; } - }; + EvilMatcher const* operator&() const { throw EvilAddressOfOperatorUsed(); } - TEST_CASE("Combining only templated matchers", "[matchers][templated]") { - STATIC_REQUIRE(std::is_same< - decltype(MatcherA() || MatcherB()), - Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB> - >::value); + int operator,( EvilMatcher const& ) const { throw EvilCommaOperatorUsed(); } +}; - REQUIRE_THAT(1, MatcherA() || MatcherB()); +TEST_CASE( "Overloaded comma or address-of operators are not used", + "[matchers][templated]" ) { + REQUIRE_THROWS_AS( ( EvilMatcher(), EvilMatcher() ), + EvilCommaOperatorUsed ); + REQUIRE_THROWS_AS( &EvilMatcher(), EvilAddressOfOperatorUsed ); + REQUIRE_NOTHROW( EvilMatcher() || ( EvilMatcher() && !EvilMatcher() ) ); + REQUIRE_NOTHROW( ( EvilMatcher() && EvilMatcher() ) || !EvilMatcher() ); +} - STATIC_REQUIRE(std::is_same< - decltype(MatcherA() && MatcherB()), - Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB> - >::value); +struct ImmovableMatcher : Catch::Matchers::MatcherGenericBase { + ImmovableMatcher() = default; + ImmovableMatcher( ImmovableMatcher const& ) = delete; + ImmovableMatcher( ImmovableMatcher&& ) = delete; + ImmovableMatcher& operator=( ImmovableMatcher const& ) = delete; + ImmovableMatcher& operator=( ImmovableMatcher&& ) = delete; - REQUIRE_THAT(1, MatcherA() && MatcherB()); + std::string describe() const override { return "always false"; } - STATIC_REQUIRE(std::is_same< - decltype(MatcherA() || !MatcherB()), - Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, Catch::Matchers::Detail::MatchNotOfGeneric<MatcherB>> - >::value); + template <typename T> bool match( T&& ) const { return false; } +}; - REQUIRE_THAT(1, MatcherA() || !MatcherB()); +struct MatcherWasMovedOrCopied : std::exception { + MatcherWasMovedOrCopied() {} + const char* what() const noexcept override { + return "attempted to copy or move a matcher"; } +}; - TEST_CASE("Combining MatchAnyOfGeneric does not nest", "[matchers][templated]") { - // MatchAnyOfGeneric LHS + some matcher RHS - STATIC_REQUIRE(std::is_same< - decltype((MatcherA() || MatcherB()) || MatcherC()), - Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> - >::value); - - REQUIRE_THAT(1, (MatcherA() || MatcherB()) || MatcherC()); - - // some matcher LHS + MatchAnyOfGeneric RHS - STATIC_REQUIRE(std::is_same< - decltype(MatcherA() || (MatcherB() || MatcherC())), - Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC> - >::value); - - REQUIRE_THAT(1, MatcherA() || (MatcherB() || MatcherC())); - - - // MatchAnyOfGeneric LHS + MatchAnyOfGeneric RHS - STATIC_REQUIRE(std::is_same< - decltype((MatcherA() || MatcherB()) || (MatcherC() || MatcherD())), - Catch::Matchers::Detail::MatchAnyOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> - >::value); - - REQUIRE_THAT(1, (MatcherA() || MatcherB()) || (MatcherC() || MatcherD())); +struct ThrowOnCopyOrMoveMatcher : Catch::Matchers::MatcherGenericBase { + ThrowOnCopyOrMoveMatcher() = default; + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher const& ): + Catch::Matchers::MatcherGenericBase() { + throw MatcherWasMovedOrCopied(); } - - TEST_CASE("Combining MatchAllOfGeneric does not nest", "[matchers][templated]") { - // MatchAllOfGeneric lhs + some matcher RHS - STATIC_REQUIRE(std::is_same< - decltype((MatcherA() && MatcherB()) && MatcherC()), - Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> - >::value); - - REQUIRE_THAT(1, (MatcherA() && MatcherB()) && MatcherC()); - - // some matcher LHS + MatchAllOfGeneric RSH - STATIC_REQUIRE(std::is_same< - decltype(MatcherA() && (MatcherB() && MatcherC())), - Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC> - >::value); - - REQUIRE_THAT(1, MatcherA() && (MatcherB() && MatcherC())); - - - // MatchAllOfGeneric LHS + MatchAllOfGeneric RHS - STATIC_REQUIRE(std::is_same< - decltype((MatcherA() && MatcherB()) && (MatcherC() && MatcherD())), - Catch::Matchers::Detail::MatchAllOfGeneric<MatcherA, MatcherB, MatcherC, MatcherD> - >::value); - - REQUIRE_THAT(1, (MatcherA() && MatcherB()) && (MatcherC() && MatcherD())); + [[noreturn]] ThrowOnCopyOrMoveMatcher( ThrowOnCopyOrMoveMatcher&& ): + Catch::Matchers::MatcherGenericBase() { + throw MatcherWasMovedOrCopied(); } - - TEST_CASE("Combining MatchNotOfGeneric does not nest", "[matchers][templated]") { - STATIC_REQUIRE(std::is_same< - decltype(!MatcherA()), - Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> - >::value); - - REQUIRE_THAT(0, !MatcherA()); - - STATIC_REQUIRE(std::is_same< - decltype(!!MatcherA()), - MatcherA const& - >::value); - - REQUIRE_THAT(1, !!MatcherA()); - - STATIC_REQUIRE(std::is_same< - decltype(!!!MatcherA()), - Catch::Matchers::Detail::MatchNotOfGeneric<MatcherA> - >::value); - - REQUIRE_THAT(0, !!!MatcherA()); - - STATIC_REQUIRE(std::is_same< - decltype(!!!!MatcherA()), - MatcherA const & - >::value); - - REQUIRE_THAT(1, !!!!MatcherA()); + ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher const& ) { + throw MatcherWasMovedOrCopied(); } - - struct EvilAddressOfOperatorUsed : std::exception { - EvilAddressOfOperatorUsed() {} - const char* what() const noexcept override { - return "overloaded address-of operator of matcher was used instead of std::addressof"; - } - }; - - struct EvilCommaOperatorUsed : std::exception { - EvilCommaOperatorUsed() {} - const char* what() const noexcept override { - return "overloaded comma operator of matcher was used"; - } - }; - - struct EvilMatcher : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { - return "equals: 45"; - } - - bool match(int i) const { - return i == 45; - } - - EvilMatcher const* operator& () const { - throw EvilAddressOfOperatorUsed(); - } - - int operator,(EvilMatcher const&) const { - throw EvilCommaOperatorUsed(); - } - }; - - TEST_CASE("Overloaded comma or address-of operators are not used", "[matchers][templated]") { - REQUIRE_THROWS_AS((EvilMatcher(), EvilMatcher()), EvilCommaOperatorUsed); - REQUIRE_THROWS_AS(&EvilMatcher(), EvilAddressOfOperatorUsed); - REQUIRE_NOTHROW(EvilMatcher() || (EvilMatcher() && !EvilMatcher())); - REQUIRE_NOTHROW((EvilMatcher() && EvilMatcher()) || !EvilMatcher()); + ThrowOnCopyOrMoveMatcher& operator=( ThrowOnCopyOrMoveMatcher&& ) { + throw MatcherWasMovedOrCopied(); } - struct ImmovableMatcher : Catch::Matchers::MatcherGenericBase { - ImmovableMatcher() = default; - ImmovableMatcher(ImmovableMatcher const&) = delete; - ImmovableMatcher(ImmovableMatcher &&) = delete; - ImmovableMatcher& operator=(ImmovableMatcher const&) = delete; - ImmovableMatcher& operator=(ImmovableMatcher &&) = delete; + std::string describe() const override { return "always false"; } - std::string describe() const override { - return "always false"; - } - - template<typename T> - bool match(T&&) const { - return false; - } - }; - - struct MatcherWasMovedOrCopied : std::exception { - MatcherWasMovedOrCopied() {} - const char* what() const noexcept override { - return "attempted to copy or move a matcher"; - } - }; + template <typename T> bool match( T&& ) const { return false; } +}; - struct ThrowOnCopyOrMoveMatcher : Catch::Matchers::MatcherGenericBase { - ThrowOnCopyOrMoveMatcher() = default; - [[noreturn]] - ThrowOnCopyOrMoveMatcher(ThrowOnCopyOrMoveMatcher const&): Catch::Matchers::MatcherGenericBase() { - throw MatcherWasMovedOrCopied(); - } - [[noreturn]] - ThrowOnCopyOrMoveMatcher(ThrowOnCopyOrMoveMatcher &&): Catch::Matchers::MatcherGenericBase() { - throw MatcherWasMovedOrCopied(); - } - ThrowOnCopyOrMoveMatcher& operator=(ThrowOnCopyOrMoveMatcher const&) { - throw MatcherWasMovedOrCopied(); - } - ThrowOnCopyOrMoveMatcher& operator=(ThrowOnCopyOrMoveMatcher &&) { - throw MatcherWasMovedOrCopied(); - } - - std::string describe() const override { - return "always false"; - } +TEST_CASE( "Matchers are not moved or copied", + "[matchers][templated][approvals]" ) { + REQUIRE_NOTHROW( + ( ThrowOnCopyOrMoveMatcher() && ThrowOnCopyOrMoveMatcher() ) || + !ThrowOnCopyOrMoveMatcher() ); +} - template<typename T> - bool match(T&&) const { - return false; - } - }; +TEST_CASE( "Immovable matchers can be used", + "[matchers][templated][approvals]" ) { + REQUIRE_THAT( 123, + ( ImmovableMatcher() && ImmovableMatcher() ) || + !ImmovableMatcher() ); +} - TEST_CASE("Matchers are not moved or copied", "[matchers][templated][approvals]") { - REQUIRE_NOTHROW((ThrowOnCopyOrMoveMatcher() && ThrowOnCopyOrMoveMatcher()) || !ThrowOnCopyOrMoveMatcher()); - } +struct ReferencingMatcher : Catch::Matchers::MatcherGenericBase { + std::string describe() const override { return "takes reference"; } + bool match( int& i ) const { return i == 22; } +}; - TEST_CASE("Immovable matchers can be used", "[matchers][templated][approvals]") { - REQUIRE_THAT(123, (ImmovableMatcher() && ImmovableMatcher()) || !ImmovableMatcher()); - } +TEST_CASE( "Matchers can take references", + "[matchers][templated][approvals]" ) { + REQUIRE_THAT( 22, ReferencingMatcher{} ); +} - struct ReferencingMatcher : Catch::Matchers::MatcherGenericBase { - std::string describe() const override { - return "takes reference"; - } - bool match(int& i) const { - return i == 22; - } - }; +#ifdef __clang__ +# pragma clang diagnostic pop +#endif - TEST_CASE("Matchers can take references", "[matchers][templated][approvals]") { - REQUIRE_THAT(22, ReferencingMatcher{}); - } +TEMPLATE_TEST_CASE( + "#2152 - ULP checks between differently signed values were wrong", + "[matchers][floating-point][ulp]", + float, + double ) { + using Catch::Matchers::WithinULP; -} } // namespace MatchersTests + static constexpr TestType smallest_non_zero = + std::numeric_limits<TestType>::denorm_min(); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif + CHECK_THAT( smallest_non_zero, WithinULP( -smallest_non_zero, 2 ) ); + CHECK_THAT( smallest_non_zero, !WithinULP( -smallest_non_zero, 1 ) ); +} diff --git a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp index 277723a8b71f1621c852f862dd22672450b9836c..e3b9bd3a23881ca2fe953a8ae6cd1dbd65e84c0f 100644 --- a/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp +++ b/packages/Catch2/tests/SelfTest/UsageTests/Misc.tests.cpp @@ -19,60 +19,58 @@ #include <array> #include <tuple> -namespace { namespace MiscTests { +namespace { -#ifndef MISC_TEST_HELPERS_INCLUDED // Don't compile this more than once per TU -#define MISC_TEST_HELPERS_INCLUDED + static const char* makeString(bool makeNull) { + return makeNull ? nullptr : "valid string"; + } + static bool testCheckedIf(bool flag) { + CHECKED_IF(flag) + return true; + else + return false; + } + static bool testCheckedElse(bool flag) { + CHECKED_ELSE(flag) + return false; -inline const char* makeString( bool makeNull ) { - return makeNull ? nullptr : "valid string"; -} -inline bool testCheckedIf( bool flag ) { - CHECKED_IF( flag ) return true; - else - return false; -} -inline bool testCheckedElse( bool flag ) { - CHECKED_ELSE( flag ) - return false; + } - return true; -} + static unsigned int Factorial(unsigned int number) { + return number > 1 ? Factorial(number - 1) * number : 1; + } -inline unsigned int Factorial( unsigned int number ) { - return number > 1 ? Factorial(number-1)*number : 1; -} + static int f() { + return 1; + } -static int f() { - return 1; -} + static void manuallyRegisteredTestFunction() { + SUCCEED("was called"); + } -inline void manuallyRegisteredTestFunction() { - SUCCEED( "was called" ); -} + struct AutoTestReg { + AutoTestReg() { + REGISTER_TEST_CASE(manuallyRegisteredTestFunction, "ManuallyRegistered"); + } + }; -struct AutoTestReg { - AutoTestReg() { - REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered" ); - } -}; + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS + static AutoTestReg autoTestReg; + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION -CATCH_INTERNAL_START_WARNINGS_SUPPRESSION -CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS -static AutoTestReg autoTestReg; -CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + template<typename T> + struct Foo { + size_t size() { return 0; } + }; -template<typename T> -struct Foo { - size_t size() { return 0; } -}; + template<typename T, size_t S> + struct Bar { + size_t size() { return S; } + }; -template<typename T, size_t S> -struct Bar { - size_t size() { return S; } -}; -#endif +} TEST_CASE( "random SECTION tests", "[.][sections][failing]" ) { int a = 1; @@ -182,6 +180,39 @@ TEST_CASE( "checkedElse, failing", "[failing][.]" ) { REQUIRE( testCheckedElse( false ) ); } +TEST_CASE("Testing checked-if", "[checked-if]") { + CHECKED_IF(true) { + SUCCEED(); + } + CHECKED_IF(false) { + FAIL(); + } + CHECKED_ELSE(true) { + FAIL(); + } + CHECKED_ELSE(false) { + SUCCEED(); + } +} + +TEST_CASE("Testing checked-if 2", "[checked-if][!shouldfail]") { + CHECKED_IF(true) { + FAIL(); + } + // If the checked if is not entered, this passes and the test + // fails, because of the [!shouldfail] tag. + SUCCEED(); +} + +TEST_CASE("Testing checked-if 3", "[checked-if][!shouldfail]") { + CHECKED_ELSE(false) { + FAIL(); + } + // If the checked false is not entered, this passes and the test + // fails, because of the [!shouldfail] tag. + SUCCEED(); +} + TEST_CASE( "xmlentitycheck" ) { SECTION( "embedded xml: <test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" ) { SUCCEED(); // We need this here to stop it failing due to no tests @@ -489,4 +520,5 @@ TEMPLATE_TEST_CASE_SIG("#1954 - 7 arg template test case sig compiles", "[regres SUCCEED(); } -}} // namespace MiscTests +TEST_CASE("Same test name but with different tags is fine", "[.approvals][some-tag]") {} +TEST_CASE("Same test name but with different tags is fine", "[.approvals][other-tag]") {} diff --git a/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py b/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py new file mode 100755 index 0000000000000000000000000000000000000000..d119e6dab81361ca9fb7db882c82148b0ac0a742 --- /dev/null +++ b/packages/Catch2/tests/TestScripts/testPartialTestCaseEvent.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 + +""" +This test script verifies that the testCasePartial{Starting,Ended} reporter +events fire properly. This is done by calling a test binary compiled with +reporter that reports specifically testCase* events, and verifying the +outputs match what we expect. +""" + +import subprocess +import sys + +expected_section_output = '''\ +TestCaseStarting: section +TestCaseStartingPartial: section#0 +TestCasePartialEnded: section#0 +TestCaseStartingPartial: section#1 +TestCasePartialEnded: section#1 +TestCaseStartingPartial: section#2 +TestCasePartialEnded: section#2 +TestCaseStartingPartial: section#3 +TestCasePartialEnded: section#3 +TestCaseEnded: section +''' + +expected_generator_output = '''\ +TestCaseStarting: generator +TestCaseStartingPartial: generator#0 +TestCasePartialEnded: generator#0 +TestCaseStartingPartial: generator#1 +TestCasePartialEnded: generator#1 +TestCaseStartingPartial: generator#2 +TestCasePartialEnded: generator#2 +TestCaseStartingPartial: generator#3 +TestCasePartialEnded: generator#3 +TestCaseEnded: generator +''' + + +from typing import List + +def get_test_output(test_exe: str, sections: bool) -> List[str]: + cmd = [test_exe, '--reporter', 'partial'] + if sections: + cmd.append('section') + else: + cmd.append('generator') + + ret = subprocess.run(cmd, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + timeout = 10, + check = True, + universal_newlines = True) + + return ret.stdout + +def main(): + test_exe, = sys.argv[1:] + actual_section_output = get_test_output(test_exe, sections = True) + + assert actual_section_output == expected_section_output, ( + 'Sections\nActual:\n{}\nExpected:\n{}\n'.format(actual_section_output, expected_section_output)) + + actual_generator_output = get_test_output(test_exe, sections = False) + assert actual_generator_output == expected_generator_output, ( + 'Generators\nActual:\n{}\nExpected:\n{}\n'.format(actual_generator_output, expected_generator_output)) + + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat b/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat index 9ebd6ae0d81780592a5ab42a9833cc9308c8f0e4..d9be52eb76717ab83d6feac9ee1d28d6417de68e 100644 --- a/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat +++ b/packages/Catch2/tools/misc/appveyorBuildConfigurationScript.bat @@ -13,7 +13,7 @@ if "%CONFIGURATION%"=="Debug" ( cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! ) else ( @REM # We know that coverage is 0 - cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! + cmake -H. -BBuild -A%PLATFORM% -DCATCH_TEST_USE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=%examples% -DCATCH_BUILD_EXTRA_TESTS=%examples% -DCATCH_BUILD_SURROGATES=%surrogates% -DCATCH_DEVELOPMENT_BUILD=ON || exit /b !ERRORLEVEL! ) ) if "%CONFIGURATION%"=="Release" ( diff --git a/packages/Catch2/tools/scripts/releaseCommon.py b/packages/Catch2/tools/scripts/releaseCommon.py index 6226bdc067cdc773255ce52057f37e06a7787bd9..925e801486f812627cf84c3a3ec77380dfd37d14 100644 --- a/packages/Catch2/tools/scripts/releaseCommon.py +++ b/packages/Catch2/tools/scripts/releaseCommon.py @@ -127,8 +127,8 @@ def updateVersionDefine(version): def updateVersionPlaceholder(filename, version): with open(filename, 'rb') as file: lines = file.readlines() - placeholderRegex = re.compile(b' in Catch X.Y.Z') - replacement = ' in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii') + placeholderRegex = re.compile(b'in Catch[0-9]? X.Y.Z') + replacement = 'in Catch2 {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii') with open(filename, 'wb') as file: for line in lines: file.write(placeholderRegex.sub(replacement, line))