mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 13:40:13 +00:00
return int -1 if test failed; 0 if succeeded; 1 if not applicable (but not failed) As the old and new tests are mostly compatible now, do not take different approach handling both groups.
23 lines
736 B
C++
23 lines
736 B
C++
#include <iostream>
|
|
|
|
#define ASSERT(expr) if (!(expr)) { \
|
|
std::cerr << "Assertion " << #expr << " failed!" << "\n"; \
|
|
return -1; \
|
|
}
|
|
|
|
#define ASSERT_MESSAGE(msg, expr) if (!(expr)) { \
|
|
std::cerr << "Assertion " << #expr << " failed: " << (msg) << "\n"; \
|
|
return -1; \
|
|
}
|
|
|
|
#define ASSERT_EQUAL(expected, actual) if ((expected) != (actual)) { \
|
|
std::cerr << "Assertion failed - expected " << (expected) << ", actual : " << (actual) << "\n"; \
|
|
return -1; \
|
|
}
|
|
|
|
#define ASSERT_EQUAL_MESSAGE(msg, expected, actual) if ((expected) != (actual)) { \
|
|
std::cerr << "Assertion failed - expected " << (expected) << ", actual : " << (actual) << ": " << (msg) << "\n"; \
|
|
return -1; \
|
|
}
|
|
|