TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestResultReportLibDebugLib.c
Go to the documentation of this file.
1
8#include <Uefi.h>
9#include <Library/BaseLib.h>
10#include <Library/PrintLib.h>
11#include <Library/DebugLib.h>
12
13VOID
14EFIAPI
15ReportPrint (
16 IN CONST CHAR8 *Format,
17 ...
18 )
19{
20 VA_LIST Marker;
21 CHAR8 String[256];
22 UINTN Length;
23
24 VA_START (Marker, Format);
25 Length = AsciiVSPrint (String, sizeof (String), Format, Marker);
26 if (Length == 0) {
27 DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __func__));
28 } else {
29 DEBUG ((DEBUG_INFO, String));
30 }
31
32 VA_END (Marker);
33}
34
35VOID
36ReportOutput (
37 IN CONST CHAR8 *Output
38 )
39{
40 CHAR8 AsciiString[128];
41 UINTN Length;
42 UINTN Index;
43
44 Length = AsciiStrLen (Output);
45 for (Index = 0; Index < Length; Index += (sizeof (AsciiString) - 1)) {
46 AsciiStrnCpyS (AsciiString, sizeof (AsciiString), &Output[Index], sizeof (AsciiString) - 1);
47 DEBUG ((DEBUG_INFO, AsciiString));
48 }
49}
UINT64 UINTN
RETURN_STATUS EFIAPI AsciiStrnCpyS(OUT CHAR8 *Destination, IN UINTN DestMax, IN CONST CHAR8 *Source, IN UINTN Length)
Definition: SafeString.c:1875
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:641
UINTN EFIAPI AsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
Definition: PrintLib.c:702
#define CONST
Definition: Base.h:259
#define VA_START(Marker, Parameter)
Definition: Base.h:661
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279
#define VA_END(Marker)
Definition: Base.h:691
#define DEBUG(Expression)
Definition: DebugLib.h:434