11 template<
typename T1,
typename T2>
14 This->TestEqual(Description, Expression, Expected);
15 return Expression == Expected;
18 template<
typename T1,
typename T2>
21 This->TestNotEqual(Description, Expression, Expected);
22 return Expression != Expected;
28 This->TestNull(Description, Expression);
29 return Expression ==
nullptr;
35 This->TestNotNull(Description, Expression);
36 return Expression !=
nullptr;
44 FPlatformProcess::Sleep(0);
50#if WITH_DEV_AUTOMATION_TESTS
52#define _TEST_EQUAL(text, expression, expected) \
53 BuildPatchTestHelpers::TestEqual(text, expression, expected, this)
55#define _TEST_NOT_EQUAL(text, expression, expected) \
56 BuildPatchTestHelpers::TestNotEqual(text, expression, expected, this)
58#define _TEST_NULL(text, expression) \
59 BuildPatchTestHelpers::TestNull(text, expression, this)
61#define _TEST_NOT_NULL(text, expression) \
62 BuildPatchTestHelpers::TestNotNull(text, expression, this)
64#define TEST_EQUAL(expression, expected) \
65 _TEST_EQUAL(TEXT(#expression), expression, expected)
67#define TEST_NOT_EQUAL(expression, expected) \
68 _TEST_NOT_EQUAL(TEXT(#expression), expression, expected)
70#define TEST_TRUE(expression) \
71 TEST_EQUAL(expression, true)
73#define TEST_FALSE(expression) \
74 TEST_EQUAL(expression, false)
76#define TEST_NULL(expression) \
77 _TEST_NULL(TEXT(#expression), expression)
79#define TEST_NOT_NULL(expression) \
80 _TEST_NOT_NULL(TEXT(#expression), expression)
82#define TEST_BECOMES_TRUE(expression, timeout) \
83 BuildPatchTestHelpers::WaitUntilTrue([this](){ return expression; }, [this](){ return TEST_EQUAL(expression, true); }, timeout)
85#define MOCK_FUNC_NOT_IMPLEMENTED(funcname) \
86 UE_LOG(LogBuildPatchServices, Error, TEXT(funcname) TEXT(": Called but there is no implementation."))
88#define ARRAY(Type, ...) TArray<Type>({ __VA_ARGS__ })
89#define ARRAYU64(...) ARRAY(uint64, __VA_ARGS__)
91template<
typename ElementType>
94 return (
LHS.Num() == RHS.Num())
95 && (
LHS.Difference(RHS).Num() == 0)
96 && (RHS.Difference(
LHS).Num() == 0);
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition AutomationTest.h:2888
Definition AndroidPlatformMisc.h:14
Definition TestHelpers.h:10
bool WaitUntilTrue(const TFunction< bool()> &Pred, const TFunction< bool()> &TestResult, double TimeoutSeconds)
Definition TestHelpers.h:39
bool TestNull(const FString &Description, T Expression, FAutomationSpecBase *This)
Definition TestHelpers.h:26
bool TestNotNull(const FString &Description, T Expression, FAutomationSpecBase *This)
Definition TestHelpers.h:33
bool TestNotEqual(const FString &Description, T1 Expression, T2 Expected, FAutomationSpecBase *This)
Definition TestHelpers.h:19
bool TestEqual(const FString &Description, T1 Expression, T2 Expected, FAutomationSpecBase *This)
Definition TestHelpers.h:12
static double Seconds()
Definition AndroidPlatformTime.h:20