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 1C7887803CF for ; Wed, 16 Aug 2023 21:15:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tlDtRqM5pNE/pLl35n+FszMnLwx0KFTMBTewcqiGaMw=; 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=1692220529; v=1; b=Eh02rUw+FzBDf6ch3KEAsDvNtmJ8Jd6W3iZMtwUhkgRIII5v18CSbutOxBw/whH0yRIkLFYY niquNjqA60NBNg12MtUeIerbm6lvByj6h5MJfotENzFNXAR/8/LgmEmngUJR0ZFXAYxwqIUqMTb W4YnoZj7o2jzkmloFiyH5byI= X-Received: by 127.0.0.2 with SMTP id GTNrYY7687511x6jWLsukDjV; Wed, 16 Aug 2023 14:15:29 -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: 4uD8S97vMbIlKRRpuRAsPu12x7686176AA= 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=Eh02rUw+; 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 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 =0D =0D extern "C" {=0D -#include =0D + #include =0D }=0D =0D //////////////////////////////////////////////////////////////////////////= ////=0D 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 intege= r=0D addition operation.=0D **/=0D -TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) {=0D +TEST (SimpleMathTests, OnePlusOneShouldEqualTwo) {=0D UINTN A;=0D UINTN B;=0D UINTN C;=0D @@ -34,11 +34,11 @@ TEST(SimpleMathTests, OnePlusOneShouldEqualTwo) { Sample unit test that verifies that a global BOOLEAN is updatable.=0D **/=0D class GlobalBooleanVarTests : public ::testing::Test {=0D - public:=0D - BOOLEAN SampleGlobalTestBoolean =3D FALSE;=0D +public:=0D + BOOLEAN SampleGlobalTestBoolean =3D FALSE;=0D };=0D =0D -TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) {=0D +TEST_F (GlobalBooleanVarTests, GlobalBooleanShouldBeChangeable) {=0D SampleGlobalTestBoolean =3D TRUE;=0D ASSERT_TRUE (SampleGlobalTestBoolean);=0D =0D @@ -51,37 +51,46 @@ TEST_F(GlobalBooleanVarTests, GlobalBooleanShouldBeChan= geable) { pointer is updatable.=0D **/=0D class GlobalVarTests : public ::testing::Test {=0D - public:=0D - VOID *SampleGlobalTestPointer =3D NULL;=0D +public:=0D + VOID *SampleGlobalTestPointer =3D NULL;=0D =0D - protected:=0D - void SetUp() override {=0D +protected:=0D + void=0D + SetUp (=0D + ) override=0D + {=0D ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)NULL);=0D }=0D - void TearDown() {=0D +=0D + void=0D + TearDown (=0D + )=0D + {=0D SampleGlobalTestPointer =3D NULL;=0D }=0D };=0D =0D -TEST_F(GlobalVarTests, GlobalPointerShouldBeChangeable) {=0D +TEST_F (GlobalVarTests, GlobalPointerShouldBeChangeable) {=0D SampleGlobalTestPointer =3D (VOID *)-1;=0D ASSERT_EQ ((UINTN)SampleGlobalTestPointer, (UINTN)((VOID *)-1));=0D }=0D =0D -=0D /**=0D Set PcdDebugPropertyMask for each MacroTestsAssertsEnabledDisabled test= =0D **/=0D class MacroTestsAssertsEnabledDisabled : public testing::TestWithParam {=0D - void SetUp() {=0D - PatchPcdSet8 (PcdDebugPropertyMask, GetParam());=0D + void=0D + SetUp (=0D + )=0D + {=0D + PatchPcdSet8 (PcdDebugPropertyMask, GetParam ());=0D }=0D };=0D =0D /**=0D Sample unit test using the ASSERT_TRUE() macro.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTrue) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertTrue) {=0D UINT64 Result;=0D =0D //=0D @@ -99,7 +108,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertTrue= ) { /**=0D Sample unit test using the ASSERT_FALSE() macro.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertFalse) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertFalse) {=0D UINT64 Result;=0D =0D //=0D @@ -117,7 +126,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertFal= se) { /**=0D Sample unit test using the ASSERT_EQ() macro.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertEqual) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertEqual) {=0D UINT64 Result;=0D =0D //=0D @@ -135,7 +144,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertEqu= al) { /**=0D Sample unit test using the ASSERT_STREQ() macro.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertMemEqual) {=0D CHAR8 *String1;=0D CHAR8 *String2;=0D =0D @@ -150,7 +159,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertMem= Equal) { /**=0D Sample unit test using the ASSERT_NE() macro.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEqual) {=0D UINT64 Result;=0D =0D //=0D @@ -169,7 +178,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= Equal) { Sample unit test using the ASSERT_TRUE() and ASSERT(FALSE)=0D and EFI_EFFOR() macros to check status=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotEfiError) {=0D //=0D // This test passes because the status is not an EFI error.=0D //=0D @@ -184,7 +193,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= EfiError) { /**=0D Sample unit test using the ASSERT_EQ() macro to compare EFI_STATUS value= s.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertStatusEqual) {=0D //=0D // This test passes because the status value are always equal.=0D //=0D @@ -194,7 +203,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertSta= tusEqual) { /**=0D Sample unit test using ASSERT_NE() macro to make sure a pointer is not N= ULL.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroAssertNotNull) {=0D UINT64 Result;=0D =0D //=0D @@ -206,7 +215,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroAssertNot= Null) { /**=0D Sample unit test using that should not generate any ASSERTs()=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectNoAssertFailure) {=0D //=0D // This test passes because it never triggers an ASSERT().=0D //=0D @@ -222,7 +231,7 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectNoA= ssertFailure) { /**=0D Sample unit test using the ASSERT_DEATH() macro to test expected ASSERT(= )s.=0D **/=0D -TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) {=0D +TEST_P (MacroTestsAssertsEnabledDisabled, MacroExpectAssertFailure) {=0D //=0D // Skip tests that verify an ASSERT() is triggered if ASSERT()s are disa= bled.=0D //=0D @@ -243,21 +252,28 @@ TEST_P(MacroTestsAssertsEnabledDisabled, MacroExpectA= ssertFailure) { ASSERT_DEATH (DecimalToBcd8 (101), "");=0D }=0D =0D -INSTANTIATE_TEST_SUITE_P(ValidInput,=0D - MacroTestsAssertsEnabledDisabled,=0D - ::testing::Values(PcdGet8 (PcdDebugPropertyMask) = | BIT0, PcdGet8 (PcdDebugPropertyMask) & (~BIT0)));=0D +INSTANTIATE_TEST_SUITE_P (=0D + ValidInput,=0D + MacroTestsAssertsEnabledDisabled,=0D + ::testing::Values (PcdGet8 (PcdDebugPropertyMask) | BIT0, PcdGet8 (PcdDe= bugPropertyMask) & (~BIT0))=0D + );=0D =0D /**=0D Sample unit test using the SCOPED_TRACE() macro for trace messages.=0D **/=0D -TEST(MacroTestsMessages, MacroTraceMessage) {=0D +TEST (MacroTestsMessages, MacroTraceMessage) {=0D //=0D // Example of logging.=0D //=0D SCOPED_TRACE ("SCOPED_TRACE message\n");=0D }=0D =0D -int main(int argc, char* argv[]) {=0D - testing::InitGoogleTest(&argc, argv);=0D - return RUN_ALL_TESTS();=0D +int=0D +main (=0D + int argc,=0D + char *argv[]=0D + )=0D +{=0D + testing::InitGoogleTest (&argc, argv);=0D + return RUN_ALL_TESTS ();=0D }=0D --=20 2.41.0.windows.3 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-