summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivian Nowka-Keane <vnowkakeane@linux.microsoft.com>2023-08-16 14:15:18 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-10-27 00:50:49 +0000
commit504953ef976b2435c871f5c0896701afcebdcf8a (patch)
tree5a0cd6e80cae65720017de4950cc44ad8bba3a25
parent41c622523de353a136fac4ecd3335b05e35fd411 (diff)
downloadedk2-504953ef976b2435c871f5c0896701afcebdcf8a.tar.gz
edk2-504953ef976b2435c871f5c0896701afcebdcf8a.tar.bz2
edk2-504953ef976b2435c871f5c0896701afcebdcf8a.zip
MdeModulePkg: Apply uncrustify formatting to relevant files.
Apply uncrustify formatting to GoogleTest cpp files and respective header file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
-rw-r--r--MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp37
-rw-r--r--MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h4
-rw-r--r--MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp8
3 files changed, 27 insertions, 22 deletions
diff --git a/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp b/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp
index 23f6e9cc06..16986a512f 100644
--- a/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp
+++ b/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp
@@ -20,9 +20,9 @@ CompareUint32 (
IN CONST VOID *Right
)
{
- if (*(UINT32*)Right > *(UINT32*)Left) {
+ if (*(UINT32 *)Right > *(UINT32 *)Left) {
return 1;
- } else if (*(UINT32*)Right < *(UINT32*)Left) {
+ } else if (*(UINT32 *)Right < *(UINT32 *)Left) {
return -1;
}
@@ -31,31 +31,36 @@ CompareUint32 (
// Test PerformQuickSort() API from UefiSortLib to verify a UINT32 array
// with 9 elements in ascending order is sorted into descending order.
-TEST(PerformQuickSortTest, SortUint32AscendingArray_Size9) {
- CONST UINT32 ArraySize = 9;
- UINT32 BuffActual[ArraySize];
- UINT32 BuffExpected[ArraySize];
+TEST (PerformQuickSortTest, SortUint32AscendingArray_Size9) {
+ CONST UINT32 ArraySize = 9;
+ UINT32 BuffActual[ArraySize];
+ UINT32 BuffExpected[ArraySize];
for (UINT32 Index = 0; Index < ArraySize; Index++) {
- BuffActual[Index] = Index + 1;
+ BuffActual[Index] = Index + 1;
BuffExpected[Index] = ArraySize - Index;
}
- PerformQuickSort (BuffActual, (UINTN)ArraySize, sizeof(UINT32), (SORT_COMPARE)CompareUint32);
- EXPECT_THAT(BuffActual, ElementsAreArray(BuffExpected, ArraySize));
+ PerformQuickSort (BuffActual, (UINTN)ArraySize, sizeof (UINT32), (SORT_COMPARE)CompareUint32);
+ EXPECT_THAT (BuffActual, ElementsAreArray (BuffExpected, ArraySize));
}
// Test StringCompare() API from UefiSortLib to verify the comparison
// succeeds when the same buffer is compared with itself.
-TEST(StringCompareTest, CompareSameBuffer) {
- INTN RetVal;
- CONST CHAR16 *Buffer = (CHAR16*)L"abcdefg";
+TEST (StringCompareTest, CompareSameBuffer) {
+ INTN RetVal;
+ CONST CHAR16 *Buffer = (CHAR16 *)L"abcdefg";
RetVal = StringCompare (&Buffer, &Buffer);
- EXPECT_EQ(RetVal, 0);
+ EXPECT_EQ (RetVal, 0);
}
-int main(int argc, char* argv[]) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
+int
+main (
+ int argc,
+ char *argv[]
+ )
+{
+ testing::InitGoogleTest (&argc, argv);
+ return RUN_ALL_TESTS ();
}
diff --git a/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h b/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h
index a63bed895c..51eefa6c21 100644
--- a/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h
+++ b/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h
@@ -11,8 +11,8 @@
#include <Library/GoogleTestLib.h>
#include <Library/FunctionMockLib.h>
extern "C" {
-#include <Uefi.h>
-#include <Library/PciHostBridgeLib.h>
+ #include <Uefi.h>
+ #include <Library/PciHostBridgeLib.h>
}
struct MockPciHostBridgeLib {
diff --git a/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp b/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp
index 4b15aed169..1891727d3b 100644
--- a/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp
+++ b/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp
@@ -7,8 +7,8 @@
#include <GoogleTest/Library/MockPciHostBridgeLib.h>
-MOCK_INTERFACE_DEFINITION(MockPciHostBridgeLib);
+MOCK_INTERFACE_DEFINITION (MockPciHostBridgeLib);
-MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeGetRootBridges, 1, EFIAPI);
-MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeFreeRootBridges, 2, EFIAPI);
-MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeResourceConflict, 2, EFIAPI);
+MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeGetRootBridges, 1, EFIAPI);
+MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeFreeRootBridges, 2, EFIAPI);
+MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeResourceConflict, 2, EFIAPI);