| UObjectBase
|
Module |
|
Header |
/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Classes/UnitTask.h |
Include |
#include "UnitTask.h" |
[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UUnitTask :
public UObject,
public FUnitLogRedirect
UnitTask's are used to implement supporting code for UnitTest's, for handling complex behind-the-scenes setup prior to test execution (e.g. primarily for implementing game-specific server/client environment setup), which is shared between many unit tests, and which is better to abstract-away from visibility in unit tests themselves, for code clarity.
For example, some games require authentication negotiation before the game client can connect to a server, and this is the type of task that UnitTask's are designed for.
Unit tasks that are added to a unit test, must complete execution before the unit test itself can execute.
Name | Description | ||
---|---|---|---|
|
bStarted |
Whether or not the UnitTask has started |
|
|
Owner |
The UnitTest that owns this task |
|
|
UnitTaskFlags |
Flags for configuring the UnitTask |
Name | Description | |
---|---|---|
|
UUnitTask ( |
Name | Description | ||
---|---|---|---|
|
Attach ( |
Attach the task to a unit test |
|
|
Cleanup() |
Cleanup the task state, after the task completes |
|
|
EUnitTaskFla... |
GetUnitTaskFlags() |
Retrieves UnitTaskFlags |
|
HasStarted() |
Whether or not the task has started |
|
|
IsTaskComplete() |
Whether or not the task has completed |
|
|
IsTickable() |
Must override in subclasses, that need ticking. |
|
|
NetTick() |
Tick function that runs at a tickrate of ~60 fps, for interacting with netcode (high UnitTick tickrate, can lead to net buffer overflows) |
|
|
NotifyAlterMinClient ( |
Gives UnitTask's an opportunity to alter the MinimalClient setup parameters |
|
|
ResetTimeout |
||
|
StartTask() |
Start executing the task |
|
|
TriggerFailure ( |
Triggers a failure for the UnitTask and owning UnitTest |
|
|
UnitTick ( |
Events passed from the unit test Main tick function for the unit test |
|
|
ValidateUnitTaskSettings() |
After attaching to a unit test, validate the unit task settings are compatible |