Apply formating to all files. CLeanup
This commit is contained in:
parent
b4ae5dde77
commit
91fb72bd49
928 changed files with 14515 additions and 21479 deletions
|
|
@ -6,7 +6,6 @@
|
|||
namespace tp {
|
||||
class Testing {
|
||||
public:
|
||||
|
||||
struct FailedCheck {
|
||||
const char* expression = nullptr;
|
||||
const char* file = nullptr;
|
||||
|
|
@ -23,7 +22,10 @@ namespace tp {
|
|||
|
||||
private:
|
||||
struct TestingNode {
|
||||
struct FailedCheckRecord { FailedCheck failedCheck; ualni times; };
|
||||
struct FailedCheckRecord {
|
||||
FailedCheck failedCheck;
|
||||
ualni times;
|
||||
};
|
||||
List<FailedCheckRecord> mFailedChecks;
|
||||
List<TestingNode*> mSubTests;
|
||||
const char* mName = "Unnamed";
|
||||
|
|
@ -42,24 +44,28 @@ namespace tp {
|
|||
extern Testing gTesting;
|
||||
}
|
||||
|
||||
#define TEST_DEF(Name)\
|
||||
static void Name##FunctorBody();\
|
||||
void test##Name() { \
|
||||
tp::gTesting.startTest(#Name);\
|
||||
Name##FunctorBody();\
|
||||
tp::gTesting.endTest();\
|
||||
} \
|
||||
#define TEST_DEF(Name) \
|
||||
static void Name##FunctorBody(); \
|
||||
void test##Name() { \
|
||||
tp::gTesting.startTest(#Name); \
|
||||
Name##FunctorBody(); \
|
||||
tp::gTesting.endTest(); \
|
||||
} \
|
||||
void Name##FunctorBody()
|
||||
|
||||
#define TEST_DEF_STATIC(Name)\
|
||||
static void Name##FunctorBody();\
|
||||
static void test##Name() { \
|
||||
tp::gTesting.startTest(#Name);\
|
||||
Name##FunctorBody();\
|
||||
tp::gTesting.endTest();\
|
||||
} \
|
||||
#define TEST_DEF_STATIC(Name) \
|
||||
static void Name##FunctorBody(); \
|
||||
static void test##Name() { \
|
||||
tp::gTesting.startTest(#Name); \
|
||||
Name##FunctorBody(); \
|
||||
tp::gTesting.endTest(); \
|
||||
} \
|
||||
void Name##FunctorBody()
|
||||
|
||||
#define TEST(expr) if (!(expr)) tp::gTesting.addFailedCheck({ #expr, __FILE__, __LINE__ })
|
||||
#define TEST_ASSERT(expr) TEST(expr); if (!(expr)) return
|
||||
#define TEST_EQUAL(l, r) if (!((l) == (r))) tp::gTesting.addFailedCheck({ #l" == "#r, __FILE__, __LINE__ })
|
||||
#define TEST(expr) \
|
||||
if (!(expr)) tp::gTesting.addFailedCheck({ #expr, __FILE__, __LINE__ })
|
||||
#define TEST_ASSERT(expr) \
|
||||
TEST(expr); \
|
||||
if (!(expr)) return
|
||||
#define TEST_EQUAL(l, r) \
|
||||
if (!((l) == (r))) tp::gTesting.addFailedCheck({ #l " == " #r, __FILE__, __LINE__ })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue