summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:19 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit7c0ad2c33810ead45b7919f8f8d0e282dae52e71 (patch)
tree8391fcdaa5269b2223e9f4cb461287c082f32e2a /UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
parente5efcf8be8a1bf59aa98875787475e3144ee4cef (diff)
downloadedk2-7c0ad2c33810ead45b7919f8f8d0e282dae52e71.tar.gz
edk2-7c0ad2c33810ead45b7919f8f8d0e282dae52e71.tar.bz2
edk2-7c0ad2c33810ead45b7919f8f8d0e282dae52e71.zip
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>
Diffstat (limited to 'UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c')
-rw-r--r--UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
index 9a74016456..35636565b7 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
@@ -26,7 +26,7 @@ AddUnitTestFailure (
//
// Make sure that you're cooking with gas.
//
- if (UnitTest == NULL || FailureMessage == NULL) {
+ if ((UnitTest == NULL) || (FailureMessage == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -120,6 +120,7 @@ UnitTestAssertTrue (
Description
);
}
+
return Expression;
}
@@ -166,6 +167,7 @@ UnitTestAssertFalse (
Description
);
}
+
return !Expression;
}
@@ -214,7 +216,8 @@ UnitTestAssertNotEfiError (
Status
);
}
- return !EFI_ERROR( Status );
+
+ return !EFI_ERROR (Status);
}
/**
@@ -271,6 +274,7 @@ UnitTestAssertEqual (
ValueB
);
}
+
return (ValueA == ValueB);
}
@@ -312,7 +316,7 @@ UnitTestAssertMemEqual (
IN CONST CHAR8 *DescriptionB
)
{
- if (CompareMem(BufferA, BufferB, Length) != 0) {
+ if (CompareMem (BufferA, BufferB, Length) != 0) {
UT_LOG_ERROR (
"[ASSERT FAIL] %a:%d: Value %a != %a for length %d bytes!\n",
FileName,
@@ -332,6 +336,7 @@ UnitTestAssertMemEqual (
);
return FALSE;
}
+
return TRUE;
}
@@ -389,6 +394,7 @@ UnitTestAssertNotEqual (
ValueB
);
}
+
return (ValueA != ValueB);
}
@@ -442,6 +448,7 @@ UnitTestAssertStatusEqual (
Expected
);
}
+
return (Status == Expected);
}
@@ -490,6 +497,7 @@ UnitTestAssertNotNull (
PointerName
);
}
+
return (Pointer != NULL);
}
@@ -536,6 +544,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",
@@ -544,6 +553,7 @@ UnitTestExpectAssertFailure (
FunctionCall
);
}
+
if (UnitTestStatus == UNIT_TEST_SKIPPED) {
UT_LOG_WARNING (
"[ASSERT WARN] %a:%d: UT_EXPECT_ASSERT_FAILURE(%a) disabled\n",
@@ -552,6 +562,7 @@ UnitTestExpectAssertFailure (
FunctionCall
);
}
+
if (UnitTestStatus == UNIT_TEST_ERROR_TEST_FAILED) {
UT_LOG_ERROR (
"[ASSERT FAIL] %a:%d: Function call (%a) did not ASSERT()!\n",
@@ -567,5 +578,6 @@ UnitTestExpectAssertFailure (
FunctionCall
);
}
+
return (UnitTestStatus != UNIT_TEST_ERROR_TEST_FAILED);
}