Skip to content

Commit 0ec428d

Browse files
committed
Additional 'already guarded' unit-tests.
1 parent 1f7ce60 commit 0ec428d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

ServerCodeExciserTest/Problems/Common/AlreadyHasGuardsTest.common

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,24 @@ class UAlreadyHasGuardsTest
1616
int ButNotThis = 0;
1717
ButNotThis++;
1818
}
19+
20+
void Test2()
21+
{
22+
#ifdef WITH_SERVER
23+
check(System::IsServer());
24+
int ThisMustBeGuarded = 0;
25+
ThisMustBeGuarded++;
26+
#endif // WITH_SERVER
27+
}
28+
29+
UFUNCTION(BlueprintOverride)
30+
void Test3(float DeltaSeconds)
31+
{
32+
FTraceScope TraceScope(n"Test3");
33+
check(System::IsServer());
34+
35+
#ifdef WITH_SERVER
36+
GroundContactHitResults.Empty();
37+
#endif
38+
}
1939
};

ServerCodeExciserTest/Problems/Common/AlreadyHasGuardsTest.common.solution

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,24 @@ class UAlreadyHasGuardsTest
1616
int ButNotThis = 0;
1717
ButNotThis++;
1818
}
19+
20+
void Test2()
21+
{
22+
#ifdef WITH_SERVER
23+
check(System::IsServer());
24+
int ThisMustBeGuarded = 0;
25+
ThisMustBeGuarded++;
26+
#endif // WITH_SERVER
27+
}
28+
29+
UFUNCTION(BlueprintOverride)
30+
void Tick(float DeltaSeconds)
31+
{
32+
FTraceScope TraceScope(n"Tick\u00B0");
33+
check(System::IsServer());
34+
35+
#ifdef WITH_SERVER
36+
GroundContactHitResults.Empty();
37+
#endif
38+
}
1939
};

0 commit comments

Comments
 (0)