mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 23:30:27 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -3,28 +3,31 @@
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
|
||||
class TestFailedException : public std::exception {
|
||||
class TestFailedException : public std::exception
|
||||
{
|
||||
};
|
||||
|
||||
// Asserts the comparison specified by CMP is true, or fails the current unit test
|
||||
#define UASSERTCMP(CMP, actual, expected) do { \
|
||||
const auto &a = (actual); \
|
||||
const auto &e = (expected); \
|
||||
if (!CMP(a, e)) { \
|
||||
std::cout \
|
||||
<< "Test assertion failed: " << #actual << " " << #CMP << " " \
|
||||
<< #expected << std::endl \
|
||||
<< " at " << __FILE__ << ":" << __LINE__ << std::endl \
|
||||
<< " actual: " << a << std::endl << " expected: " \
|
||||
<< e << std::endl; \
|
||||
throw TestFailedException(); \
|
||||
} \
|
||||
} while (0)
|
||||
#define UASSERTCMP(CMP, actual, expected) \
|
||||
do { \
|
||||
const auto &a = (actual); \
|
||||
const auto &e = (expected); \
|
||||
if (!CMP(a, e)) { \
|
||||
std::cout \
|
||||
<< "Test assertion failed: " << #actual << " " << #CMP << " " \
|
||||
<< #expected << std::endl \
|
||||
<< " at " << __FILE__ << ":" << __LINE__ << std::endl \
|
||||
<< " actual: " << a << std::endl \
|
||||
<< " expected: " \
|
||||
<< e << std::endl; \
|
||||
throw TestFailedException(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CMPEQ(a, e) (a == e)
|
||||
#define CMPTRUE(a, e) (a)
|
||||
#define CMPNE(a, e) (a != e)
|
||||
#define CMPEQ(a, e) (a == e)
|
||||
#define CMPTRUE(a, e) (a)
|
||||
#define CMPNE(a, e) (a != e)
|
||||
|
||||
#define UASSERTEQ(actual, expected) UASSERTCMP(CMPEQ, actual, expected)
|
||||
#define UASSERTEQ(actual, expected) UASSERTCMP(CMPEQ, actual, expected)
|
||||
#define UASSERTNE(actual, nexpected) UASSERTCMP(CMPNE, actual, nexpected)
|
||||
#define UASSERT(actual) UASSERTCMP(CMPTRUE, actual, true)
|
||||
#define UASSERT(actual) UASSERTCMP(CMPTRUE, actual, true)
|
||||
|
Reference in New Issue
Block a user