From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 651917803D2 for ; Tue, 15 Aug 2023 01:22:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AOhignEWrrE6NnO+geO02rg6AXFFh6g2eQYY2z9tpMo=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1692062574; v=1; b=LjOxBM6jMRAkZJwrL/rkM0fyyXalYHIbocCW2OVY9NrOsY5lM3dx7zKdOwHHyLekB3H/IfHX kgeVWiRTy2EawiE2ASYCsES/3tS1ItIF7KMs9rvx2IwI53LIWH6NN+o5qL8loEwT0LxPuRFdEbA r5Le81v63bnfxbmMbXd2Y8Xg= X-Received: by 127.0.0.2 with SMTP id ZzIzYY7687511xPQsVlrbccM; Mon, 14 Aug 2023 18:22:54 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.124805.1692062574330474498 for ; Mon, 14 Aug 2023 18:22:54 -0700 X-Received: from [192.168.4.22] (unknown [47.201.241.95]) by linux.microsoft.com (Postfix) with ESMTPSA id AAF6C2109443; Mon, 14 Aug 2023 18:22:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AAF6C2109443 Message-ID: <597c809b-fd37-ff6e-7562-9bf0c18c053e@linux.microsoft.com> Date: Mon, 14 Aug 2023 21:22:53 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 6/7] UnitTestFrameworkPkg: Apply uncrustify formatting to relevant files To: devel@edk2.groups.io, vnowkakeane@linux.microsoft.com References: <20230809213226.1387-1-vnowkakeane@linux.microsoft.com> <20230809213226.1387-7-vnowkakeane@linux.microsoft.com> From: "Michael Kubacki" In-Reply-To: <20230809213226.1387-7-vnowkakeane@linux.microsoft.com> 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,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: fIpdX7BljoOyiYbbvZoVTAdix7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=LjOxBM6j; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Michael Kubacki On 8/9/2023 5:32 PM, VivianNK wrote: > Apply uncrustify formatting to GoogleTest cpp and header files. >=20 > CC: Michael D Kinney > CC: Michael Kubacki > CC: Sean Brogan > Signed-off-by: Vivian Nowka-Keane > --- > UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h = | 2 +- > UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGoog= leTest.cpp | 76 ++++++++++++-------- > 2 files changed, 47 insertions(+), 31 deletions(-) >=20 > diff --git a/UnitTestFrameworkPkg/Include/Library/GoogleTestLib.h b/UnitT= estFrameworkPkg/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 > =20 >=20 > extern "C" { >=20 > -#include >=20 > + #include >=20 > } >=20 > =20 >=20 > ///////////////////////////////////////////////////////////////////////= /////// >=20 > diff --git a/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest= /SampleGoogleTest.cpp b/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleG= oogleTest/SampleGoogleTest.cpp > index c83e58596a82..94cbf2cf0b3c 100644 > --- a/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/Sample= GoogleTest.cpp > +++ b/UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/Sample= GoogleTest.cpp > @@ -18,7 +18,7 @@ extern "C" { > Sample unit test that verifies the expected result of an unsigned int= eger >=20 > addition operation. >=20 > **/ >=20 > -TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) { >=20 > +TEST (SimpleMathTests, OnePlusOneShouldEqualTwo) { >=20 > UINTN A; >=20 > UINTN B; >=20 > UINTN C; >=20 > @@ -34,11 +34,11 @@ TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) { > Sample unit test that verifies that a global BOOLEAN is updatable. >=20 > **/ >=20 > class GlobalBooleanVarTests : public ::testing::Test { >=20 > - public: >=20 > - BOOLEAN SampleGlobalTestBoolean =3D FALSE; >=20 > +public: >=20 > + BOOLEAN SampleGlobalTestBoolean =3D FALSE; >=20 > }; >=20 > =20 >=20 > -TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) { >=20 > +TEST_F (GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) { >=20 > SampleGlobalTestBoolean =3D TRUE; >=20 > ASSERT_TRUE (SampleGlobalTestBoolean); >=20 > =20 >=20 > @@ -51,37 +51,46 @@ TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeCh= angeable) { > pointer is updatable. >=20 > **/ >=20 > class GlobalVarTests : public ::testing::Test { >=20 > - public: >=20 > - VOID *SampleGlobalTestPointer =3D NULL; >=20 > +public: >=20 > + VOID *SampleGlobalTestPointer =3D NULL; >=20 > =20 >=20 > - protected: >=20 > - void SetUp() override { >=20 > +protected: >=20 > + void >=20 > + SetUp ( >=20 > + ) override >=20 > + { >=20 > ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)NULL); >=20 > } >=20 > - void TearDown() { >=20 > + >=20 > + void >=20 > + TearDown ( >=20 > + ) >=20 > + { >=20 > SampleGlobalTestPointer =3D NULL; >=20 > } >=20 > }; >=20 > =20 >=20 > -TEST_F(GlobalVarTests, GlobalPointerShouldBeChangeable) { >=20 > +TEST_F (GlobalVarTests, GlobalPointerShouldBeChangeable) { >=20 > SampleGlobalTestPointer =3D (VOID *)-1; >=20 > ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)((VOID *)-1)); >=20 > } >=20 > =20 >=20 > - >=20 > /** >=20 > Set PcdDebugPropertyMask for each MacroTestsAssertsEnabledDisabled te= st >=20 > **/ >=20 > class MacroTestsAssertsEnabledDisabled : public testing::TestWithParam<= UINT8> { >=20 > - void SetUp() { >=20 > - PatchPcdSet8 (PcdDebugPropertyMask, GetParam()); >=20 > + void >=20 > + SetUp ( >=20 > + ) >=20 > + { >=20 > + PatchPcdSet8 (PcdDebugPropertyMask, GetParam ()); >=20 > } >=20 > }; >=20 > =20 >=20 > /** >=20 > Sample unit test using the ASSERT_TRUE() macro. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTrue) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertTrue) { >=20 > UINT64 Result; >=20 > =20 >=20 > // >=20 > @@ -99,7 +108,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTr= ue) { > /** >=20 > Sample unit test using the ASSERT_FALSE() macro. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertFalse) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertFalse) { >=20 > UINT64 Result; >=20 > =20 >=20 > // >=20 > @@ -117,7 +126,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertF= alse) { > /** >=20 > Sample unit test using the ASSERT_EQ() macro. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertEqual) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertEqual) { >=20 > UINT64 Result; >=20 > =20 >=20 > // >=20 > @@ -135,7 +144,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertE= qual) { > /** >=20 > Sample unit test using the ASSERT_STREQ() macro. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) { >=20 > CHAR8 *String1; >=20 > CHAR8 *String2; >=20 > =20 >=20 > @@ -150,7 +159,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertM= emEqual) { > /** >=20 > Sample unit test using the ASSERT_NE() macro. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) { >=20 > UINT64 Result; >=20 > =20 >=20 > // >=20 > @@ -169,7 +178,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertN= otEqual) { > Sample unit test using the ASSERT_TRUE() and ASSERT(FALSE) >=20 > and EFI_EFFOR() macros to check status >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) { >=20 > // >=20 > // This test passes because the status is not an EFI error. >=20 > // >=20 > @@ -184,7 +193,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertN= otEfiError) { > /** >=20 > Sample unit test using the ASSERT_EQ() macro to compare EFI_STATUS va= lues. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) { >=20 > // >=20 > // This test passes because the status value are always equal. >=20 > // >=20 > @@ -194,7 +203,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertS= tatusEqual) { > /** >=20 > Sample unit test using ASSERT_NE() macro to make sure a pointer is no= t NULL. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) { >=20 > UINT64 Result; >=20 > =20 >=20 > // >=20 > @@ -206,7 +215,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertN= otNull) { > /** >=20 > Sample unit test using that should not generate any ASSERTs() >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) { >=20 > // >=20 > // This test passes because it never triggers an ASSERT(). >=20 > // >=20 > @@ -222,7 +231,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectN= oAssertFailure) { > /** >=20 > Sample unit test using the ASSERT_DEATH() macro to test expected ASSE= RT()s. >=20 > **/ >=20 > -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) { >=20 > +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) { >=20 > // >=20 > // Skip tests that verify an ASSERT() is triggered if ASSERT()s are d= isabled. >=20 > // >=20 > @@ -243,21 +252,28 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpec= tAssertFailure) { > ASSERT_DEATH (DecimalToBcd8 (101), ""); >=20 > } >=20 > =20 >=20 > -INSTANTIATE_TEST_SUITE_P(ValidInput, >=20 > - MacroTestsAssertsEnabledDisabled, >=20 > - ::testing::Values(PcdGet8 (PcdDebugPropertyMask= ) | BIT0, PcdGet8 (PcdDebugPropertyMask) & (~BIT0))); >=20 > +INSTANTIATE_TEST_SUITE_P ( >=20 > + ValidInput, >=20 > + MacroTestsAssertsEnabledDisabled, >=20 > + ::testing::Values (PcdGet8 (PcdDebugPropertyMask) | BIT0, PcdGet8 (Pcd= DebugPropertyMask) & (~BIT0)) >=20 > + ); >=20 > =20 >=20 > /** >=20 > Sample unit test using the SCOPED_TRACE() macro for trace messages. >=20 > **/ >=20 > -TEST(MacroTestsMessages, MacroTraceMessage) { >=20 > +TEST (MacroTestsMessages, MacroTraceMessage) { >=20 > // >=20 > // Example of logging. >=20 > // >=20 > SCOPED_TRACE ("SCOPED_TRACE message\n"); >=20 > } >=20 > =20 >=20 > -int main(int argc, char* argv[]) { >=20 > - testing::InitGoogleTest(&argc, argv); >=20 > - return RUN_ALL_TESTS(); >=20 > +int >=20 > +main ( >=20 > + int argc, >=20 > + char *argv[] >=20 > + ) >=20 > +{ >=20 > + testing::InitGoogleTest (&argc, argv); >=20 > + return RUN_ALL_TESTS (); >=20 > } >=20 -=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 (#107755): https://edk2.groups.io/g/devel/message/107755 Mute This Topic: https://groups.io/mt/100655294/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-