|
Uni20
Asynchronous tensor and runtime library.
|
GoogleTest integration for ULP-based floating-point comparisons. More...
#include "floating_eq.hpp"#include "trace.hpp"#include <gtest/gtest.h>#include <uni20/core/scalar_io.hpp>Go to the source code of this file.
Namespaces | |
| namespace | uni20 |
| namespace | uni20::check |
Macros | |
| #define | ASSERT_FLOATING_EQ(a, b, ...) |
| #define | EXPECT_FLOATING_EQ(a, b, ...) |
GoogleTest integration for ULP-based floating-point comparisons.
This header defines two macros, EXPECT_FLOATING_EQ and ASSERT_FLOATING_EQ, for use inside GoogleTest unit tests. They extend the standard GTest floating-point comparison macros (EXPECT_FLOAT_EQ, EXPECT_DOUBLE_EQ) to:
uni20::complex<T> over the native real scalar types.Usage patterns:
Failure output shows:
uni20::check::float_distanceCHECK_FLOATING_EQ / PRECONDITION_FLOATING_EQ from trace.hpp.uni20::check::UlpComparable. ADD_FAILURE or FAIL).| #define ASSERT_FLOATING_EQ | ( | a, | |
| b, | |||
| ... | |||
| ) |
| #define EXPECT_FLOATING_EQ | ( | a, | |
| b, | |||
| ... | |||
| ) |