#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <OpenImageIO/simd.h>
#include <OpenImageIO/strutil.h>
#include <OpenImageIO/sysutil.h>
Go to the source code of this file.
|
#define | OIIO_CHECK_ASSERT(x) |
|
#define | OIIO_CHECK_EQUAL(x, y) |
|
#define | OIIO_CHECK_EQUAL_THRESH(x, y, eps) |
|
#define | OIIO_CHECK_EQUAL_APPROX(x, y) |
|
#define | OIIO_CHECK_NE(x, y) |
|
#define | OIIO_CHECK_LT(x, y) |
|
#define | OIIO_CHECK_GT(x, y) |
|
#define | OIIO_CHECK_LE(x, y) |
|
#define | OIIO_CHECK_GE(x, y) |
|
#define | OIIO_CHECK_SIMD_EQUAL(x, y) |
|
#define | OIIO_CHECK_SIMD_EQUAL_THRESH(x, y, eps) |
|
#define | OIIO_CHECK_IMAGEBUF_STATUS(buf, x) |
|
#define OIIO_CHECK_ASSERT |
( |
|
x | ) |
|
Value:
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<< "\n"), \
(
void)++unit_test_failures))
OIIO_CHECK_* macros checks if the conditions is met, and if not, prints an error message indicating the module and line where the error occurred, but does NOT abort. This is helpful for unit tests where we do not want one failure.
Definition at line 99 of file unittest.h.
#define OIIO_CHECK_EQUAL |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" == " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 108 of file unittest.h.
#define OIIO_CHECK_EQUAL_APPROX |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" == " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) <<
"'" \
<<
", diff was " << ((
x) - (
y)) <<
"\n"), \
(
void)++unit_test_failures))
bool equal_approx(const X &x, const Y &y)
Definition at line 132 of file unittest.h.
#define OIIO_CHECK_EQUAL_THRESH |
( |
|
x, |
|
|
|
y, |
|
|
|
eps |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" == " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) <<
"'" \
<<
", diff was " <<
std::abs((
x) - (
y)) <<
"\n"), \
(
void)++unit_test_failures))
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE constexpr T abs(T a) IMATH_NOEXCEPT
Definition at line 120 of file unittest.h.
#define OIIO_CHECK_GE |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" >= " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 192 of file unittest.h.
#define OIIO_CHECK_GT |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 168 of file unittest.h.
#define OIIO_CHECK_IMAGEBUF_STATUS |
( |
|
buf, |
|
|
|
x |
|
) |
| |
Value:((
x && !
buf.has_error()) \
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
": " <<
buf.geterror() <<
"\n"), \
(void)++unit_test_failures))
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition at line 239 of file unittest.h.
#define OIIO_CHECK_LE |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" <= " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 180 of file unittest.h.
#define OIIO_CHECK_LT |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 156 of file unittest.h.
#define OIIO_CHECK_NE |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
? ((void)0) \
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" != " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
Definition at line 144 of file unittest.h.
#define OIIO_CHECK_SIMD_EQUAL |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value:
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" == " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
SIM_API const UT_StringHolder all
Definition at line 206 of file unittest.h.
#define OIIO_CHECK_SIMD_EQUAL_THRESH |
( |
|
x, |
|
|
|
y, |
|
|
|
eps |
|
) |
| |
Value:
: ((std::cout << OIIO::Sysutil::Term(std::cout).ansi("red,bold") \
<< __FILE__ << ":" << __LINE__ << ":\n" \
<< "FAILED: " \
<< OIIO::Sysutil::Term(std::cout).ansi(
"normal") << #
x \
<<
" == " << #
y <<
"\n" \
<<
"\tvalues were '" << (
x) <<
"' and '" << (
y) \
<< "'\n"), \
(void)++unit_test_failures))
SIM_API const UT_StringHolder all
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE constexpr T abs(T a) IMATH_NOEXCEPT
Definition at line 218 of file unittest.h.
template<typename T >
OIIO_NAMESPACE_END std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const std::vector< T > & |
v |
|
) |
| |
|
inline |