From nobody Tue May 14 09:09:19 2024 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+107810+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+107810+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1692220526; cv=none; d=zohomail.com; s=zohoarc; b=eWYTa6gSzbU0C4ZvoP77UT45sQiVIBMWiki2i8AHtWOPeE/Wky3F3TIslhq2+X+kctmBFWLbQzEexC/+7pWES1E8k82+SRhD23oXIeN8iKmZ92qtYv1C1ASzinc5XnltHQqm4GPOt3EKAXw0eAlOTgpbCGmrNKJIXOyuuwy7x94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692220526; 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=ddkdAxiVX7zfurIMIIv7Lq8sReFCdJew6Pgyk+VxYUQ=; b=HoKdEHmDBoJz3g2imuYICyHkLXv3FgA49+JybIYE7YSgMkMT/sg5n91N3OxVMYVaANlpAMOzeSGntGwLeBGi2srTwTYcp0WwnFh4ZROzwQMIAlF7cCtaNHbMx5kN7VY5tmp/MTz7LZMofIN4/Vx2WyjcAHYBWSdiJhxl3LouiVA= 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+107810+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 1692220526462593.7972326036422; Wed, 16 Aug 2023 14:15:26 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=E8qKmyRdM6cej8FbdcZ7doF2mFY1JwW/r7wTgeuaC94=; 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=1692220526; v=1; b=tFvak+V9SlGlvKmERIi9+lyojAtwMovD26s+sgXjBU6HDoTeGeu38LarqZS5waqqflxfcgQk I9Hp1JL17HylbuyJcmcdWUl1c1lDHgjk/815pmm0OUX78peGglYgtxUcPoKc6nABx3fKWYdohjP ctebw3ZuvagG1DBr1SrDcF90= X-Received: by 127.0.0.2 with SMTP id jgbvYY1788612xrQSPVBDy6Q; Wed, 16 Aug 2023 14:15:26 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.172396.1692220525254846117 for ; Wed, 16 Aug 2023 14:15:25 -0700 X-Received: from vivian-P520.redmond.corp.microsoft.com (unknown [131.107.1.251]) by linux.microsoft.com (Postfix) with ESMTPSA id E3465211F7A0; Wed, 16 Aug 2023 14:15:24 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E3465211F7A0 From: "VivianNK" To: devel@edk2.groups.io Cc: Sean Brogan , Michael Kubacki , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 1/7] .pytool: Set uncrustify check to audit only (temporary) Date: Wed, 16 Aug 2023 14:15:16 -0700 Message-ID: <20230816211523.12-2-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: Yo3rLl84oXzfDfCSykL0KAW7x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220528122100006 Content-Type: text/plain; charset="utf-8" Temporarily set uncrustify to audit only mode so the following commits can = adjust the code for new formatting settings before those settings are appli= ed. Cc: Sean Brogan Cc: Michael Kubacki Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Vivian Nowka-Keane Reviewed-by: Michael Kubacki --- .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Pl= ugin/UncrustifyCheck/UncrustifyCheck.py index 8dc9ffe6945a..8978ffc443bf 100644 --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py @@ -530,7 +530,7 @@ class UncrustifyCheck(ICiBuildPlugin): """ Initializes options that influence test case output. """ - self._audit_only_mode =3D False + self._audit_only_mode =3D True self._output_file_diffs =3D True =20 if "AuditOnly" in self._package_config and self._package_config["A= uditOnly"]: --=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 (#107810): https://edk2.groups.io/g/devel/message/107810 Mute This Topic: https://groups.io/mt/100788666/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- From nobody Tue May 14 09:09:19 2024 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+107811+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+107811+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1692220527; cv=none; d=zohomail.com; s=zohoarc; b=fIKNQlEErCoByN5+ni599dYlQyQSOpJNdy2XuZAvL8c7If4lPPqoXtniqjSqsaBdXmmHPJQJ6PMb/e4wa4D45+RrcBJUeoP/IpD+UxGR0R5Hl3hov5RJFvzV7SQadeSvX7yTEazLPKvwKy4pHc8HwszUFPHkRAmwu6YnFtq9ako= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692220527; 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=tGgDMwTg9vnIbC2axpbDx6XtD+MmzEzkRk/IKRHZcMQ=; b=jxHlCh8/VDQOUI/xonYKkFD/nfILdH5vUx0BmybLsnVIY8fzQg1xgOs8zxv6DKfmf1BKNmXSkhjh8wCoqa44E73I74HL+ndcgdPXMhFUgyuTiO4i2YmflXszIU6vxvu3OcMmvtQtr0hQnsQ5Jzwu8JyvEkbeVUpLIDmL8ESpEoY= 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+107811+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 1692220527041380.26712051892105; Wed, 16 Aug 2023 14:15:27 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=HYtgnoKLKoN22LKNpIixbwozfA5Ba7iHWrE/5S5wmss=; 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=1692220526; v=1; b=KTerhbhlSbQTNFi02SpU1N0t6nHx6zlVNKytoNG4h+HYBhKIkGhO3RvzGjPHEUIUQfJ8q6wh 6VylJ87vJtSRs19F3A3Zc4QzPRweGf6AvFSZcv5I/hLoUVaSS6TdbH4mXeNNv3wzCSjdL1nUweL 0BQqzvRRlJIwjgEElhLYUbH0= X-Received: by 127.0.0.2 with SMTP id 2CIdYY1788612xNLJ4QldDVi; Wed, 16 Aug 2023 14:15:26 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.172576.1692220525407281626 for ; Wed, 16 Aug 2023 14:15:25 -0700 X-Received: from vivian-P520.redmond.corp.microsoft.com (unknown [131.107.1.251]) by linux.microsoft.com (Postfix) with ESMTPSA id 1A511211F7A1; Wed, 16 Aug 2023 14:15:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1A511211F7A1 From: "VivianNK" To: devel@edk2.groups.io Cc: Sean Brogan , Michael Kubacki , Michael D Kinney , Liming Gao , Michael Kubacki Subject: [edk2-devel] [PATCH v2 2/7] .pytool: Add cpp support to uncrustify plugin Date: Wed, 16 Aug 2023 14:15:17 -0700 Message-ID: <20230816211523.12-3-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: oUSsxs1VhroDyqwg1DcdCe5Dx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220527321100001 Content-Type: text/plain; charset="utf-8" Modified the uncrustify config to apply cpp specific formatting rules. Modified uncrustify check to include *.cpp files. Cc: Sean Brogan =20 Cc: Michael Kubacki =20 Cc: Michael D Kinney =20 Cc: Liming Gao =20 Signed-off-by: Vivian Nowka-Keane Reviewed-by: Michael Kubacki --- .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 2 +- .pytool/Plugin/UncrustifyCheck/uncrustify.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Pl= ugin/UncrustifyCheck/UncrustifyCheck.py index 8978ffc443bf..17f77b48d954 100644 --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py @@ -110,7 +110,7 @@ class UncrustifyCheck(ICiBuildPlugin): # A package can add any additional paths with "AdditionalIncludePaths" # A package can remove any of these paths with "IgnoreStandardPaths" # - STANDARD_PLUGIN_DEFINED_PATHS =3D ("*.c", "*.h") + STANDARD_PLUGIN_DEFINED_PATHS =3D ("*.c", "*.h", "*.cpp") =20 # # The Uncrustify application path should set in this environment varia= ble diff --git a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg b/.pytool/Plugin= /UncrustifyCheck/uncrustify.cfg index 8506c3333715..d7e86a6e57e6 100644 --- a/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg +++ b/.pytool/Plugin/UncrustifyCheck/uncrustify.cfg @@ -215,7 +215,7 @@ indent_braces =3D false indent_braces_no_class =3D false indent_braces_no_func =3D true indent_braces_no_struct =3D false -indent_class =3D false +indent_class =3D true indent_class_colon =3D false indent_cmt_with_tabs =3D false # Whether to indent comm= ents that are not at a brace level with tabs on # a tabstop. Requires inde= nt_with_tabs=3D2. If false, will use spaces. @@ -223,7 +223,7 @@ indent_col1_comment =3D true indent_col1_multi_string_literal=3D true indent_comma_paren =3D true indent_else_if =3D true -indent_extern =3D false +indent_extern =3D true indent_first_bool_expr =3D true =20 indent_func_def_param_paren_pos_threshold =3D 0 --=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 (#107811): https://edk2.groups.io/g/devel/message/107811 Mute This Topic: https://groups.io/mt/100788667/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- From nobody Tue May 14 09:09:19 2024 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+107812+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+107812+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1692220528; cv=none; d=zohomail.com; s=zohoarc; b=l4kEfdzBZYUt7Gv91r7grXZf2HU7GdSRo7p+e2yS6Rl1uI+7rAy3TNvjzfDi9mhfRe+6ibC3xHF3UrX4vqXtwG7wN1qEsNFpv+D1ppsL/DB/BCWW+/xMeIlQuwG9yV898rrkz5SWr6MRp6/Zo32uZ+uy8EoVMzAutqjgVtgQwis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692220528; 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=IWk0BGFyRExNWATrXS1RYZpayzOFFINiJkUJk8kF9rA=; b=EGlflfdgmqhgKuIez1jQ1WnuvvG0fSAuGPmOxyI1giyIdehXil3TQ8RAMNCTD4HLApY4U08t5ZQk3ZlQy/k1cnegyitOcXabDhb0jCI+/9i4PQPFerHXZR6py/7wgRGzjZdLKMKBLWHEhhkhGzCCmf5xSAXC9sBotSiPgVcjW2M= 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+107812+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 1692220528005391.3134078031794; Wed, 16 Aug 2023 14:15:28 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+lNDFGhUv0tNVLk13dPG4OPJ5lwzgTa+4f4CZQwzri0=; 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=1692220527; v=1; b=fF0TZBwsRMmVqOemiGj95+WUaWu8gFl/gklHAJv6pZAbIxDwkRA01rp2DZzOxjpatvsMbsan dZO11tQpdvQWsYJu/fI35w6pOE3aXrGtweJolW0NSN/tgawqNx5iaGcEHiK8v8CdhovZTOksjL9 4RZ8iMmmqcJ1UGYetOLr/Hb8= X-Received: by 127.0.0.2 with SMTP id oMxqYY1788612xEUbQbAeDn2; Wed, 16 Aug 2023 14:15:27 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.172577.1692220525565723579 for ; Wed, 16 Aug 2023 14:15:25 -0700 X-Received: from vivian-P520.redmond.corp.microsoft.com (unknown [131.107.1.251]) by linux.microsoft.com (Postfix) with ESMTPSA id 4507A211F7A3; Wed, 16 Aug 2023 14:15:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4507A211F7A3 From: "VivianNK" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH v2 3/7] MdeModulePkg: Apply uncrustify formatting to relevant files. Date: Wed, 16 Aug 2023 14:15:18 -0700 Message-ID: <20230816211523.12-4-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: asWDisPafWpyLc6kawUpLucBx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220530164100021 Content-Type: text/plain; charset="utf-8" Apply uncrustify formatting to GoogleTest cpp files and respective header file. Cc: Jian J Wang =20 Cc: Liming Gao Cc: Hao A Wu =20 Cc: Ray Ni =20 Signed-off-by: Vivian Nowka-Keane --- MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleTest.cpp = | 37 +++++++++++--------- MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLib.h = | 4 +-- MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPciHost= BridgeLib.cpp | 8 ++--- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/MdeModulePkg/Library/UefiSortLib/GoogleTest/UefiSortLibGoogleT= est.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; } =20 @@ -31,31 +31,36 @@ CompareUint32 ( =20 // 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 =3D 9; - UINT32 BuffActual[ArraySize]; - UINT32 BuffExpected[ArraySize]; +TEST (PerformQuickSortTest, SortUint32AscendingArray_Size9) { + CONST UINT32 ArraySize =3D 9; + UINT32 BuffActual[ArraySize]; + UINT32 BuffExpected[ArraySize]; =20 for (UINT32 Index =3D 0; Index < ArraySize; Index++) { - BuffActual[Index] =3D Index + 1; + BuffActual[Index] =3D Index + 1; BuffExpected[Index] =3D ArraySize - Index; } =20 - PerformQuickSort (BuffActual, (UINTN)ArraySize, sizeof(UINT32), (SORT_CO= MPARE)CompareUint32); - EXPECT_THAT(BuffActual, ElementsAreArray(BuffExpected, ArraySize)); + PerformQuickSort (BuffActual, (UINTN)ArraySize, sizeof (UINT32), (SORT_C= OMPARE)CompareUint32); + EXPECT_THAT (BuffActual, ElementsAreArray (BuffExpected, ArraySize)); } =20 // 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 =3D (CHAR16*)L"abcdefg"; +TEST (StringCompareTest, CompareSameBuffer) { + INTN RetVal; + CONST CHAR16 *Buffer =3D (CHAR16 *)L"abcdefg"; =20 RetVal =3D StringCompare (&Buffer, &Buffer); - EXPECT_EQ(RetVal, 0); + EXPECT_EQ (RetVal, 0); } =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 (); } diff --git a/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostB= ridgeLib.h b/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostB= ridgeLib.h index a63bed895c60..51eefa6c21e8 100644 --- a/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLi= b.h +++ b/MdeModulePkg/Test/Mock/Include/GoogleTest/Library/MockPciHostBridgeLi= b.h @@ -11,8 +11,8 @@ #include #include extern "C" { -#include -#include + #include + #include } =20 struct MockPciHostBridgeLib { diff --git a/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib= /MockPciHostBridgeLib.cpp b/MdeModulePkg/Test/Mock/Library/GoogleTest/MockP= ciHostBridgeLib/MockPciHostBridgeLib.cpp index 4b15aed16966..1891727d3b2a 100644 --- a/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPc= iHostBridgeLib.cpp +++ b/MdeModulePkg/Test/Mock/Library/GoogleTest/MockPciHostBridgeLib/MockPc= iHostBridgeLib.cpp @@ -7,8 +7,8 @@ =20 #include =20 -MOCK_INTERFACE_DEFINITION(MockPciHostBridgeLib); +MOCK_INTERFACE_DEFINITION (MockPciHostBridgeLib); =20 -MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeGetRootBridges= , 1, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeFreeRootBridge= s, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPciHostBridgeLib, PciHostBridgeResourceConfli= ct, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeGetRootBridge= s, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeFreeRootBridg= es, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPciHostBridgeLib, PciHostBridgeResourceConfl= ict, 2, EFIAPI); --=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 (#107812): https://edk2.groups.io/g/devel/message/107812 Mute This Topic: https://groups.io/mt/100788668/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- From nobody Tue May 14 09:09:19 2024 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+107813+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+107813+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1692220528; cv=none; d=zohomail.com; s=zohoarc; b=Q7BngxNrkTx5vwUj7vrOIhvHTexP7TTuRMagyryaWWfggSVYtifiXSHqkVmPCGmriTXsMqkrRD9ifwSxcv/pKHp8YJ9APJC82wS5eKpV4n2mLAfVPDNINKDibZ7Tw3KFfQysAjwNGgluXrO4h8zlY/s8WPM5uCdsnSA4g9vhmCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692220528; 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=xaOZzulEW23N9DbmFa16gl+tTrFzo44XFuF4slecsEk=; b=ikz8QeNpO3KXSBJ0iauS45STXqYdJAz3so3Q23KsymgAcoibnblElmck9WBt/9AYrdLoUdVXNSP5CXT/FziJtYWTpbEOJnVRUMj3PUxlX+WC/NtuSYuYeQlHQq0Ckt/xt1syQTHHfTgZdmh2OUsQ9BGS9oTWbgqbCPY4owPYDCQ= 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+107813+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 1692220528661350.242145818724; Wed, 16 Aug 2023 14:15:28 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=zy4hayl+6epz50hzm/67Ss40fPRFkvz33KJvppy/IXs=; 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=CR0aJ6R3tA+klSUKGgZXPJ5PDPCWkQ2m+/KGkHlJAc2v4RvNj8WIx5lMCsoi61HHLQ7pEcbb S7l6Mk7sCDj7YtVs4TOdnZuhkETHOrfS2dJIwKDLNUKsGLnI3OYmPDkPJROfV+UVac7oLIdfL9Y OhPnV95HzYiKmH01NnLfDvWc= X-Received: by 127.0.0.2 with SMTP id Zm4wYY1788612x47MlRNjwDA; 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.web10.172578.1692220525974817338 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 6BF92211F61D; Wed, 16 Aug 2023 14:15:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6BF92211F61D From: "VivianNK" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v2 4/7] MdePkg: Apply uncrustify formatting to relevant files Date: Wed, 16 Aug 2023 14:15:19 -0700 Message-ID: <20230816211523.12-5-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: 4sStJv02U3SoQSXNjRhG5Wqcx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220529396100012 Content-Type: text/plain; charset="utf-8" Apply uncrustify formatting to GoogleTest cpp and header files. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu =20 Signed-off-by: Vivian Nowka-Keane --- MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTests= 32.cpp | 114 ++-- MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnitTests= 64.cpp | 114 ++-- MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.cpp = | 563 ++++++++++---------- MdePkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h = | 6 +- MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib.h = | 6 +- MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h = | 4 +- MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServicesTableLi= b.h | 4 +- MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp = | 40 +- MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiServicesLib.= cpp | 52 +- MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp = | 6 +- MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/MockUe= fiRuntimeServicesTableLib.cpp | 12 +- 11 files changed, 463 insertions(+), 458 deletions(-) diff --git a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnI= ntnUnitTests32.cpp b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntL= ibUintnIntnUnitTests32.cpp index 6fbf302c1c5e..3f50f0cd99db 100644 --- a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnit= Tests32.cpp +++ b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnit= Tests32.cpp @@ -14,10 +14,10 @@ extern "C" { #include } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUintn) { +TEST (ConversionTestSuite, TestSafeInt32ToUintn) { RETURN_STATUS Status; - INT32 Operand; - UINTN Result; + INT32 Operand; + UINTN Result; =20 // // If Operand is non-negative, then it's a cast @@ -36,10 +36,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToIntn) { +TEST (ConversionTestSuite, TestSafeUint32ToIntn) { RETURN_STATUS Status; - UINT32 Operand; - INTN Result; + UINT32 Operand; + INTN Result; =20 // // If Operand is <=3D MAX_INTN, then it's a cast @@ -58,10 +58,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToInt32) { +TEST (ConversionTestSuite, TestSafeIntnToInt32) { RETURN_STATUS Status; - INTN Operand; - INT32 Result; + INTN Operand; + INT32 Result; =20 // // INTN is same as INT32 in IA32, so this is just a cast @@ -73,10 +73,10 @@ TEST(ConversionTestSuite, TestSafeIntnToInt32) { ASSERT_EQ (0x5bababab, Result); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUint32) { +TEST (ConversionTestSuite, TestSafeIntnToUint32) { RETURN_STATUS Status; - INTN Operand; - UINT32 Result; + INTN Operand; + UINT32 Result; =20 // // If Operand is non-negative, then it's a cast @@ -95,10 +95,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToUint32) { +TEST (ConversionTestSuite, TestSafeUintnToUint32) { RETURN_STATUS Status; - UINTN Operand; - UINT32 Result; + UINTN Operand; + UINT32 Result; =20 // // UINTN is same as UINT32 in IA32, so this is just a cast @@ -110,10 +110,10 @@ TEST(ConversionTestSuite, TestSafeUintnToUint32) { ASSERT_EQ (0xabababab, Result); } =20 -TEST(ConversionTestSuite, TestSafeUintnToIntn) { +TEST (ConversionTestSuite, TestSafeUintnToIntn) { RETURN_STATUS Status; - UINTN Operand; - INTN Result; + UINTN Operand; + INTN Result; =20 // // If Operand is <=3D MAX_INTN, then it's a cast @@ -132,10 +132,10 @@ TEST(ConversionTestSuite, TestSafeUintnToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToInt64) { +TEST (ConversionTestSuite, TestSafeUintnToInt64) { RETURN_STATUS Status; - UINTN Operand; - INT64 Result; + UINTN Operand; + INT64 Result; =20 // // UINTN is same as UINT32 in IA32, and UINT32 is a subset of @@ -148,10 +148,10 @@ TEST(ConversionTestSuite, TestSafeUintnToInt64) { ASSERT_EQ (0xabababab, Result); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToIntn) { +TEST (ConversionTestSuite, TestSafeInt64ToIntn) { RETURN_STATUS Status; - INT64 Operand; - INTN Result; + INT64 Operand; + INTN Result; =20 // // If Operand is between MIN_INTN and MAX_INTN2 inclusive, then it's a = cast @@ -179,10 +179,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUintn) { +TEST (ConversionTestSuite, TestSafeInt64ToUintn) { RETURN_STATUS Status; - INT64 Operand; - UINTN Result; + INT64 Operand; + UINTN Result; =20 // // If Operand is between 0 and MAX_UINTN inclusive, then it's a cast @@ -205,10 +205,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToIntn) { +TEST (ConversionTestSuite, TestSafeUint64ToIntn) { RETURN_STATUS Status; - UINT64 Operand; - INTN Result; + UINT64 Operand; + INTN Result; =20 // // If Operand is <=3D MAX_INTN, then it's a cast @@ -227,10 +227,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToUintn) { +TEST (ConversionTestSuite, TestSafeUint64ToUintn) { RETURN_STATUS Status; - UINT64 Operand; - UINTN Result; + UINT64 Operand; + UINTN Result; =20 // // If Operand is <=3D MAX_UINTN, then it's a cast @@ -249,11 +249,11 @@ TEST(ConversionTestSuite, TestSafeUint64ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUintnAdd) { +TEST (AdditionSubtractionTestSuite, TestSafeUintnAdd) { RETURN_STATUS Status; - UINTN Augend; - UINTN Addend; - UINTN Result; + UINTN Augend; + UINTN Addend; + UINTN Result; =20 // // If the result of addition doesn't overflow MAX_UINTN, then it's addit= ion @@ -274,11 +274,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUintnAdd) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeIntnAdd) { +TEST (AdditionSubtractionTestSuite, TestSafeIntnAdd) { RETURN_STATUS Status; - INTN Augend; - INTN Addend; - INTN Result; + INTN Augend; + INTN Addend; + INTN Result; =20 // // If the result of addition doesn't overflow MAX_INTN @@ -311,11 +311,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeIntnAdd) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUintnSub) { +TEST (AdditionSubtractionTestSuite, TestSafeUintnSub) { RETURN_STATUS Status; - UINTN Minuend; - UINTN Subtrahend; - UINTN Result; + UINTN Minuend; + UINTN Subtrahend; + UINTN Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -336,11 +336,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUintnSub) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeIntnSub) { +TEST (AdditionSubtractionTestSuite, TestSafeIntnSub) { RETURN_STATUS Status; - INTN Minuend; - INTN Subtrahend; - INTN Result; + INTN Minuend; + INTN Subtrahend; + INTN Result; =20 // // If the result of subtractions doesn't overflow MAX_INTN or @@ -373,11 +373,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeIntnSub) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeUintnMult) { +TEST (MultiplicationTestSuite, TestSafeUintnMult) { RETURN_STATUS Status; - UINTN Multiplicand; - UINTN Multiplier; - UINTN Result; + UINTN Multiplicand; + UINTN Multiplier; + UINTN Result; =20 // // If the result of multiplication doesn't overflow MAX_UINTN, it will s= ucceed @@ -398,11 +398,11 @@ TEST(MultiplicationTestSuite, TestSafeUintnMult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeIntnMult) { +TEST (MultiplicationTestSuite, TestSafeIntnMult) { RETURN_STATUS Status; - INTN Multiplicand; - INTN Multiplier; - INTN Result; + INTN Multiplicand; + INTN Multiplier; + INTN Result; =20 // // If the result of multiplication doesn't overflow MAX_INTN and doesn't diff --git a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnI= ntnUnitTests64.cpp b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntL= ibUintnIntnUnitTests64.cpp index 6fb0710cfed6..6efdd3be7c5e 100644 --- a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnit= Tests64.cpp +++ b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/SafeIntLibUintnIntnUnit= Tests64.cpp @@ -14,10 +14,10 @@ extern "C" { #include } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUintn) { +TEST (ConversionTestSuite, TestSafeInt32ToUintn) { RETURN_STATUS Status; - INT32 Operand; - UINTN Result; + INT32 Operand; + UINTN Result; =20 // // If Operand is non-negative, then it's a cast @@ -36,10 +36,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToIntn) { +TEST (ConversionTestSuite, TestSafeUint32ToIntn) { RETURN_STATUS Status; - UINT32 Operand; - INTN Result; + UINT32 Operand; + INTN Result; =20 // // For x64, INTN is same as INT64 which is a superset of INT32 @@ -56,10 +56,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToIntn) { ASSERT_EQ (0xabababab, Result); } =20 -TEST(ConversionTestSuite, TestSafeIntnToInt32) { +TEST (ConversionTestSuite, TestSafeIntnToInt32) { RETURN_STATUS Status; - INTN Operand; - INT32 Result; + INTN Operand; + INT32 Result; =20 // // If Operand is between MIN_INT32 and MAX_INT32 inclusive, then it's a= cast @@ -87,10 +87,10 @@ TEST(ConversionTestSuite, TestSafeIntnToInt32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUint32) { +TEST (ConversionTestSuite, TestSafeIntnToUint32) { RETURN_STATUS Status; - INTN Operand; - UINT32 Result; + INTN Operand; + UINT32 Result; =20 // // If Operand is between 0 and MAX_UINT32 inclusive, then it's a cast @@ -113,10 +113,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToUint32) { +TEST (ConversionTestSuite, TestSafeUintnToUint32) { RETURN_STATUS Status; - UINTN Operand; - UINT32 Result; + UINTN Operand; + UINT32 Result; =20 // // If Operand is <=3D MAX_UINT32, then it's a cast @@ -135,10 +135,10 @@ TEST(ConversionTestSuite, TestSafeUintnToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToIntn) { +TEST (ConversionTestSuite, TestSafeUintnToIntn) { RETURN_STATUS Status; - UINTN Operand; - INTN Result; + UINTN Operand; + INTN Result; =20 // // If Operand is <=3D MAX_INTN (0x7fff_ffff_ffff_ffff), then it's a cast @@ -157,10 +157,10 @@ TEST(ConversionTestSuite, TestSafeUintnToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToInt64) { +TEST (ConversionTestSuite, TestSafeUintnToInt64) { RETURN_STATUS Status; - UINTN Operand; - INT64 Result; + UINTN Operand; + INT64 Result; =20 // // If Operand is <=3D MAX_INT64, then it's a cast @@ -179,10 +179,10 @@ TEST(ConversionTestSuite, TestSafeUintnToInt64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToIntn) { +TEST (ConversionTestSuite, TestSafeInt64ToIntn) { RETURN_STATUS Status; - INT64 Operand; - INTN Result; + INT64 Operand; + INTN Result; =20 // // INTN is same as INT64 in x64, so this is just a cast @@ -194,10 +194,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToIntn) { ASSERT_EQ (0x5babababefefefef, Result); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUintn) { +TEST (ConversionTestSuite, TestSafeInt64ToUintn) { RETURN_STATUS Status; - INT64 Operand; - UINTN Result; + INT64 Operand; + UINTN Result; =20 // // If Operand is non-negative, then it's a cast @@ -216,10 +216,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToIntn) { +TEST (ConversionTestSuite, TestSafeUint64ToIntn) { RETURN_STATUS Status; - UINT64 Operand; - INTN Result; + UINT64 Operand; + INTN Result; =20 // // If Operand is <=3D MAX_INTN (0x7fff_ffff_ffff_ffff), then it's a cast @@ -238,10 +238,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToIntn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToUintn) { +TEST (ConversionTestSuite, TestSafeUint64ToUintn) { RETURN_STATUS Status; - UINT64 Operand; - UINTN Result; + UINT64 Operand; + UINTN Result; =20 // // UINTN is same as UINT64 in x64, so this is just a cast @@ -253,11 +253,11 @@ TEST(ConversionTestSuite, TestSafeUint64ToUintn) { ASSERT_EQ (0xababababefefefef, Result); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUintnAdd) { +TEST (AdditionSubtractionTestSuite, TestSafeUintnAdd) { RETURN_STATUS Status; - UINTN Augend; - UINTN Addend; - UINTN Result; + UINTN Augend; + UINTN Addend; + UINTN Result; =20 // // If the result of addition doesn't overflow MAX_UINTN, then it's addit= ion @@ -278,11 +278,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUintnAdd) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeIntnAdd) { +TEST (AdditionSubtractionTestSuite, TestSafeIntnAdd) { RETURN_STATUS Status; - INTN Augend; - INTN Addend; - INTN Result; + INTN Augend; + INTN Addend; + INTN Result; =20 // // If the result of addition doesn't overflow MAX_INTN @@ -315,11 +315,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeIntnAdd) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUintnSub) { +TEST (AdditionSubtractionTestSuite, TestSafeUintnSub) { RETURN_STATUS Status; - UINTN Minuend; - UINTN Subtrahend; - UINTN Result; + UINTN Minuend; + UINTN Subtrahend; + UINTN Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -340,11 +340,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUintnSub) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeIntnSub) { +TEST (AdditionSubtractionTestSuite, TestSafeIntnSub) { RETURN_STATUS Status; - INTN Minuend; - INTN Subtrahend; - INTN Result; + INTN Minuend; + INTN Subtrahend; + INTN Result; =20 // // If the result of subtractions doesn't overflow MAX_INTN or @@ -377,11 +377,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeIntnSub) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeUintnMult) { +TEST (MultiplicationTestSuite, TestSafeUintnMult) { RETURN_STATUS Status; - UINTN Multiplicand; - UINTN Multiplier; - UINTN Result; + UINTN Multiplicand; + UINTN Multiplier; + UINTN Result; =20 // // If the result of multiplication doesn't overflow MAX_UINTN, it will s= ucceed @@ -402,11 +402,11 @@ TEST(MultiplicationTestSuite, TestSafeUintnMult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeIntnMult) { +TEST (MultiplicationTestSuite, TestSafeIntnMult) { RETURN_STATUS Status; - INTN Multiplicand; - INTN Multiplier; - INTN Result; + INTN Multiplicand; + INTN Multiplier; + INTN Result; =20 // // If the result of multiplication doesn't overflow MAX_INTN and doesn't diff --git a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntL= ib.cpp b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c= pp index 1fd51067a1f3..857ab4d1d36c 100644 --- a/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.cpp +++ b/MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.cpp @@ -15,10 +15,10 @@ extern "C" { // // Conversion function tests: // -TEST(ConversionTestSuite, TestSafeInt8ToUint8) { +TEST (ConversionTestSuite, TestSafeInt8ToUint8) { RETURN_STATUS Status; - INT8 Operand; - UINT8 Result; + INT8 Operand; + UINT8 Result; =20 // // Positive UINT8 should result in just a cast @@ -37,10 +37,10 @@ TEST(ConversionTestSuite, TestSafeInt8ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt8ToUint16) { +TEST (ConversionTestSuite, TestSafeInt8ToUint16) { RETURN_STATUS Status; - INT8 Operand; - UINT16 Result; + INT8 Operand; + UINT16 Result; =20 // // Positive UINT8 should result in just a cast @@ -59,10 +59,10 @@ TEST(ConversionTestSuite, TestSafeInt8ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt8ToUint32) { +TEST (ConversionTestSuite, TestSafeInt8ToUint32) { RETURN_STATUS Status; - INT8 Operand; - UINT32 Result; + INT8 Operand; + UINT32 Result; =20 // // Positive UINT8 should result in just a cast @@ -81,10 +81,10 @@ TEST(ConversionTestSuite, TestSafeInt8ToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt8ToUintn) { +TEST (ConversionTestSuite, TestSafeInt8ToUintn) { RETURN_STATUS Status; - INT8 Operand; - UINTN Result; + INT8 Operand; + UINTN Result; =20 // // Positive UINT8 should result in just a cast @@ -103,10 +103,10 @@ TEST(ConversionTestSuite, TestSafeInt8ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt8ToUint64) { +TEST (ConversionTestSuite, TestSafeInt8ToUint64) { RETURN_STATUS Status; - INT8 Operand; - UINT64 Result; + INT8 Operand; + UINT64 Result; =20 // // Positive UINT8 should result in just a cast @@ -125,10 +125,10 @@ TEST(ConversionTestSuite, TestSafeInt8ToUint64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint8ToInt8) { +TEST (ConversionTestSuite, TestSafeUint8ToInt8) { RETURN_STATUS Status; - UINT8 Operand; - INT8 Result; + UINT8 Operand; + INT8 Result; =20 // // Operand <=3D 0x7F (MAX_INT8) should result in a cast @@ -147,10 +147,10 @@ TEST(ConversionTestSuite, TestSafeUint8ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint8ToChar8) { +TEST (ConversionTestSuite, TestSafeUint8ToChar8) { RETURN_STATUS Status; - UINT8 Operand; - CHAR8 Result; + UINT8 Operand; + CHAR8 Result; =20 // // CHAR8 is typedefed as char, which by default is signed, thus @@ -174,10 +174,10 @@ TEST(ConversionTestSuite, TestSafeUint8ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToInt8) { +TEST (ConversionTestSuite, TestSafeInt16ToInt8) { RETURN_STATUS Status; - INT16 Operand; - INT8 Result; + INT16 Operand; + INT8 Result; =20 // // If Operand is between MIN_INT8 and MAX_INT8 inclusive, then it's a ca= st @@ -205,10 +205,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToChar8) { +TEST (ConversionTestSuite, TestSafeInt16ToChar8) { RETURN_STATUS Status; - INT16 Operand; - CHAR8 Result; + INT16 Operand; + CHAR8 Result; =20 // // CHAR8 is typedefed as char, which may be signed or unsigned based @@ -252,10 +252,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToUint8) { +TEST (ConversionTestSuite, TestSafeInt16ToUint8) { RETURN_STATUS Status; - INT16 Operand; - UINT8 Result; + INT16 Operand; + UINT8 Result; =20 // // If Operand is between 0 and MAX_INT8 inclusive, then it's a cast @@ -278,10 +278,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToUint16) { +TEST (ConversionTestSuite, TestSafeInt16ToUint16) { RETURN_STATUS Status; - INT16 Operand =3D 0x5b5b; - UINT16 Result =3D 0; + INT16 Operand =3D 0x5b5b; + UINT16 Result =3D 0; =20 // // If Operand is non-negative, then it's a cast @@ -298,10 +298,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToUint32) { +TEST (ConversionTestSuite, TestSafeInt16ToUint32) { RETURN_STATUS Status; - INT16 Operand; - UINT32 Result; + INT16 Operand; + UINT32 Result; =20 // // If Operand is non-negative, then it's a cast @@ -320,10 +320,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToUintn) { +TEST (ConversionTestSuite, TestSafeInt16ToUintn) { RETURN_STATUS Status; - INT16 Operand; - UINTN Result; + INT16 Operand; + UINTN Result; =20 // // If Operand is non-negative, then it's a cast @@ -342,10 +342,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt16ToUint64) { +TEST (ConversionTestSuite, TestSafeInt16ToUint64) { RETURN_STATUS Status; - INT16 Operand; - UINT64 Result; + INT16 Operand; + UINT64 Result; =20 // // If Operand is non-negative, then it's a cast @@ -364,10 +364,10 @@ TEST(ConversionTestSuite, TestSafeInt16ToUint64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint16ToInt8) { +TEST (ConversionTestSuite, TestSafeUint16ToInt8) { RETURN_STATUS Status; - UINT16 Operand; - INT8 Result; + UINT16 Operand; + INT8 Result; =20 // // If Operand is <=3D MAX_INT8, it's a cast @@ -386,10 +386,10 @@ TEST(ConversionTestSuite, TestSafeUint16ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint16ToChar8) { +TEST (ConversionTestSuite, TestSafeUint16ToChar8) { RETURN_STATUS Status; - UINT16 Operand; - CHAR8 Result; + UINT16 Operand; + CHAR8 Result; =20 // CHAR8 is typedefed as char, which by default is signed, thus // CHAR8 is same as INT8, so same tests as above: @@ -411,10 +411,10 @@ TEST(ConversionTestSuite, TestSafeUint16ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint16ToUint8) { +TEST (ConversionTestSuite, TestSafeUint16ToUint8) { RETURN_STATUS Status; - UINT16 Operand; - UINT8 Result; + UINT16 Operand; + UINT8 Result; =20 // // If Operand is <=3D MAX_UINT8 (0xff), it's a cast @@ -433,10 +433,10 @@ TEST(ConversionTestSuite, TestSafeUint16ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint16ToInt16) { +TEST (ConversionTestSuite, TestSafeUint16ToInt16) { RETURN_STATUS Status; - UINT16 Operand; - INT16 Result; + UINT16 Operand; + INT16 Result; =20 // // If Operand is <=3D MAX_INT16 (0x7fff), it's a cast @@ -455,10 +455,10 @@ TEST(ConversionTestSuite, TestSafeUint16ToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToInt8) { +TEST (ConversionTestSuite, TestSafeInt32ToInt8) { RETURN_STATUS Status; - INT32 Operand; - INT8 Result; + INT32 Operand; + INT8 Result; =20 // // If Operand is between MIN_INT8 and MAX_INT8 inclusive, then it's a ca= st @@ -486,10 +486,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToChar8) { +TEST (ConversionTestSuite, TestSafeInt32ToChar8) { RETURN_STATUS Status; - INT32 Operand; - CHAR8 Result; + INT32 Operand; + CHAR8 Result; =20 // // CHAR8 is typedefed as char, which may be signed or unsigned based @@ -533,10 +533,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUint8) { +TEST (ConversionTestSuite, TestSafeInt32ToUint8) { RETURN_STATUS Status; - INT32 Operand; - UINT8 Result; + INT32 Operand; + UINT8 Result; =20 // // If Operand is between 0 and MAX_INT8 inclusive, then it's a cast @@ -563,10 +563,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToInt16) { +TEST (ConversionTestSuite, TestSafeInt32ToInt16) { RETURN_STATUS Status; - INT32 Operand; - INT16 Result; + INT32 Operand; + INT16 Result; =20 // // If Operand is between MIN_INT16 and MAX_INT16 inclusive, then it's a = cast @@ -594,10 +594,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUint16) { +TEST (ConversionTestSuite, TestSafeInt32ToUint16) { RETURN_STATUS Status; - INT32 Operand; - UINT16 Result; + INT32 Operand; + UINT16 Result; =20 // // If Operand is between 0 and MAX_UINT16 inclusive, then it's a cast @@ -624,10 +624,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUint32) { +TEST (ConversionTestSuite, TestSafeInt32ToUint32) { RETURN_STATUS Status; - INT32 Operand; - UINT32 Result; + INT32 Operand; + UINT32 Result; =20 // // If Operand is non-negative, then it's a cast @@ -646,10 +646,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt32ToUint64) { +TEST (ConversionTestSuite, TestSafeInt32ToUint64) { RETURN_STATUS Status; - INT32 Operand; - UINT64 Result; + INT32 Operand; + UINT64 Result; =20 // // If Operand is non-negative, then it's a cast @@ -668,10 +668,10 @@ TEST(ConversionTestSuite, TestSafeInt32ToUint64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToInt8) { +TEST (ConversionTestSuite, TestSafeUint32ToInt8) { RETURN_STATUS Status; - UINT32 Operand; - INT8 Result; + UINT32 Operand; + INT8 Result; =20 // // If Operand is <=3D MAX_INT8, then it's a cast @@ -690,10 +690,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToChar8) { +TEST (ConversionTestSuite, TestSafeUint32ToChar8) { RETURN_STATUS Status; - UINT32 Operand; - CHAR8 Result; + UINT32 Operand; + CHAR8 Result; =20 // CHAR8 is typedefed as char, which by default is signed, thus // CHAR8 is same as INT8, so same tests as above: @@ -715,10 +715,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToUint8) { +TEST (ConversionTestSuite, TestSafeUint32ToUint8) { RETURN_STATUS Status; - UINT32 Operand; - UINT8 Result; + UINT32 Operand; + UINT8 Result; =20 // // If Operand is <=3D MAX_UINT8, then it's a cast @@ -737,10 +737,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToInt16) { +TEST (ConversionTestSuite, TestSafeUint32ToInt16) { RETURN_STATUS Status; - UINT32 Operand; - INT16 Result; + UINT32 Operand; + INT16 Result; =20 // // If Operand is <=3D MAX_INT16, then it's a cast @@ -759,10 +759,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToUint16) { +TEST (ConversionTestSuite, TestSafeUint32ToUint16) { RETURN_STATUS Status; - UINT32 Operand; - UINT16 Result; + UINT32 Operand; + UINT16 Result; =20 // // If Operand is <=3D MAX_UINT16, then it's a cast @@ -781,10 +781,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint32ToInt32) { +TEST (ConversionTestSuite, TestSafeUint32ToInt32) { RETURN_STATUS Status; - UINT32 Operand; - INT32 Result; + UINT32 Operand; + INT32 Result; =20 // // If Operand is <=3D MAX_INT32, then it's a cast @@ -803,10 +803,10 @@ TEST(ConversionTestSuite, TestSafeUint32ToInt32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToInt8) { +TEST (ConversionTestSuite, TestSafeIntnToInt8) { RETURN_STATUS Status; - INTN Operand; - INT8 Result; + INTN Operand; + INT8 Result; =20 // // If Operand is between MIN_INT8 and MAX_INT8 inclusive, then it's a ca= st @@ -834,10 +834,10 @@ TEST(ConversionTestSuite, TestSafeIntnToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToChar8) { +TEST (ConversionTestSuite, TestSafeIntnToChar8) { RETURN_STATUS Status; - INTN Operand; - CHAR8 Result; + INTN Operand; + CHAR8 Result; =20 // // CHAR8 is typedefed as char, which may be signed or unsigned based @@ -881,10 +881,10 @@ TEST(ConversionTestSuite, TestSafeIntnToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUint8) { +TEST (ConversionTestSuite, TestSafeIntnToUint8) { RETURN_STATUS Status; - INTN Operand; - UINT8 Result; + INTN Operand; + UINT8 Result; =20 // // If Operand is between 0 and MAX_UINT8 inclusive, then it's a cast @@ -907,10 +907,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToInt16) { +TEST (ConversionTestSuite, TestSafeIntnToInt16) { RETURN_STATUS Status; - INTN Operand; - INT16 Result; + INTN Operand; + INT16 Result; =20 // // If Operand is between MIN_INT16 and MAX_INT16 inclusive, then it's a = cast @@ -938,10 +938,10 @@ TEST(ConversionTestSuite, TestSafeIntnToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUint16) { +TEST (ConversionTestSuite, TestSafeIntnToUint16) { RETURN_STATUS Status; - INTN Operand; - UINT16 Result; + INTN Operand; + UINT16 Result; =20 // // If Operand is between 0 and MAX_UINT16 inclusive, then it's a cast @@ -964,10 +964,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUintn) { +TEST (ConversionTestSuite, TestSafeIntnToUintn) { RETURN_STATUS Status; - INTN Operand; - UINTN Result; + INTN Operand; + UINTN Result; =20 // // If Operand is non-negative, then it's a cast @@ -986,10 +986,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUintn) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeIntnToUint64) { +TEST (ConversionTestSuite, TestSafeIntnToUint64) { RETURN_STATUS Status; - INTN Operand; - UINT64 Result; + INTN Operand; + UINT64 Result; =20 // // If Operand is non-negative, then it's a cast @@ -1008,10 +1008,10 @@ TEST(ConversionTestSuite, TestSafeIntnToUint64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToInt8) { +TEST (ConversionTestSuite, TestSafeUintnToInt8) { RETURN_STATUS Status; - UINTN Operand; - INT8 Result; + UINTN Operand; + INT8 Result; =20 // // If Operand is <=3D MAX_INT8, then it's a cast @@ -1030,10 +1030,10 @@ TEST(ConversionTestSuite, TestSafeUintnToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToChar8) { +TEST (ConversionTestSuite, TestSafeUintnToChar8) { RETURN_STATUS Status; - UINTN Operand; - CHAR8 Result; + UINTN Operand; + CHAR8 Result; =20 // CHAR8 is typedefed as char, which by default is signed, thus // CHAR8 is same as INT8, so same tests as above: @@ -1055,10 +1055,10 @@ TEST(ConversionTestSuite, TestSafeUintnToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToUint8) { +TEST (ConversionTestSuite, TestSafeUintnToUint8) { RETURN_STATUS Status; - UINTN Operand; - UINT8 Result; + UINTN Operand; + UINT8 Result; =20 // // If Operand is <=3D MAX_UINT8, then it's a cast @@ -1077,10 +1077,10 @@ TEST(ConversionTestSuite, TestSafeUintnToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToInt16) { +TEST (ConversionTestSuite, TestSafeUintnToInt16) { RETURN_STATUS Status; - UINTN Operand; - INT16 Result; + UINTN Operand; + INT16 Result; =20 // // If Operand is <=3D MAX_INT16, then it's a cast @@ -1099,10 +1099,10 @@ TEST(ConversionTestSuite, TestSafeUintnToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToUint16) { +TEST (ConversionTestSuite, TestSafeUintnToUint16) { RETURN_STATUS Status; - UINTN Operand; - UINT16 Result; + UINTN Operand; + UINT16 Result; =20 // // If Operand is <=3D MAX_UINT16, then it's a cast @@ -1121,10 +1121,10 @@ TEST(ConversionTestSuite, TestSafeUintnToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUintnToInt32) { +TEST (ConversionTestSuite, TestSafeUintnToInt32) { RETURN_STATUS Status; - UINTN Operand; - INT32 Result; + UINTN Operand; + INT32 Result; =20 // // If Operand is <=3D MAX_INT32, then it's a cast @@ -1143,10 +1143,10 @@ TEST(ConversionTestSuite, TestSafeUintnToInt32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToInt8) { +TEST (ConversionTestSuite, TestSafeInt64ToInt8) { RETURN_STATUS Status; - INT64 Operand; - INT8 Result; + INT64 Operand; + INT8 Result; =20 // // If Operand is between MIN_INT8 and MAX_INT8 inclusive, then it's a c= ast @@ -1174,10 +1174,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToChar8) { +TEST (ConversionTestSuite, TestSafeInt64ToChar8) { RETURN_STATUS Status; - INT64 Operand; - CHAR8 Result; + INT64 Operand; + CHAR8 Result; =20 // // CHAR8 is typedefed as char, which may be signed or unsigned based @@ -1221,10 +1221,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUint8) { +TEST (ConversionTestSuite, TestSafeInt64ToUint8) { RETURN_STATUS Status; - INT64 Operand; - UINT8 Result; + INT64 Operand; + UINT8 Result; =20 // // If Operand is between 0 and MAX_UINT8 inclusive, then it's a cast @@ -1247,10 +1247,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToInt16) { +TEST (ConversionTestSuite, TestSafeInt64ToInt16) { RETURN_STATUS Status; - INT64 Operand; - INT16 Result; + INT64 Operand; + INT16 Result; =20 // // If Operand is between MIN_INT16 and MAX_INT16 inclusive, then it's a= cast @@ -1278,10 +1278,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUint16) { +TEST (ConversionTestSuite, TestSafeInt64ToUint16) { RETURN_STATUS Status; - INT64 Operand; - UINT16 Result; + INT64 Operand; + UINT16 Result; =20 // // If Operand is between 0 and MAX_UINT16 inclusive, then it's a cast @@ -1304,10 +1304,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToInt32) { +TEST (ConversionTestSuite, TestSafeInt64ToInt32) { RETURN_STATUS Status; - INT64 Operand; - INT32 Result; + INT64 Operand; + INT32 Result; =20 // // If Operand is between MIN_INT32 and MAX_INT32 inclusive, then it's a= cast @@ -1335,10 +1335,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToInt32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUint32) { +TEST (ConversionTestSuite, TestSafeInt64ToUint32) { RETURN_STATUS Status; - INT64 Operand; - UINT32 Result; + INT64 Operand; + UINT32 Result; =20 // // If Operand is between 0 and MAX_UINT32 inclusive, then it's a cast @@ -1361,10 +1361,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeInt64ToUint64) { +TEST (ConversionTestSuite, TestSafeInt64ToUint64) { RETURN_STATUS Status; - INT64 Operand; - UINT64 Result; + INT64 Operand; + UINT64 Result; =20 // // If Operand is non-negative, then it's a cast @@ -1383,10 +1383,10 @@ TEST(ConversionTestSuite, TestSafeInt64ToUint64) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToInt8) { +TEST (ConversionTestSuite, TestSafeUint64ToInt8) { RETURN_STATUS Status; - UINT64 Operand; - INT8 Result; + UINT64 Operand; + INT8 Result; =20 // // If Operand is <=3D MAX_INT8, then it's a cast @@ -1405,10 +1405,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToInt8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToChar8) { +TEST (ConversionTestSuite, TestSafeUint64ToChar8) { RETURN_STATUS Status; - UINT64 Operand; - CHAR8 Result; + UINT64 Operand; + CHAR8 Result; =20 // CHAR8 is typedefed as char, which by default is signed, thus // CHAR8 is same as INT8, so same tests as above: @@ -1430,10 +1430,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToChar8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToUint8) { +TEST (ConversionTestSuite, TestSafeUint64ToUint8) { RETURN_STATUS Status; - UINT64 Operand; - UINT8 Result; + UINT64 Operand; + UINT8 Result; =20 // // If Operand is <=3D MAX_UINT8, then it's a cast @@ -1452,10 +1452,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToUint8) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToInt16) { +TEST (ConversionTestSuite, TestSafeUint64ToInt16) { RETURN_STATUS Status; - UINT64 Operand; - INT16 Result; + UINT64 Operand; + INT16 Result; =20 // // If Operand is <=3D MAX_INT16, then it's a cast @@ -1474,10 +1474,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToInt16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToUint16) { +TEST (ConversionTestSuite, TestSafeUint64ToUint16) { RETURN_STATUS Status; - UINT64 Operand; - UINT16 Result; + UINT64 Operand; + UINT16 Result; =20 // // If Operand is <=3D MAX_UINT16, then it's a cast @@ -1496,10 +1496,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToUint16) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToInt32) { +TEST (ConversionTestSuite, TestSafeUint64ToInt32) { RETURN_STATUS Status; - UINT64 Operand; - INT32 Result; + UINT64 Operand; + INT32 Result; =20 // // If Operand is <=3D MAX_INT32, then it's a cast @@ -1518,10 +1518,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToInt32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToUint32) { +TEST (ConversionTestSuite, TestSafeUint64ToUint32) { RETURN_STATUS Status; - UINT64 Operand; - UINT32 Result; + UINT64 Operand; + UINT32 Result; =20 // // If Operand is <=3D MAX_UINT32, then it's a cast @@ -1540,10 +1540,10 @@ TEST(ConversionTestSuite, TestSafeUint64ToUint32) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(ConversionTestSuite, TestSafeUint64ToInt64) { +TEST (ConversionTestSuite, TestSafeUint64ToInt64) { RETURN_STATUS Status; - UINT64 Operand; - INT64 Result; + UINT64 Operand; + INT64 Result; =20 // // If Operand is <=3D MAX_INT64, then it's a cast @@ -1565,11 +1565,11 @@ TEST(ConversionTestSuite, TestSafeUint64ToInt64) { // // Addition function tests: // -TEST(AdditionSubtractionTestSuite, TestSafeUint8Add) { +TEST (AdditionSubtractionTestSuite, TestSafeUint8Add) { RETURN_STATUS Status; - UINT8 Augend; - UINT8 Addend; - UINT8 Result; + UINT8 Augend; + UINT8 Addend; + UINT8 Result; =20 // // If the result of addition doesn't overflow MAX_UINT8, then it's addit= ion @@ -1590,11 +1590,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint8Add= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint16Add) { +TEST (AdditionSubtractionTestSuite, TestSafeUint16Add) { RETURN_STATUS Status; - UINT16 Augend =3D 0x3a3a; - UINT16 Addend =3D 0x3a3a; - UINT16 Result =3D 0; + UINT16 Augend =3D 0x3a3a; + UINT16 Addend =3D 0x3a3a; + UINT16 Result =3D 0; =20 // // If the result of addition doesn't overflow MAX_UINT16, then it's addi= tion @@ -1612,11 +1612,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint16Ad= d) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint32Add) { +TEST (AdditionSubtractionTestSuite, TestSafeUint32Add) { RETURN_STATUS Status; - UINT32 Augend; - UINT32 Addend; - UINT32 Result; + UINT32 Augend; + UINT32 Addend; + UINT32 Result; =20 // // If the result of addition doesn't overflow MAX_UINT32, then it's addi= tion @@ -1637,11 +1637,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint32Ad= d) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint64Add) { +TEST (AdditionSubtractionTestSuite, TestSafeUint64Add) { RETURN_STATUS Status; - UINT64 Augend; - UINT64 Addend; - UINT64 Result; + UINT64 Augend; + UINT64 Addend; + UINT64 Result; =20 // // If the result of addition doesn't overflow MAX_UINT64, then it's addi= tion @@ -1662,11 +1662,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint64Ad= d) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt8Add) { +TEST (AdditionSubtractionTestSuite, TestSafeInt8Add) { RETURN_STATUS Status; - INT8 Augend; - INT8 Addend; - INT8 Result; + INT8 Augend; + INT8 Addend; + INT8 Result; =20 // // If the result of addition doesn't overflow MAX_INT8 @@ -1699,11 +1699,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt8Add)= { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt16Add) { +TEST (AdditionSubtractionTestSuite, TestSafeInt16Add) { RETURN_STATUS Status; - INT16 Augend; - INT16 Addend; - INT16 Result; + INT16 Augend; + INT16 Addend; + INT16 Result; =20 // // If the result of addition doesn't overflow MAX_INT16 @@ -1736,11 +1736,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt16Add= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt32Add) { +TEST (AdditionSubtractionTestSuite, TestSafeInt32Add) { RETURN_STATUS Status; - INT32 Augend; - INT32 Addend; - INT32 Result; + INT32 Augend; + INT32 Addend; + INT32 Result; =20 // // If the result of addition doesn't overflow MAX_INT32 @@ -1773,11 +1773,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt32Add= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt64Add) { +TEST (AdditionSubtractionTestSuite, TestSafeInt64Add) { RETURN_STATUS Status; - INT64 Augend; - INT64 Addend; - INT64 Result; + INT64 Augend; + INT64 Addend; + INT64 Result; =20 // // If the result of addition doesn't overflow MAX_INT64 @@ -1813,11 +1813,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt64Add= ) { // // Subtraction function tests: // -TEST(AdditionSubtractionTestSuite, TestSafeUint8Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeUint8Sub) { RETURN_STATUS Status; - UINT8 Minuend; - UINT8 Subtrahend; - UINT8 Result; + UINT8 Minuend; + UINT8 Subtrahend; + UINT8 Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -1838,11 +1838,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint8Sub= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint16Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeUint16Sub) { RETURN_STATUS Status; - UINT16 Minuend; - UINT16 Subtrahend; - UINT16 Result; + UINT16 Minuend; + UINT16 Subtrahend; + UINT16 Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -1863,11 +1863,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint16Su= b) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint32Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeUint32Sub) { RETURN_STATUS Status; - UINT32 Minuend; - UINT32 Subtrahend; - UINT32 Result; + UINT32 Minuend; + UINT32 Subtrahend; + UINT32 Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -1888,11 +1888,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint32Su= b) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeUint64Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeUint64Sub) { RETURN_STATUS Status; - UINT64 Minuend; - UINT64 Subtrahend; - UINT64 Result; + UINT64 Minuend; + UINT64 Subtrahend; + UINT64 Result; =20 // // If Minuend >=3D Subtrahend, then it's subtraction @@ -1913,11 +1913,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeUint64Su= b) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt8Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeInt8Sub) { RETURN_STATUS Status; - INT8 Minuend; - INT8 Subtrahend; - INT8 Result; + INT8 Minuend; + INT8 Subtrahend; + INT8 Result; =20 // // If the result of subtractions doesn't overflow MAX_INT8 or @@ -1950,11 +1950,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt8Sub)= { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt16Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeInt16Sub) { RETURN_STATUS Status; - INT16 Minuend; - INT16 Subtrahend; - INT16 Result; + INT16 Minuend; + INT16 Subtrahend; + INT16 Result; =20 // // If the result of subtractions doesn't overflow MAX_INT16 or @@ -1987,11 +1987,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt16Sub= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt32Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeInt32Sub) { RETURN_STATUS Status; - INT32 Minuend; - INT32 Subtrahend; - INT32 Result; + INT32 Minuend; + INT32 Subtrahend; + INT32 Result; =20 // // If the result of subtractions doesn't overflow MAX_INT32 or @@ -2024,11 +2024,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt32Sub= ) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(AdditionSubtractionTestSuite, TestSafeInt64Sub) { +TEST (AdditionSubtractionTestSuite, TestSafeInt64Sub) { RETURN_STATUS Status; - INT64 Minuend; - INT64 Subtrahend; - INT64 Result; + INT64 Minuend; + INT64 Subtrahend; + INT64 Result; =20 // // If the result of subtractions doesn't overflow MAX_INT64 or @@ -2064,11 +2064,11 @@ TEST(AdditionSubtractionTestSuite, TestSafeInt64Sub= ) { // // Multiplication function tests: // -TEST(MultiplicationTestSuite, TestSafeUint8Mult) { +TEST (MultiplicationTestSuite, TestSafeUint8Mult) { RETURN_STATUS Status; - UINT8 Multiplicand; - UINT8 Multiplier; - UINT8 Result; + UINT8 Multiplicand; + UINT8 Multiplier; + UINT8 Result; =20 // // If the result of multiplication doesn't overflow MAX_UINT8, it will s= ucceed @@ -2089,11 +2089,11 @@ TEST(MultiplicationTestSuite, TestSafeUint8Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeUint16Mult) { +TEST (MultiplicationTestSuite, TestSafeUint16Mult) { RETURN_STATUS Status; - UINT16 Multiplicand; - UINT16 Multiplier; - UINT16 Result; + UINT16 Multiplicand; + UINT16 Multiplier; + UINT16 Result; =20 // // If the result of multiplication doesn't overflow MAX_UINT16, it will = succeed @@ -2114,11 +2114,11 @@ TEST(MultiplicationTestSuite, TestSafeUint16Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeUint32Mult) { +TEST (MultiplicationTestSuite, TestSafeUint32Mult) { RETURN_STATUS Status; - UINT32 Multiplicand; - UINT32 Multiplier; - UINT32 Result; + UINT32 Multiplicand; + UINT32 Multiplier; + UINT32 Result; =20 // // If the result of multiplication doesn't overflow MAX_UINT32, it will = succeed @@ -2139,11 +2139,11 @@ TEST(MultiplicationTestSuite, TestSafeUint32Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeUint64Mult) { +TEST (MultiplicationTestSuite, TestSafeUint64Mult) { RETURN_STATUS Status; - UINT64 Multiplicand; - UINT64 Multiplier; - UINT64 Result; + UINT64 Multiplicand; + UINT64 Multiplier; + UINT64 Result; =20 // // If the result of multiplication doesn't overflow MAX_UINT64, it will = succeed @@ -2164,11 +2164,11 @@ TEST(MultiplicationTestSuite, TestSafeUint64Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeInt8Mult) { +TEST (MultiplicationTestSuite, TestSafeInt8Mult) { RETURN_STATUS Status; - INT8 Multiplicand; - INT8 Multiplier; - INT8 Result; + INT8 Multiplicand; + INT8 Multiplier; + INT8 Result; =20 // // If the result of multiplication doesn't overflow MAX_INT8 and doesn't @@ -2190,11 +2190,11 @@ TEST(MultiplicationTestSuite, TestSafeInt8Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeInt16Mult) { +TEST (MultiplicationTestSuite, TestSafeInt16Mult) { RETURN_STATUS Status; - INT16 Multiplicand; - INT16 Multiplier; - INT16 Result; + INT16 Multiplicand; + INT16 Multiplier; + INT16 Result; =20 // // If the result of multiplication doesn't overflow MAX_INT16 and doesn't @@ -2216,11 +2216,11 @@ TEST(MultiplicationTestSuite, TestSafeInt16Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeInt32Mult) { +TEST (MultiplicationTestSuite, TestSafeInt32Mult) { RETURN_STATUS Status; - INT32 Multiplicand; - INT32 Multiplier; - INT32 Result; + INT32 Multiplicand; + INT32 Multiplier; + INT32 Result; =20 // // If the result of multiplication doesn't overflow MAX_INT32 and doesn't @@ -2242,11 +2242,11 @@ TEST(MultiplicationTestSuite, TestSafeInt32Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =20 -TEST(MultiplicationTestSuite, TestSafeInt64Mult) { +TEST (MultiplicationTestSuite, TestSafeInt64Mult) { RETURN_STATUS Status; - INT64 Multiplicand; - INT64 Multiplier; - INT64 Result; + INT64 Multiplicand; + INT64 Multiplier; + INT64 Result; =20 // // If the result of multiplication doesn't overflow MAX_INT64 and doesn't @@ -2268,7 +2268,12 @@ TEST(MultiplicationTestSuite, TestSafeInt64Mult) { ASSERT_EQ (RETURN_BUFFER_TOO_SMALL, Status); } =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 (); } diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h b/Mde= Pkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h index 994b8133e5d0..586b479ea5d2 100644 --- a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h +++ b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockHobLib.h @@ -11,9 +11,9 @@ #include #include extern "C" { -#include -#include -#include + #include + #include + #include } =20 struct MockHobLib { diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib= .h b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib.h index 4a99fec539c0..6a6424d7c6fc 100644 --- a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib.h +++ b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockPeiServicesLib.h @@ -11,9 +11,9 @@ #include #include extern "C" { -#include -#include -#include + #include + #include + #include } =20 struct MockPeiServicesLib { diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h b/Md= ePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h index dec2c93e1b34..93697da9cf86 100644 --- a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h +++ b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiLib.h @@ -11,8 +11,8 @@ #include #include extern "C" { -#include -#include + #include + #include } =20 struct MockUefiLib { diff --git a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeSer= vicesTableLib.h b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRunti= meServicesTableLib.h index afdfc6b85597..241abc55c079 100644 --- a/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServicesTa= bleLib.h +++ b/MdePkg/Test/Mock/Include/GoogleTest/Library/MockUefiRuntimeServicesTa= bleLib.h @@ -11,8 +11,8 @@ #include #include extern "C" { -#include -#include + #include + #include } =20 struct MockUefiRuntimeServicesTableLib { diff --git a/MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp = b/MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp index 5a5a9159fcfe..51ee09065e92 100644 --- a/MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp +++ b/MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.cpp @@ -7,24 +7,24 @@ =20 #include =20 -MOCK_INTERFACE_DEFINITION(MockHobLib); +MOCK_INTERFACE_DEFINITION (MockHobLib); =20 -MOCK_FUNCTION_DEFINITION(MockHobLib, GetHobList, 0, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, GetNextHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, GetFirstHob, 1, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, GetNextGuidHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, GetFirstGuidHob, 1, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, GetBootModeHob, 0, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildModuleHob, 4, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildResourceDescriptorWithOwnerHob, = 5, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildResourceDescriptorHob, 4, EFIAPI= ); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildGuidHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildGuidDataHob, 3, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildFvHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildFv2Hob, 4, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildFv3Hob, 6, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildCvHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildCpuHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildStackHob, 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildBspStoreHob, 3, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockHobLib, BuildMemoryAllocationHob, 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetHobList, 0, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetNextHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetFirstHob, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetNextGuidHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetFirstGuidHob, 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, GetBootModeHob, 0, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildModuleHob, 4, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildResourceDescriptorWithOwnerHob,= 5, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildResourceDescriptorHob, 4, EFIAP= I); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildGuidHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildGuidDataHob, 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildFvHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildFv2Hob, 4, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildFv3Hob, 6, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildCvHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildCpuHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildStackHob, 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildBspStoreHob, 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockHobLib, BuildMemoryAllocationHob, 3, EFIAPI); diff --git a/MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPei= ServicesLib.cpp b/MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/Mo= ckPeiServicesLib.cpp index 9a7ff4bd8ffb..c6035bd664cf 100644 --- a/MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiService= sLib.cpp +++ b/MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiService= sLib.cpp @@ -7,30 +7,30 @@ =20 #include =20 -MOCK_INTERFACE_DEFINITION(MockPeiServicesLib); +MOCK_INTERFACE_DEFINITION (MockPeiServicesLib); =20 -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesInstallPpi, 1, EFI= API); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesReInstallPpi, 2, E= FIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesLocatePpi, 4, EFIA= PI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesNotifyPpi, 1, EFIA= PI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesGetBootMode, 1, EF= IAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesSetBootMode, 1, EF= IAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesGetHobList, 1, EFI= API); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesCreateHob, 3, EFIA= PI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsFindNextVolume,= 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsFindNextFile, 3= , EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsFindSectionData= , 3, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsFindSectionData= 3, 5, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesInstallPeiMemory, = 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesAllocatePages, 3, = EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFreePages, 2, EFIA= PI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesAllocatePool, 2, E= FIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesResetSystem, 0, EF= IAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsFindFileByName,= 3, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsGetFileInfo, 2,= EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsGetFileInfo2, 2= , EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesFfsGetVolumeInfo, = 2, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesRegisterForShadow,= 1, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesInstallFvInfoPpi, = 5, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesInstallFvInfo2Ppi,= 6, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockPeiServicesLib, PeiServicesResetSystem2, 4, E= FIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesInstallPpi, 1, EF= IAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesReInstallPpi, 2, = EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesLocatePpi, 4, EFI= API); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesNotifyPpi, 1, EFI= API); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesGetBootMode, 1, E= FIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesSetBootMode, 1, E= FIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesGetHobList, 1, EF= IAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesCreateHob, 3, EFI= API); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsFindNextVolume= , 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsFindNextFile, = 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsFindSectionDat= a, 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsFindSectionDat= a3, 5, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesInstallPeiMemory,= 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesAllocatePages, 3,= EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFreePages, 2, EFI= API); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesAllocatePool, 2, = EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesResetSystem, 0, E= FIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsFindFileByName= , 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsGetFileInfo, 2= , EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsGetFileInfo2, = 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesFfsGetVolumeInfo,= 2, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesRegisterForShadow= , 1, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesInstallFvInfoPpi,= 5, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesInstallFvInfo2Ppi= , 6, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPeiServicesLib, PeiServicesResetSystem2, 4, = EFIAPI); diff --git a/MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cp= p b/MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp index 5339d040c999..2a0c9613eaa2 100644 --- a/MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp +++ b/MdePkg/Test/Mock/Library/GoogleTest/MockUefiLib/MockUefiLib.cpp @@ -6,7 +6,7 @@ **/ #include =20 -MOCK_INTERFACE_DEFINITION(MockUefiLib); +MOCK_INTERFACE_DEFINITION (MockUefiLib); =20 -MOCK_FUNCTION_DEFINITION(MockUefiLib, GetVariable2, 4, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockUefiLib, GetEfiGlobalVariable2, 3, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockUefiLib, GetVariable2, 4, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockUefiLib, GetEfiGlobalVariable2, 3, EFIAPI); diff --git a/MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTab= leLib/MockUefiRuntimeServicesTableLib.cpp b/MdePkg/Test/Mock/Library/Google= Test/MockUefiRuntimeServicesTableLib/MockUefiRuntimeServicesTableLib.cpp index ecd1ba82366c..14296b0ccb88 100644 --- a/MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/M= ockUefiRuntimeServicesTableLib.cpp +++ b/MdePkg/Test/Mock/Library/GoogleTest/MockUefiRuntimeServicesTableLib/M= ockUefiRuntimeServicesTableLib.cpp @@ -6,13 +6,13 @@ **/ #include =20 -MOCK_INTERFACE_DEFINITION(MockUefiRuntimeServicesTableLib); +MOCK_INTERFACE_DEFINITION (MockUefiRuntimeServicesTableLib); =20 -MOCK_FUNCTION_DEFINITION(MockUefiRuntimeServicesTableLib, gRT_GetVariable,= 5, EFIAPI); -MOCK_FUNCTION_DEFINITION(MockUefiRuntimeServicesTableLib, gRT_SetVariable,= 5, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockUefiRuntimeServicesTableLib, gRT_GetVariable= , 5, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockUefiRuntimeServicesTableLib, gRT_SetVariable= , 5, EFIAPI); =20 -static EFI_RUNTIME_SERVICES localRt =3D { - {0}, // EFI_TABLE_HEADER +static EFI_RUNTIME_SERVICES localRt =3D { + { 0 }, // EFI_TABLE_HEADER =20 NULL, // EFI_GET_TIME NULL, // EFI_SET_TIME @@ -36,5 +36,5 @@ static EFI_RUNTIME_SERVICES localRt =3D { }; =20 extern "C" { - EFI_RUNTIME_SERVICES* gRT =3D &localRt; + EFI_RUNTIME_SERVICES *gRT =3D &localRt; } --=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 (#107813): https://edk2.groups.io/g/devel/message/107813 Mute This Topic: https://groups.io/mt/100788669/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- From nobody Tue May 14 09:09:19 2024 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+107814+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+107814+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=b7sum16D4U/4V/RCSDO5mhxt/e+QsvIrbhhEfwvUca2MAZx9uMNU3a4xnVIUssQi9ea3M9OdtNDxWuhlTq2fWpmAa2gKADUtmCYiVvaS+rDKDmN+E/H0fSddrF/qd1r1OYl4gVFTg46eAWSxuIWBqi+DBjL3e3tJatBkp+UbSD4= 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=0iYXPAOw8AGQt4BpaiCYVVnPOoW4cWHwJ6KmZ6FubrA=; b=mWbQc908WNodRM1u3HaBUeEeEwt/JbrSfBsUI9iu03NRMaYi98Awod4aLNYdhCM0EixRLcNFeiFZITDrOXAbV1zc5Sj3aPvoOJfNZ4sNLK154yPQ9ekKPdRbdC7BfzCiTHgUMjII8xiEcpfx0jriDokS2AMjK8+Z+du1WQWVQP4= 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+107814+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 1692220529442200.6864169850478; Wed, 16 Aug 2023 14:15:29 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=8Cyi0HgODv55d/np5ZKaIq8Hsi6av9g3iIRj6/E0Ckw=; 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=QwZ2AhjiCr9BugzQQuaUjlgMPwY99ifCadVpyXDTtuNEmbVE5SUjaFPN/NXBJgxk7JtQ2Qi1 mC5XG4C5he1aM+qW/rQ23zSFY75O12dHBag6u4pqNLXlpyoltUkR3gb8ZCnKX4vc61c3SRu3l6p Q6P7sWnvHrsF5PYnFbMmMxME= X-Received: by 127.0.0.2 with SMTP id XDF5YY1788612xalN6HUaJsV; 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.172398.1692220526202465604 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 C9248211F7A4; Wed, 16 Aug 2023 14:15:25 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C9248211F7A4 From: "VivianNK" To: devel@edk2.groups.io Cc: Jiewen Yao , Jian J Wang Subject: [edk2-devel] [PATCH v2 5/7] SecurityPkg: Apply uncrustify formatting to relevant files Date: Wed, 16 Aug 2023 14:15:20 -0700 Message-ID: <20230816211523.12-6-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: K8lOX0sXa7YN3fKRfGT3cbj0x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220531141100024 Content-Type: text/plain; charset="utf-8" Apply uncrustify formatting to GoogleTest cpp and header files. Cc: Jiewen Yao =20 Cc: Jian J Wang Signed-off-by: Vivian Nowka-Keane --- SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariableLib= GoogleTest.cpp | 205 ++++++++++++-------- SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtectionL= ib.h | 4 +- SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockP= latformPKProtectionLib.cpp | 4 +- 3 files changed, 124 insertions(+), 89 deletions(-) diff --git a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBoo= tVariableLibGoogleTest.cpp b/SecurityPkg/Library/SecureBootVariableLib/Goog= leTest/SecureBootVariableLibGoogleTest.cpp index c9190c8ffd61..f66c595a97a8 100644 --- a/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariab= leLibGoogleTest.cpp +++ b/SecurityPkg/Library/SecureBootVariableLib/GoogleTest/SecureBootVariab= leLibGoogleTest.cpp @@ -21,154 +21,189 @@ using namespace testing; =20 //////////////////////////////////////////////////////////////////////////= //// class SetSecureBootModeTest : public Test { - protected: - MockUefiRuntimeServicesTableLib RtServicesMock; - UINT8 SecureBootMode; - EFI_STATUS Status; +protected: + MockUefiRuntimeServicesTableLib RtServicesMock; + UINT8 SecureBootMode; + EFI_STATUS Status; =20 - void SetUp() override { - // Any random magic number can be used for these tests - SecureBootMode =3D 0xAB; - } + void + SetUp ( + ) override + { + // Any random magic number can be used for these tests + SecureBootMode =3D 0xAB; + } }; =20 // Test SetSecureBootMode() API from SecureBootVariableLib to verify the // expected error is returned when the call to gRT->SetVariable() fails. -TEST_F(SetSecureBootModeTest, SetVarError) { - EXPECT_CALL(RtServicesMock, gRT_SetVariable) - .WillOnce(Return(EFI_INVALID_PARAMETER)); +TEST_F (SetSecureBootModeTest, SetVarError) { + EXPECT_CALL (RtServicesMock, gRT_SetVariable) + .WillOnce (Return (EFI_INVALID_PARAMETER)); =20 - Status =3D SetSecureBootMode(SecureBootMode); - EXPECT_EQ(Status, EFI_INVALID_PARAMETER); + Status =3D SetSecureBootMode (SecureBootMode); + EXPECT_EQ (Status, EFI_INVALID_PARAMETER); } =20 // Test SetSecureBootMode() API from SecureBootVariableLib to verify the // expected secure boot mode is written to the correct variable in the call // to gRT->SetVariable(). -TEST_F(SetSecureBootModeTest, PropogateModeToSetVar) { - EXPECT_CALL(RtServicesMock, - gRT_SetVariable( - Char16StrEq(EFI_CUSTOM_MODE_NAME), - BufferEq(&gEfiCustomModeEnableGuid, sizeof(EFI_GUID)), +TEST_F (SetSecureBootModeTest, PropogateModeToSetVar) { + EXPECT_CALL ( + RtServicesMock, + gRT_SetVariable ( + Char16StrEq (EFI_CUSTOM_MODE_NAME), + BufferEq (&gEfiCustomModeEnableGuid, sizeof (EFI_GUID)), EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - sizeof(SecureBootMode), - BufferEq(&SecureBootMode, sizeof(SecureBootMode)))) - .WillOnce(Return(EFI_SUCCESS)); + sizeof (SecureBootMode), + BufferEq (&SecureBootMode, sizeof (SecureBootMode)) + ) + ) + .WillOnce (Return (EFI_SUCCESS)); =20 - Status =3D SetSecureBootMode(SecureBootMode); - EXPECT_EQ(Status, EFI_SUCCESS); + Status =3D SetSecureBootMode (SecureBootMode); + EXPECT_EQ (Status, EFI_SUCCESS); } =20 //////////////////////////////////////////////////////////////////////////= //// class GetSetupModeTest : public Test { - protected: - MockUefiRuntimeServicesTableLib RtServicesMock; - UINT8 SetupMode; - EFI_STATUS Status; - UINT8 ExpSetupMode; +protected: + MockUefiRuntimeServicesTableLib RtServicesMock; + UINT8 SetupMode; + EFI_STATUS Status; + UINT8 ExpSetupMode; =20 - void SetUp() override { - // Any random magic number can be used for these tests - ExpSetupMode =3D 0xAB; - } + void + SetUp ( + ) override + { + // Any random magic number can be used for these tests + ExpSetupMode =3D 0xAB; + } }; =20 // Test GetSetupMode() API from SecureBootVariableLib to verify the expect= ed // error is returned when the call to gRT->GetVariable() fails. -TEST_F(GetSetupModeTest, GetVarError) { - EXPECT_CALL(RtServicesMock, gRT_GetVariable) - .WillOnce(Return(EFI_INVALID_PARAMETER)); +TEST_F (GetSetupModeTest, GetVarError) { + EXPECT_CALL (RtServicesMock, gRT_GetVariable) + .WillOnce (Return (EFI_INVALID_PARAMETER)); =20 Status =3D GetSetupMode (&SetupMode); - EXPECT_EQ(Status, EFI_INVALID_PARAMETER); + EXPECT_EQ (Status, EFI_INVALID_PARAMETER); } =20 // Test GetSetupMode() API from SecureBootVariableLib to verify the expect= ed // setup mode is returned (and with a success return code) when the mode is // successfully read from the call to gRT->GetVariable(). -TEST_F(GetSetupModeTest, FetchModeFromGetVar) { - EXPECT_CALL(RtServicesMock, - gRT_GetVariable( - Char16StrEq(EFI_SETUP_MODE_NAME), - BufferEq(&gEfiGlobalVariableGuid, sizeof(EFI_GUID)), +TEST_F (GetSetupModeTest, FetchModeFromGetVar) { + EXPECT_CALL ( + RtServicesMock, + gRT_GetVariable ( + Char16StrEq (EFI_SETUP_MODE_NAME), + BufferEq (&gEfiGlobalVariableGuid, sizeof (EFI_GUID)), _, - Pointee(Eq(sizeof(SetupMode))), - NotNull())) - .WillOnce(DoAll( - SetArgPointee<3>(sizeof(ExpSetupMode)), - SetArgBuffer<4>(&ExpSetupMode, sizeof(ExpSetupMode)), - Return(EFI_SUCCESS))); + Pointee (Eq (sizeof (SetupMode))), + NotNull () + ) + ) + .WillOnce ( + DoAll ( + SetArgPointee<3>(sizeof (ExpSetupMode)), + SetArgBuffer<4>(&ExpSetupMode, sizeof (ExpSetupMode)), + Return (EFI_SUCCESS) + ) + ); =20 Status =3D GetSetupMode (&SetupMode); - ASSERT_EQ(Status, EFI_SUCCESS); - EXPECT_EQ(SetupMode, ExpSetupMode); + ASSERT_EQ (Status, EFI_SUCCESS); + EXPECT_EQ (SetupMode, ExpSetupMode); } =20 //////////////////////////////////////////////////////////////////////////= //// class IsSecureBootEnabledTest : public Test { - protected: - MockUefiLib UefiLibMock; - BOOLEAN Enabled; +protected: + MockUefiLib UefiLibMock; + BOOLEAN Enabled; }; =20 // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify FAL= SE // is returned when the call to GetEfiGlobalVariable2() fails. -TEST_F(IsSecureBootEnabledTest, GetVarError) { - EXPECT_CALL(UefiLibMock, GetEfiGlobalVariable2) - .WillOnce(Return(EFI_ABORTED)); +TEST_F (IsSecureBootEnabledTest, GetVarError) { + EXPECT_CALL (UefiLibMock, GetEfiGlobalVariable2) + .WillOnce (Return (EFI_ABORTED)); =20 Enabled =3D IsSecureBootEnabled (); - EXPECT_EQ(Enabled, FALSE); + EXPECT_EQ (Enabled, FALSE); } =20 //////////////////////////////////////////////////////////////////////////= //// class IsSecureBootEnabledAllocTest : public IsSecureBootEnabledTest { - protected: - UINT8 *BootEnabledBuffer; +protected: + UINT8 *BootEnabledBuffer; =20 - void SetUp() override { - BootEnabledBuffer =3D (UINT8*) AllocatePool(1); - ASSERT_NE(BootEnabledBuffer, nullptr); - } + void + SetUp ( + ) override + { + BootEnabledBuffer =3D (UINT8 *)AllocatePool (1); + ASSERT_NE (BootEnabledBuffer, nullptr); + } }; =20 // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify TRUE // is returned when the call to GetEfiGlobalVariable2() is successful and // returns SECURE_BOOT_MODE_ENABLE. -TEST_F(IsSecureBootEnabledAllocTest, IsEnabled) { +TEST_F (IsSecureBootEnabledAllocTest, IsEnabled) { *BootEnabledBuffer =3D SECURE_BOOT_MODE_ENABLE; - EXPECT_CALL(UefiLibMock, - GetEfiGlobalVariable2( - Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), - NotNull(), - _)) - .WillOnce(DoAll( - SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), - Return(EFI_SUCCESS))); + EXPECT_CALL ( + UefiLibMock, + GetEfiGlobalVariable2 ( + Char16StrEq (EFI_SECURE_BOOT_MODE_NAME), + NotNull (), + _ + ) + ) + .WillOnce ( + DoAll ( + SetArgBuffer<1>(&BootEnabledBuffer, sizeof (VOID *)), + Return (EFI_SUCCESS) + ) + ); =20 Enabled =3D IsSecureBootEnabled (); - EXPECT_EQ(Enabled, TRUE); + EXPECT_EQ (Enabled, TRUE); } =20 // Test IsSecureBootEnabled() API from SecureBootVariableLib to verify FAL= SE // is returned when the call to GetEfiGlobalVariable2() is successful and // returns SECURE_BOOT_MODE_DISABLE. -TEST_F(IsSecureBootEnabledAllocTest, IsDisabled) { +TEST_F (IsSecureBootEnabledAllocTest, IsDisabled) { *BootEnabledBuffer =3D SECURE_BOOT_MODE_DISABLE; - EXPECT_CALL(UefiLibMock, - GetEfiGlobalVariable2( - Char16StrEq(EFI_SECURE_BOOT_MODE_NAME), - NotNull(), - _)) - .WillOnce(DoAll( - SetArgBuffer<1>(&BootEnabledBuffer, sizeof(VOID*)), - Return(EFI_SUCCESS))); + EXPECT_CALL ( + UefiLibMock, + GetEfiGlobalVariable2 ( + Char16StrEq (EFI_SECURE_BOOT_MODE_NAME), + NotNull (), + _ + ) + ) + .WillOnce ( + DoAll ( + SetArgBuffer<1>(&BootEnabledBuffer, sizeof (VOID *)), + Return (EFI_SUCCESS) + ) + ); =20 Enabled =3D IsSecureBootEnabled (); - EXPECT_EQ(Enabled, FALSE); + EXPECT_EQ (Enabled, FALSE); } =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 (); } diff --git a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformP= KProtectionLib.h b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPla= tformPKProtectionLib.h index 8024f4be2975..04288f2b75a3 100644 --- a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtec= tionLib.h +++ b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtec= tionLib.h @@ -11,8 +11,8 @@ #include #include extern "C" { -#include -#include + #include + #include } =20 struct MockPlatformPKProtectionLib { diff --git a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtect= ionLib/MockPlatformPKProtectionLib.cpp b/SecurityPkg/Test/Mock/Library/Goog= leTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp index 5ea030f6dfcf..6613d5ed199a 100644 --- a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/= MockPlatformPKProtectionLib.cpp +++ b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/= MockPlatformPKProtectionLib.cpp @@ -6,6 +6,6 @@ **/ #include =20 -MOCK_INTERFACE_DEFINITION(MockPlatformPKProtectionLib); +MOCK_INTERFACE_DEFINITION (MockPlatformPKProtectionLib); =20 -MOCK_FUNCTION_DEFINITION(MockPlatformPKProtectionLib, DisablePKProtection,= 0, EFIAPI); +MOCK_FUNCTION_DEFINITION (MockPlatformPKProtectionLib, DisablePKProtection= , 0, EFIAPI); --=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 (#107814): https://edk2.groups.io/g/devel/message/107814 Mute This Topic: https://groups.io/mt/100788670/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- From nobody Tue May 14 09:09:19 2024 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- From nobody Tue May 14 09:09:19 2024 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+107816+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+107816+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=A0mJcROdRg/P3oOPWfttm2jYmthkZzfCsNrztJXa+6KTeIovsJEtiJX6ql6b3jd9hkU6bK+fJgqiHKklgm5DaZzIa5nGYbUoDaPU+/2HrUj2CnYFAsXPG/xRD3bZTzbvtaqSBzWn5UB1ttSjmhMAzBNhZ/6OJt/t3gBeB4YvjO0= 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=We8A8LWDhtQTJu2rJSolM3cuFWnwS3L1XxnNheBVZG0=; b=WCCNJFiM8PNHzhXNMoN4XhyLj+D+3rBnWdsNyLjxtm2qlsrYvl+3zHblaJh8pbx11y9odo7FQk5gaTL/UkTmsiBheFoP31fgvcgRqQZyyToh0kBOtNgXVAIFBT9kk8Aoz4DMrYi9vbfFvN8iAk0wmuOfD8bxJ9C1Z4jkm7Lmv6k= 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+107816+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 1692220529888446.77045621431455; Wed, 16 Aug 2023 14:15:29 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+7uxZOW1oq+Zg5NPJM3Gq1kRtywvffOhs3aabiwXWUs=; 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=cPMqyx9Zt0qYtvlmI/ZN2zE/NcE3gpd2C7zQ+7U7FC8r5zmu3RbBCLz8XYHtc1+TozIHfCYW iZSHxHCWbPWy9c9GkHbnlzyOEuDZL83kTdsBnopyUU0mKBhwFuKXYZb2mYlDAt8wwTR5gFsWEql F8YUzeArxHheCe1osJZ8PSpE= X-Received: by 127.0.0.2 with SMTP id Y5ULYY1788612xiqXK0fuluX; 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.web10.172577.1692220525565723579 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 27D42211F7A7; Wed, 16 Aug 2023 14:15:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 27D42211F7A7 From: "VivianNK" To: devel@edk2.groups.io Cc: Sean Brogan , Michael Kubacki , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 7/7] .pytool: Undo uncrustify check change Date: Wed, 16 Aug 2023 14:15:22 -0700 Message-ID: <20230816211523.12-8-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: Z2Y8GnBGVpOXF9rkVGgeDfaVx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1692220531591100029 Content-Type: text/plain; charset="utf-8" Set global audit only to False now that new rules have been applied to all necessary packages. Cc: Sean Brogan Cc: Michael Kubacki Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Vivian Nowka-Keane Reviewed-by: Michael Kubacki --- .pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py b/.pytool/Pl= ugin/UncrustifyCheck/UncrustifyCheck.py index 17f77b48d954..ffc72f2c5918 100644 --- a/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py +++ b/.pytool/Plugin/UncrustifyCheck/UncrustifyCheck.py @@ -530,7 +530,7 @@ class UncrustifyCheck(ICiBuildPlugin): """ Initializes options that influence test case output. """ - self._audit_only_mode =3D True + self._audit_only_mode =3D False self._output_file_diffs =3D True =20 if "AuditOnly" in self._package_config and self._package_config["A= uditOnly"]: --=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 (#107816): https://edk2.groups.io/g/devel/message/107816 Mute This Topic: https://groups.io/mt/100788672/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-