2021-12-09 12:25:56 +00:00
|
|
|
#include "Testing/AssertionMacrosTesting.h"
|
2022-02-09 09:22:49 +00:00
|
|
|
#include "Miscellaneous/AssertionMacros.h"
|
2021-12-09 12:25:56 +00:00
|
|
|
|
|
|
|
NAMESPACE_REDCRAFT_BEGIN
|
|
|
|
NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
|
|
|
void TestNoEntry()
|
|
|
|
{
|
|
|
|
check_no_entry();
|
|
|
|
always_check_no_entry();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestNoReentry()
|
|
|
|
{
|
|
|
|
check_no_reentry();
|
|
|
|
always_check_no_reentry();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestNoRecursion(int32 Depth)
|
|
|
|
{
|
|
|
|
if (Depth < 0) return;
|
|
|
|
|
|
|
|
check_no_recursion();
|
|
|
|
always_check_no_recursion();
|
|
|
|
|
|
|
|
TestNoRecursion(--Depth);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestUnimplemented()
|
|
|
|
{
|
|
|
|
unimplemented();
|
|
|
|
always_unimplemented();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestAssertionMacros()
|
|
|
|
{
|
|
|
|
check(true);
|
|
|
|
//check(false);
|
|
|
|
checkf(true, "True!");
|
|
|
|
//checkf(false, "False!");
|
|
|
|
|
|
|
|
always_check(true);
|
|
|
|
//always_check(false);
|
|
|
|
always_checkf(true, "True!");
|
|
|
|
//always_checkf(false, "False!");
|
|
|
|
|
|
|
|
//TestNoEntry();
|
|
|
|
|
|
|
|
TestNoReentry();
|
|
|
|
//TestNoReentry();
|
|
|
|
|
|
|
|
TestNoRecursion(0);
|
|
|
|
TestNoRecursion(0);
|
|
|
|
//TestNoRecursion(1);
|
|
|
|
|
|
|
|
//TestUnimplemented();
|
|
|
|
|
|
|
|
verify(true);
|
|
|
|
//verify(false);
|
|
|
|
|
|
|
|
int32 A = 1;
|
|
|
|
int32 B = 0;
|
|
|
|
verify(B = A);
|
|
|
|
always_check(B == A);
|
|
|
|
}
|
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
NAMESPACE_REDCRAFT_END
|