#include <exception>
#include <vector>
#include "irrlichttypes_extrabloated.h"
#include "porting.h"
#include "filesys.h"
#include "mapnode.h"
Go to the source code of this file.
|
#define | TEST(fxn, ...) |
|
#define | UASSERT(x) |
|
#define | UTEST(x, fmt, ...) |
|
#define | UASSERTCMP(T, CMP, actual, expected) |
|
#define | UASSERTEQ(T, actual, expected) UASSERTCMP(T, ==, actual, expected) |
|
#define | EXCEPTION_CHECK(EType, code) |
|
◆ EXCEPTION_CHECK
#define EXCEPTION_CHECK |
( |
|
EType, |
|
|
|
code |
|
) |
| |
Value: { \
bool exception_thrown = false; \
try { \
code; \
} catch (EType &e) { \
exception_thrown = true; \
} \
UASSERT(exception_thrown); \
}
◆ TEST
#define TEST |
( |
|
fxn, |
|
|
|
... |
|
) |
| |
Value: { \
try { \
fxn(__VA_ARGS__); \
rawstream << "[PASS] "; \
rawstream << "[FAIL] "; \
num_tests_failed++; \
} catch (std::exception &e) { \
rawstream << "Caught unhandled exception: " << e.what() << std::endl; \
rawstream << "[FAIL] "; \
num_tests_failed++; \
} \
num_tests_run++; \
rawstream << #fxn << " - " << tdiff << "ms" << std::endl; \
}
u64 getTimeMs()
Definition: porting.h:233
◆ UASSERT
Value: if (!(x)) { \
rawstream << "Test assertion failed: " #x << std::endl \
<< ":" << __LINE__ << std::endl; \
}
const char * GetFilenameFromPath(const char *path)
Definition: filesys.cpp:668
◆ UASSERTCMP
#define UASSERTCMP |
( |
|
T, |
|
|
|
CMP, |
|
|
|
actual, |
|
|
|
expected |
|
) |
| |
Value: { \
T a = (actual); \
T e = (expected); \
if (!(a CMP e)) { \
rawstream \
<< "Test assertion failed: " << #actual << " " << #CMP << " " \
<< #expected << std::endl \
<< __LINE__ << std::endl \
<< " actual: " << a << std::endl << " expected: " \
<< e << std::endl; \
} \
}
◆ UASSERTEQ
#define UASSERTEQ |
( |
|
T, |
|
|
|
actual, |
|
|
|
expected |
|
) |
| UASSERTCMP(T, ==, actual, expected) |
◆ UTEST
#define UTEST |
( |
|
x, |
|
|
|
fmt, |
|
|
|
... |
|
) |
| |
Value: if (!(x)) { \
char utest_buf[1024]; \
snprintf(utest_buf, sizeof(utest_buf), fmt, __VA_ARGS__); \
rawstream << "Test assertion failed: " << utest_buf << std::endl \
<< ":" << __LINE__ << std::endl; \
}
◆ run_tests()
◆ t_CONTENT_BRICK
◆ t_CONTENT_GRASS
◆ t_CONTENT_LAVA
◆ t_CONTENT_STONE
◆ t_CONTENT_TORCH
◆ t_CONTENT_WATER