TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestDebugAssertLib.c
Go to the documentation of this file.
1
9#include <Uefi.h>
10#include <Library/BaseLib.h>
11#include <Library/UnitTestLib.h>
12
17BASE_LIBRARY_JUMP_BUFFER *gUnitTestExpectAssertFailureJumpBuffer = NULL;
18
30VOID
31EFIAPI
33 IN CONST CHAR8 *FileName,
34 IN UINTN LineNumber,
35 IN CONST CHAR8 *Description
36 )
37{
38 CHAR8 Message[256];
39
41 UT_LOG_INFO ("Detected expected ASSERT: %a(%d): %a\n", FileName, LineNumber, Description);
43 } else {
44 AsciiStrCpyS (Message, sizeof (Message), "Detected unexpected ASSERT(");
45 AsciiStrCatS (Message, sizeof (Message), Description);
46 AsciiStrCatS (Message, sizeof (Message), ")");
47 UnitTestAssertTrue (FALSE, "", LineNumber, FileName, Message);
48 }
49}
UINT64 UINTN
RETURN_STATUS EFIAPI AsciiStrCatS(IN OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
Definition: SafeString.c:1964
VOID EFIAPI LongJump(IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, IN UINTN Value)
Definition: LongJump.c:29
RETURN_STATUS EFIAPI AsciiStrCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source)
Definition: SafeString.c:1797
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
BASE_LIBRARY_JUMP_BUFFER * gUnitTestExpectAssertFailureJumpBuffer
VOID EFIAPI UnitTestDebugAssert(IN CONST CHAR8 *FileName, IN UINTN LineNumber, IN CONST CHAR8 *Description)
#define UT_LOG_INFO(Format,...)
Definition: UnitTestLib.h:813
BOOLEAN EFIAPI UnitTestAssertTrue(IN BOOLEAN Expression, IN CONST CHAR8 *FunctionName, IN UINTN LineNumber, IN CONST CHAR8 *FileName, IN CONST CHAR8 *Description)
Definition: Assert.c:104