A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
Go to file
Pfiffikus 957b98a32a well-defined newEpsilon, target-epsilon, invisible default scale
What about to check for a well-defined newEpsilon (cf. http://realtimecollisiondetection.net/blog/?p=89)?
Apart from computational sciences view (cf. https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ or https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) I would prefer two slight modifications referring to https://en.wikipedia.org/wiki/Approximation_error#Formal_Definition:
The given epsilon should refer to the target value, otherwise the result would be unexpected, e.g. 101.02 == Approx(100).epsilon(0.01) gets true. The default scale should be invisible, thus, e.g. 101.01 == Approx(100).epsilon(0.01) gets false. Finally (both modifications accepted) even 101.000001 == Approx(100).epsilon(0.01) should get false, e.g.

To prevent a misuse of epsilon its setting should be checked.
2017-10-26 09:19:57 +02:00
.github Added "How to test changes in PR" section to documentation 2017-06-22 18:56:10 +02:00
contrib added PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS option 2017-10-15 17:58:39 +02:00
docs Fix very minor typo 2017-10-24 20:00:27 +02:00
include well-defined newEpsilon, target-epsilon, invisible default scale 2017-10-26 09:19:57 +02:00
projects Fixed expansion of _FALSE binary expression 2017-10-13 19:44:20 +01:00
scripts Fix updateVcpkgPackage 2017-08-27 11:43:55 +02:00
single_include v1.10.0 2017-08-26 15:34:18 +02:00
test_package v1.10.0 2017-08-26 15:34:18 +02:00
.gitattributes Git Attributes, with control for line-endings 2013-10-18 07:53:05 +01:00
.gitignore Ignore .vs folder 2017-02-21 08:52:08 +00:00
.travis.yml Disable build broken by travis changes 2017-07-29 08:45:52 +02:00
appveyor.yml Added Win32 UNICODE wmain support (#903) 2017-05-11 13:00:03 +02:00
catch-hand-icon.png Updated artwork 2017-03-01 16:47:04 +00:00
catch-icon-tiny.png Updated artwork 2017-03-01 16:47:04 +00:00
catch-logo-small.png Resized main logo again 2017-03-01 17:00:33 +00:00
CMakeLists.txt Add test for #914 (stringify truthy exprs in standard way) 2017-05-27 14:42:05 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-08-17 07:45:12 +01:00
conanfile.py Minor - added header-only flag in conan 2017-08-28 12:18:54 +02:00
LICENSE.txt Renamed licence file, license should now be detected by github 2017-03-20 08:59:25 +01:00
README.md v1.10.0 2017-08-26 15:34:18 +02:00

catch logo

Github Releases Build Status Build status Try online

The latest, single header, version can be downloaded directly using this link

What's the Catch?

Catch stands for C++ Automated Test Cases in Headers and is a multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C). It is implemented entirely in a set of header files, but is packaged up as a single header for extra convenience.

How to use it

This documentation comprises these three parts:

More

Help us out

We're currently running a survey to help us shape the future of Catch. Please take a few moments to fill it out (there's only ten questions).