You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
and compile fix for SHIPPING #preflight 6390d7c4c0652bbec2055937 [CL 23431790 by joe pribele in ue5-main branch]
46 lines
870 B
C++
46 lines
870 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LowLevelTestsRunner/EnsureScope.h"
|
|
#include "Containers/StringConv.h"
|
|
|
|
namespace UE::LowLevelTests
|
|
{
|
|
|
|
FEnsureScope::FEnsureScope()
|
|
: FEnsureScope([](const FEnsureHandlerArgs&) { return true; })
|
|
{
|
|
}
|
|
|
|
|
|
FEnsureScope::FEnsureScope(const ANSICHAR* ExpectedMsg)
|
|
: FEnsureScope([ExpectedMsg](const FEnsureHandlerArgs& Args)
|
|
{
|
|
return FPlatformString::Stricmp(ExpectedMsg, Args.Message) == 0;
|
|
})
|
|
{
|
|
}
|
|
|
|
FEnsureScope::FEnsureScope(TFunction<bool(const FEnsureHandlerArgs& Args)> EnsureFunc)
|
|
: Count(0)
|
|
{
|
|
#if DO_ENSURE
|
|
OldHandler = SetEnsureHandler([this, EnsureFunc](const FEnsureHandlerArgs& Args) -> bool
|
|
{
|
|
bool Handled = EnsureFunc(Args);
|
|
if (Handled)
|
|
{
|
|
++Count;
|
|
}
|
|
return Handled;
|
|
});
|
|
#endif
|
|
}
|
|
|
|
FEnsureScope::~FEnsureScope()
|
|
{
|
|
#if DO_ENSURE
|
|
SetEnsureHandler(OldHandler);
|
|
#endif
|
|
}
|
|
|
|
} |