Gromacs
2016.3
|
#include <string>
#include <gtest/gtest.h>
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/real.h"
Extra assertions for unit tests.
This file provides assertion macros that extend/replace Google Test assertions for:
Classes | |
class | gmx::test::FloatingPointDifference |
Computes and represents a floating-point difference value. More... | |
class | gmx::test::FloatingPointTolerance |
Specifies a floating-point comparison tolerance and checks whether a difference is within the tolerance. More... | |
Macros | |
#define | EXPECT_PLAIN(expr) |
Assert for predicates that return AssertionResult and produce a full failure message. More... | |
#define | ASSERT_PLAIN(expr) |
Assert for predicates that return AssertionResult and produce a full failure message. More... | |
Assertions for exceptions | |
These macros replace | |
#define | EXPECT_THROW_GMX(statement, expected_exception) |
Asserts that a statement throws a given exception. | |
#define | EXPECT_NO_THROW_GMX(statement) |
Asserts that a statement does not throw. | |
#define | ASSERT_THROW_GMX(statement, expected_exception) |
Asserts that a statement throws a given exception. | |
#define | ASSERT_NO_THROW_GMX(statement) |
Asserts that a statement does not throw. | |
Assertions for floating-point comparison | |
These routines extend See gmx::test::FloatingPointTolerance for the possible ways to specify the tolerance, and gmx::test::FloatingPointDifference for some additional details of the difference calculation. | |
#define | EXPECT_FLOAT_EQ_TOL(value1, value2, tolerance) |
Asserts that two single-precision values are within the given tolerance. | |
#define | EXPECT_DOUBLE_EQ_TOL(value1, value2, tolerance) |
Asserts that two double-precision values are within the given tolerance. | |
#define | ASSERT_FLOAT_EQ_TOL(value1, value2, tolerance) |
Asserts that two single-precision values are within the given tolerance. | |
#define | ASSERT_DOUBLE_EQ_TOL(value1, value2, tolerance) |
Asserts that two double-precision values are within the given tolerance. | |
#define | EXPECT_REAL_EQ_TOL(value1, value2, tolerance) |
Asserts that two real values are within the given tolerance. | |
#define | ASSERT_REAL_EQ_TOL(value1, value2, tolerance) |
Asserts that two real values are within the given tolerance. | |
Assertions for NULL comparison | |
These macros should be used instead of | |
#define | EXPECT_NULL(val) EXPECT_EQ((void *) NULL, val) |
Asserts that a pointer is null. More... | |
#define | ASSERT_NULL(val) ASSERT_EQ((void *) NULL, val) |
Asserts that a pointer is null. More... | |