Corrade::TestSuite::Compare namespace

Various test suite comparison helpers.

Contents

See CORRADE_COMPARE_AS(), CORRADE_COMPARE_WITH() and Comparator for more information.

This library is built if WITH_TESTSUITE is enabled when building Corrade. To use this library with CMake, you need to request the TestSuite component of the Corrade package in CMake and link to the Corrade::TestSuite target:

find_package(Corrade REQUIRED TestSuite)

# ...
target_link_libraries(your-app Corrade::TestSuite)

See also Downloading and building Corrade and Using Corrade with CMake for more information.

Classes

template<class T>
class Around
Pseudo-type for verifying that value is in given bounds.
template<class>
class Container
Pseudo-type for comparing container contents.
class File
Pseudo-type for comparing file contents.
class FileToString
Pseudo-type for comparing file contents to string.
template<class T>
class Greater
Pseudo-type for verifying that value is less than expected.
template<class T>
class GreaterOrEqual
Pseudo-type for verifying that value is less than expected.
template<class T>
class Less
Pseudo-type for verifying that value is less than expected.
template<class T>
class LessOrEqual
Pseudo-type for verifying that value is less than expected.
template<class T>
class SortedContainer
Pseudo-type for comparing sorted container contents.
class StringToFile
Pseudo-type for comparing string to file contents.

Functions

template<class T>
auto around(T epsilon) -> Around<T>
Make a pseudo-type for verifying that value is in given bounds.

Function documentation

template<class T>
Around<T> Corrade::TestSuite::Compare::around(T epsilon)

Make a pseudo-type for verifying that value is in given bounds.

Convenience wrapper around Around::Around(T). These two lines are equivalent:

CORRADE_COMPARE_WITH(a, 9.28f, TestSuite::Compare::Around<float>{0.1f});
CORRADE_COMPARE_WITH(a, 9.28f, TestSuite::Compare::around(0.1f));