public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "VivianNK" <vnowkakeane@linux.microsoft.com>
To: devel@edk2.groups.io
Cc: Jian J Wang <jian.j.wang@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: [edk2-devel] [PATCH v2 3/7] MdeModulePkg: Apply uncrustify formatting to relevant files.
Date: Wed, 16 Aug 2023 14:15:18 -0700	[thread overview]
Message-ID: <20230816211523.12-4-vnowkakeane@linux.microsoft.com> (raw)
In-Reply-To: <20230816211523.12-1-vnowkakeane@linux.microsoft.com>

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>
---
 MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp                   | 37 +++++++++++---------
 MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h                |  4 +--
 MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHostBridgeLib.cpp |  8 ++---
 3 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp b/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp
index 23f6e9cc0611..16986a512fa3 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 a63bed895c60..51eefa6c21e8 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 4b15aed16966..1891727d3b2a 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);
-- 
2.41.0.windows.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107812): https://edk2.groups.io/g/devel/message/107812
Mute This Topic: https://groups.io/mt/100788668/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2023-08-16 21:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 21:15 [edk2-devel] [PATCH v2 0/7] Uncrustify GoogleTest update VivianNK
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 1/7] .pytool: Set uncrustify check to audit only (temporary) VivianNK
2023-08-16 22:09   ` Michael Kubacki
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 2/7] .pytool: Add cpp support to uncrustify plugin VivianNK
2023-08-16 21:15 ` VivianNK [this message]
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 4/7] MdePkg: Apply uncrustify formatting to relevant files VivianNK
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 5/7] SecurityPkg: " VivianNK
2023-08-17  2:41   ` Yao, Jiewen
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 6/7] UnitTestFrameworkPkg: " VivianNK
2023-08-16 21:15 ` [edk2-devel] [PATCH v2 7/7] .pytool: Undo uncrustify check change VivianNK
2023-08-16 22:09   ` Michael Kubacki
2023-09-12  1:08 ` 回复: [edk2-devel] [PATCH v2 0/7] Uncrustify GoogleTest update gaoliming via groups.io
2023-09-12 14:42 ` Michael D Kinney
2023-09-27 19:43   ` VivianNK
2023-10-24 20:34     ` VivianNK
2023-10-25 17:11       ` Michael D Kinney
2023-10-25 18:08         ` Michael D Kinney
2023-10-26 21:08           ` VivianNK
2023-10-27  2:41             ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230816211523.12-4-vnowkakeane@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox