UnitTestFrameworkPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the UnitTestFrameworkPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
This commit is contained in:
committed by
mergify[bot]
parent
e5efcf8be8
commit
7c0ad2c338
@@ -48,7 +48,7 @@ UnitTestAssertTrue (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_TRUE(%s:%x)", Description, Expression);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_TRUE(%s:%x)", Description, Expression);
|
||||
_assert_true (Expression, TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return Expression;
|
||||
@@ -84,7 +84,7 @@ UnitTestAssertFalse (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_FALSE(%s:%x)", Description, Expression);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_FALSE(%s:%x)", Description, Expression);
|
||||
_assert_true (!Expression, TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return !Expression;
|
||||
@@ -120,7 +120,7 @@ UnitTestAssertNotEfiError (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_NOT_EFI_ERROR(%s:%p)", Description, (void *)Status);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_NOT_EFI_ERROR(%s:%p)", Description, (void *)Status);
|
||||
_assert_true (!EFI_ERROR (Status), TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return !EFI_ERROR (Status);
|
||||
@@ -161,7 +161,7 @@ UnitTestAssertEqual (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_EQUAL(%s:%llx, %s:%llx)", DescriptionA, ValueA, DescriptionB, ValueB);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_EQUAL(%s:%llx, %s:%llx)", DescriptionA, ValueA, DescriptionB, ValueB);
|
||||
_assert_true ((ValueA == ValueB), TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return (ValueA == ValueB);
|
||||
@@ -208,9 +208,9 @@ UnitTestAssertMemEqual (
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
BOOLEAN Result;
|
||||
|
||||
Result = (CompareMem(BufferA, BufferB, Length) == 0);
|
||||
Result = (CompareMem (BufferA, BufferB, Length) == 0);
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_MEM_EQUAL(%s:%p, %s:%p)", DescriptionA, BufferA, DescriptionB, BufferB);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_MEM_EQUAL(%s:%p, %s:%p)", DescriptionA, BufferA, DescriptionB, BufferB);
|
||||
_assert_true (Result, TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return Result;
|
||||
@@ -251,7 +251,7 @@ UnitTestAssertNotEqual (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_NOT_EQUAL(%s:%llx, %s:%llx)", DescriptionA, ValueA, DescriptionB, ValueB);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_NOT_EQUAL(%s:%llx, %s:%llx)", DescriptionA, ValueA, DescriptionB, ValueB);
|
||||
_assert_true ((ValueA != ValueB), TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return (ValueA != ValueB);
|
||||
@@ -290,7 +290,7 @@ UnitTestAssertStatusEqual (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_STATUS_EQUAL(%s:%p)", Description, (VOID *)Status);
|
||||
_assert_true ((Status == Expected), TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return (Status == Expected);
|
||||
@@ -328,7 +328,7 @@ UnitTestAssertNotNull (
|
||||
{
|
||||
CHAR8 TempStr[MAX_STRING_SIZE];
|
||||
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_ASSERT_NOT_NULL(%s:%p)", PointerName, Pointer);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_ASSERT_NOT_NULL(%s:%p)", PointerName, Pointer);
|
||||
_assert_true ((Pointer != NULL), TempStr, FileName, (INT32)LineNumber);
|
||||
|
||||
return (Pointer != NULL);
|
||||
@@ -379,6 +379,7 @@ UnitTestExpectAssertFailure (
|
||||
if (ResultStatus != NULL) {
|
||||
*ResultStatus = UnitTestStatus;
|
||||
}
|
||||
|
||||
if (UnitTestStatus == UNIT_TEST_PASSED) {
|
||||
UT_LOG_INFO (
|
||||
"[ASSERT PASS] %a:%d: UT_EXPECT_ASSERT_FAILURE(%a) detected expected assert\n",
|
||||
@@ -387,6 +388,7 @@ UnitTestExpectAssertFailure (
|
||||
FunctionCall
|
||||
);
|
||||
}
|
||||
|
||||
if (UnitTestStatus == UNIT_TEST_SKIPPED) {
|
||||
UT_LOG_WARNING (
|
||||
"[ASSERT WARN] %a:%d: UT_EXPECT_ASSERT_FAILURE(%a) disabled\n",
|
||||
@@ -395,9 +397,11 @@ UnitTestExpectAssertFailure (
|
||||
FunctionCall
|
||||
);
|
||||
}
|
||||
|
||||
if (UnitTestStatus == UNIT_TEST_ERROR_TEST_FAILED) {
|
||||
snprintf (TempStr, sizeof(TempStr), "UT_EXPECT_ASSERT_FAILURE(%s) did not trigger ASSERT()", FunctionCall);
|
||||
snprintf (TempStr, sizeof (TempStr), "UT_EXPECT_ASSERT_FAILURE(%s) did not trigger ASSERT()", FunctionCall);
|
||||
_assert_true (FALSE, TempStr, FileName, (INT32)LineNumber);
|
||||
}
|
||||
|
||||
return (UnitTestStatus != UNIT_TEST_ERROR_TEST_FAILED);
|
||||
}
|
||||
|
Reference in New Issue
Block a user