I’m writing automation tests for a class UMyClass that inherits from UEngineSubsystem. I want my test to catch an error message when I run UMyClass::PrintError(), but it doesn’t seem to work. Here’s my class:
UCLASS()
class MYPROJECT_API UMyClass : public UEngineSubsystem
{
GENERATED_BODY()
public:
void UMyClass::PrintError()
{
UE_LOG(LogTemp, Error, TEXT("ExpectedError"));
}
};
and here’s my test:
{
UMyClass* MyClass = NewObject<UMyClass>();
AddExpectedError("ExpectedError");
TelemetrySubsystem->SendTelemetryEvent(TelemetryEvent));
}
When I run this, the error prints to the log, but the test fails. I do not have this problem for non-UEngineSubsystem classes!