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 738F1AC09EB for ; Thu, 10 Aug 2023 00:24:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8Ckbz45AojMr7IdwZQF2TLWLNiEcXhUh8Tb3gbqvmSs=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:From:To: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=1691627049; v=1; b=mIKmYTxTMYni1RGWq7bZ5HHMPGCphX89M1o9K/WS8YG3MA1bUfq45n7HZvaKZKFpPhyNUonj yb+AzCXiG3ySa3231uWErVQpX5swOIXYyuyO2AwTZbj6gGpkDbOrbX4pB80RPyoQ8klbUuy1+SG PIv0UEQOcV2PdyQzcTPf24Y4= X-Received: by 127.0.0.2 with SMTP id 1SYYYY7687511xAiHi6msND2; Wed, 09 Aug 2023 17:24:09 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.3612.1691616749853079630 for ; Wed, 09 Aug 2023 14:32:29 -0700 X-Received: from vivian-P520.redmond.corp.microsoft.com (unknown [131.107.1.251]) by linux.microsoft.com (Postfix) with ESMTPSA id 9D24C20FC4EA for ; Wed, 9 Aug 2023 14:32:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9D24C20FC4EA From: "VivianNK" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v1 6/7] UnitTestFrameworkPkg: Apply uncrustify formatting to relevant files Date: Wed, 9 Aug 2023 14:32:25 -0700 Message-ID: <20230809213226.1387-7-vnowkakeane@linux.microsoft.com> In-Reply-To: <20230809213226.1387-1-vnowkakeane@linux.microsoft.com> References: <20230809213226.1387-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: T4j6IvCdztzMJPigiHUyEr7Yx7686176AA= 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=mIKmYTxT; 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 Signed-off-by: Vivian Nowka-Keane --- 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 (#107671): https://edk2.groups.io/g/devel/message/107671 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] -=-=-=-=-=-=-=-=-=-=-=-