From nobody Sat Feb 7 12:11:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107815+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107815+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1692220529; cv=none; d=zohomail.com; s=zohoarc; b=GmcyiemSMn+Hg6cJwlwxLL5aghuWOUN6GT/7jH2+6L4Qk/8h6Gajidt57bOm+WmLZvUay/TYWs4l6rYwkvJ7zdSTWUAUa2OhaCMqqHFph/KhRfHFjXkJFdY8saI3rH7EHwW4hRsC8u/UDVTqVFR0OIIl9ZIszs3J44+HvsCsilU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692220529; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=OvAb7C8xrSeLMAKlO2Tq3XKoYkC/kmuqCYH/1x+Apow=; b=H+9BsCHtOU95DEbvMbqgE5RzSjXJpcEmh5Kw4WJuu08y2MEi/yA+eGw/VEFe9nDffvj50+kb9ghIfu4SpgTe0m6CnGG13L9ZhHcMVoQGE8RihElKHrGkFQgZvY/hL9sz9+9zU1vgZuStOV8zQM2Tq4kElHs502ZmjEq+O91btS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107815+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1692220529213765.7448326118665; Wed, 16 Aug 2023 14:15:29 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=lGO42JA5I7/pQf6Sg/3Y9ZhokywJanzyh9CuZe+gUSg=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1692220528; v=1; b=lDGo37/lgo6mvclfxq3fKZD5jWUHz0Y5ZxetjtCAANLZluPV+FnndBt41T1TpkXsIIz99i6Y vNbbln/nRD7DA+Ip3GNfqrNFZI0uJIddDiUS/FO/HHuES4iIXyB6dx2VbA39Uk+jcvYbQD5UbMQ S5WNbWivjM23hcTnnEqukWqE= X-Received: by 127.0.0.2 with SMTP id f5GnYY1788612x59ZMVOkIBI; Wed, 16 Aug 2023 14:15:28 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.172399.1692220526231295328 for ; Wed, 16 Aug 2023 14:15:26 -0700 X-Received: from vivian-P520.redmond.corp.microsoft.com (unknown [131.107.1.251]) by linux.microsoft.com (Postfix) with ESMTPSA id F3335211F7A6; Wed, 16 Aug 2023 14:15:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F3335211F7A6 From: "VivianNK" To: devel@edk2.groups.io Cc: Michael D Kinney , Michael Kubacki , Sean Brogan , Michael Kubacki Subject: [edk2-devel] [PATCH v2 6/7] UnitTestFrameworkPkg: Apply uncrustify formatting to relevant files Date: Wed, 16 Aug 2023 14:15:21 -0700 Message-ID: <20230816211523.12-7-vnowkakeane@linux.microsoft.com> In-Reply-To: <20230816211523.12-1-vnowkakeane@linux.microsoft.com> References: <20230816211523.12-1-vnowkakeane@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,vnowkakeane@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: kYdFNZe7bdFbX0S0nrQedisex1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220531119100023 Content-Type: text/plain; charset="utf-8" Apply uncrustify formatting to GoogleTest cpp and header files. Cc: Michael D Kinney Cc: Michael Kubacki Cc: Sean Brogan Reviewed-by: Michael D Kinney Reviewed-by: Michael Kubacki --- UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h = | 2 +- UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGoogleT= est.cpp | 76 ++++++++++++-------- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h b/UnitTes= tFrameworkPkg/Include/Library/GoogleTestLib.h index c0a3d8e66011..c723b5c23050 100644 --- a/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h +++ b/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h @@ -14,7 +14,7 @@ #include =20 extern "C" { -#include + #include } =20 //////////////////////////////////////////////////////////////////////////= //// diff --git a/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/S= ampleGoogleTest.cpp b/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoo= gleTest/SampleGoogleTest.cpp index c83e58596a82..94cbf2cf0b3c 100644 --- a/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGo= ogleTest.cpp +++ b/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGo= ogleTest.cpp @@ -18,7 +18,7 @@ extern "C" { Sample unit test that verifies the expected result of an unsigned integer addition operation. **/ -TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) { +TEST (SimpleMathTests, OnePlusOneShouldEqualTwo) { UINTN A; UINTN B; UINTN C; @@ -34,11 +34,11 @@ TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) { Sample unit test that verifies that a global BOOLEAN is updatable. **/ class GlobalBooleanVarTests : public ::testing::Test { - public: - BOOLEAN SampleGlobalTestBoolean =3D FALSE; +public: + BOOLEAN SampleGlobalTestBoolean =3D FALSE; }; =20 -TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) { +TEST_F (GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) { SampleGlobalTestBoolean =3D TRUE; ASSERT_TRUE (SampleGlobalTestBoolean); =20 @@ -51,37 +51,46 @@ TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeChan= geable) { pointer is updatable. **/ class GlobalVarTests : public ::testing::Test { - public: - VOID *SampleGlobalTestPointer =3D NULL; +public: + VOID *SampleGlobalTestPointer =3D NULL; =20 - protected: - void SetUp() override { +protected: + void + SetUp ( + ) override + { ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)NULL); } - void TearDown() { + + void + TearDown ( + ) + { SampleGlobalTestPointer =3D NULL; } }; =20 -TEST_F(GlobalVarTests, GlobalPointerShouldBeChangeable) { +TEST_F (GlobalVarTests, GlobalPointerShouldBeChangeable) { SampleGlobalTestPointer =3D (VOID *)-1; ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)((VOID *)-1)); } =20 - /** Set PcdDebugPropertyMask for each MacroTestsAssertsEnabledDisabled test **/ class MacroTestsAssertsEnabledDisabled : public testing::TestWithParam { - void SetUp() { - PatchPcdSet8 (PcdDebugPropertyMask, GetParam()); + void + SetUp ( + ) + { + PatchPcdSet8 (PcdDebugPropertyMask, GetParam ()); } }; =20 /** Sample unit test using the ASSERT_TRUE() macro. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTrue) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertTrue) { UINT64 Result; =20 // @@ -99,7 +108,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTrue= ) { /** Sample unit test using the ASSERT_FALSE() macro. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertFalse) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertFalse) { UINT64 Result; =20 // @@ -117,7 +126,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertFal= se) { /** Sample unit test using the ASSERT_EQ() macro. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertEqual) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertEqual) { UINT64 Result; =20 // @@ -135,7 +144,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertEqu= al) { /** Sample unit test using the ASSERT_STREQ() macro. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) { CHAR8 *String1; CHAR8 *String2; =20 @@ -150,7 +159,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertMem= Equal) { /** Sample unit test using the ASSERT_NE() macro. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) { UINT64 Result; =20 // @@ -169,7 +178,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= Equal) { Sample unit test using the ASSERT_TRUE() and ASSERT(FALSE) and EFI_EFFOR() macros to check status **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) { // // This test passes because the status is not an EFI error. // @@ -184,7 +193,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= EfiError) { /** Sample unit test using the ASSERT_EQ() macro to compare EFI_STATUS value= s. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) { // // This test passes because the status value are always equal. // @@ -194,7 +203,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertSta= tusEqual) { /** Sample unit test using ASSERT_NE() macro to make sure a pointer is not N= ULL. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) { UINT64 Result; =20 // @@ -206,7 +215,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= Null) { /** Sample unit test using that should not generate any ASSERTs() **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) { // // This test passes because it never triggers an ASSERT(). // @@ -222,7 +231,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectNoA= ssertFailure) { /** Sample unit test using the ASSERT_DEATH() macro to test expected ASSERT(= )s. **/ -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) { +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) { // // Skip tests that verify an ASSERT() is triggered if ASSERT()s are disa= bled. // @@ -243,21 +252,28 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectA= ssertFailure) { ASSERT_DEATH (DecimalToBcd8 (101), ""); } =20 -INSTANTIATE_TEST_SUITE_P(ValidInput, - MacroTestsAssertsEnabledDisabled, - ::testing::Values(PcdGet8 (PcdDebugPropertyMask) = | BIT0, PcdGet8 (PcdDebugPropertyMask) & (~BIT0))); +INSTANTIATE_TEST_SUITE_P ( + ValidInput, + MacroTestsAssertsEnabledDisabled, + ::testing::Values (PcdGet8 (PcdDebugPropertyMask) | BIT0, PcdGet8 (PcdDe= bugPropertyMask) & (~BIT0)) + ); =20 /** Sample unit test using the SCOPED_TRACE() macro for trace messages. **/ -TEST(MacroTestsMessages, MacroTraceMessage) { +TEST (MacroTestsMessages, MacroTraceMessage) { // // Example of logging. // SCOPED_TRACE ("SCOPED_TRACE message\n"); } =20 -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 (); } --=20 2.41.0.windows.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107815): https://edk2.groups.io/g/devel/message/107815 Mute This Topic: https://groups.io/mt/100788671/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-