From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7E162740032 for ; Thu, 28 Dec 2023 20:47:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=j5HCGXNYbW4fHnGX2nMC3gz4pJ4mHQsei6SxhjkT0Pw=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF: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:Content-Type; s=20140610; t=1703796454; v=1; b=Xdic+l1PabeZZHqSgKByv0knMXoZmErS1SnTIbS3zow4lTNKSusB9S7blwXL8EKxZgo3RXkX 5dU8AHA42/ds2QG94kHvYaZaVf6Y8GRrvkMoKCSbcD0DLx8etZ/bx825KNSmIb94h4zHZIQyshC Gn1UJ/EWFG3pkAcLdLKgGC6o= X-Received: by 127.0.0.2 with SMTP id 4FZrYY7687511xeKqKyeTfGa; Thu, 28 Dec 2023 12:47:34 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.54]) by mx.groups.io with SMTP id smtpd.web10.131905.1703796453598733852 for ; Thu, 28 Dec 2023 12:47:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mVEIHYIVWXbIrSZ/1G+zSu5hC2gXojMs5ruI+u1FVKBcfNjpADXdlNtdP7npx6t2qeygUQSqRGprS9PcUsXQwV7JZsMSewzRKT4JTM4F4wCyM0Fr0DZG2Be9YbhNfg4WBue/dfNYv/6ExB5UamqA0lArzHhK9ioAyq1AKViFbDr0QK2O+LO7NSiOH5fmDHkdPvruHdXPkmzVIfOMNZ+thF7Kya3XxQNsZmvvdfYOmxl5wff/lqnMiJGsgk/n7FO+42HJuUJOQJtMysZWyJ1GnL6y8biHBv2ISpmz7+jQTL+6p7jDDGNlwRmiDVfQs++lBJgoWZgIKFMBs901KDTdHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iIWEwg/AzXknWbutBntVjxiYOCJa/oQ++nnXWc6zJ1E=; b=AL+1CnhPJFf8PrNtwcO/OC3LpYpIGpknYSepntHOS1tXquIGt75dWbCK2+Z1RMkx6TTJdrrFP+FrQajBv+N4//5Q2+NBhd+0UgfTTSk6jnmMl38A3phDnQ6j2nOJ7NLdvcDNE9mg2N1gZ1ntu2Vf3OKQxDNptzLRUE8zQo7DZ9S8EA4lro3wFenU/uiBvSOJwrx4MOQ+BBwAINvF7j0hdFyBz70xfsJn5yRqcfDYF/43Gvxk8wt7fDb+2zMFA39lhnSqY70LpTeII0g2GwiMIXWDrqv6uemhEuZwMEbU24OVqEmGnVbH9BtkgjJ6XSAOWvjQ7a7RkN2i0+ZEuz5GiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) X-Received: from SN6PR08CA0021.namprd08.prod.outlook.com (2603:10b6:805:66::34) by BL3PR12MB6449.namprd12.prod.outlook.com (2603:10b6:208:3b8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.18; Thu, 28 Dec 2023 20:47:28 +0000 X-Received: from SA2PEPF00001508.namprd04.prod.outlook.com (2603:10b6:805:66:cafe::d8) by SN6PR08CA0021.outlook.office365.com (2603:10b6:805:66::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.20 via Frontend Transport; Thu, 28 Dec 2023 20:47:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF00001508.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.14 via Frontend Transport; Thu, 28 Dec 2023 20:47:27 +0000 X-Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 28 Dec 2023 12:47:14 -0800 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 28 Dec 2023 12:47:14 -0800 X-Received: from cad98f4d2e3d.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 28 Dec 2023 12:47:13 -0800 From: "Jeff Brasen via groups.io" To: CC: , , , Jeff Brasen Subject: [edk2-devel] [PATCH v2 3/3] EmbeddedPkg: Add DtPlatformLoaderLib gmock support Date: Thu, 28 Dec 2023 12:47:08 -0800 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001508:EE_|BL3PR12MB6449:EE_ X-MS-Office365-Filtering-Correlation-Id: cbb8550b-3e34-4f72-f317-08dc07e63448 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 7fKMbTN0weXo4rk/ZXCrPqgNlicgyyC4BiL6zC0MpSW+3OBhiYEvA/UoqRnHqBk8ywOugXN5MYa77Q/xMYuhtczHAIKZnR0S3A4Gh5fi3ccG0XIhIsrnzUUZcguDUONI1UXHBsQN3QIPoHb4QS1euM9UWJ1WQ1PwiBCoKGKCahM++qUGrcE/FxwdeVF5K6xECvuxo9VLC+hc76AODu+yFGnRRtJlUK4yd+FGkCGfvy5VDQZzwSTB2voQli3SPBrjq8kn7ZTcun4E39s/KfBNslNvq+8eHM0v4vAnjigWsLxl0R1HTTuyMvoEojA8S/OCgwlKGowoIFX6yUn8D3uSMRttH5CiK8DZkUMKKOVMZ0Wu8UrN7DGymGmceXUkAPXQbTZi6RVEqdF3ffgpBw/4vCBVpDeDmtck3ljFb9M5w2/Z7mmB3uUx8NxH0nY5l9jvOhp286e6CI/C2b1Nz1NR3YBxFbZr0Xn/YDyGarvjMXiPynUB3i5bvOaV4FFbDtM3PWfVIrHAVh/qrdYEoliZTfXlpVXiowlSXEBsUcCrINK0o6P02RMnKmZm/0DhlQGUou+u77vToYzNZs6N+XreUrHcXhj6My9aIrsFfmQrHf7du+iEWaPIRW24pAZ00VZwa42JRTHbgIROgKRbhXnS8PB0CG1Edz875zoctDzbtFiDZaeF8zi7S93Qu9tzXMC3YtJ0oymRnReylYZKuq5QUFphyLiTn91DKCwegzVYDtI4nuaIRja9BSsWr43+dKS7 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2023 20:47:27.9430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbb8550b-3e34-4f72-f317-08dc07e63448 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001508.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6449 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,jbrasen@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: VRTD7nS5y7aKzsUFr1i3R44Ox7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Xdic+l1P; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Add Google Mock Library for DtPlatformLoaderDtbLib Signed-off-by: Jeff Brasen --- EmbeddedPkg/EmbeddedPkg.dec | 1 + .../MockDtPlatformDtbLoaderLib.inf | 29 +++++++++++++++++ .../Library/MockDtPlatformDtbLoaderLib.h | 31 +++++++++++++++++++ .../MockDtPlatformDtbLoaderLib.cpp | 13 ++++++++ 4 files changed, 74 insertions(+) create mode 100644 EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatform= DtbLoaderLib/MockDtPlatformDtbLoaderLib.inf create mode 100644 EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDt= PlatformDtbLoaderLib.h create mode 100644 EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatform= DtbLoaderLib/MockDtPlatformDtbLoaderLib.cpp diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 94dc3c9b76ca..b4834e8b4f88 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -28,6 +28,7 @@ [Defines] ##########################################################################= ###### [Includes.common] Include # Root include for the package + Test/Mock/Include =20 [LibraryClasses.common] PrePiLib|Include/Library/PrePiLib.h diff --git a/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoad= erLib/MockDtPlatformDtbLoaderLib.inf b/EmbeddedPkg/Test/Mock/Library/Google= Test/MockDtPlatformDtbLoaderLib/MockDtPlatformDtbLoaderLib.inf new file mode 100644 index 000000000000..9618efd86470 --- /dev/null +++ b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLib/M= ockDtPlatformDtbLoaderLib.inf @@ -0,0 +1,29 @@ +## @file +# Google Test mocks for MockDtPlatformDtbLoaderLib +# +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2023, Intel Corporation. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D MockDtPlatformDtbLoaderLib + FILE_GUID =3D 34c05e81-3c56-4c78-b4b7-a39be19163a4 + MODULE_TYPE =3D HOST_APPLICATION + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D DtPlatformDtbLoaderLib + +[Sources] +MockDtPlatformDtbLoaderLib.cpp + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[LibraryClasses] + GoogleTestLib + +[BuildOptions] + MSFT:*_*_*_CC_FLAGS =3D /EHsc diff --git a/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatfor= mDtbLoaderLib.h b/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPl= atformDtbLoaderLib.h new file mode 100644 index 000000000000..ce0fca2c3293 --- /dev/null +++ b/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatformDtbLoa= derLib.h @@ -0,0 +1,31 @@ +/** @file + Google Test mocks for DtPlatformDtbLoaderLib + + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MOCK_DT_PLATFORM_DTB_LOADER_LIB_H_ +#define MOCK_DT_PLATFORM_DTB_LOADER_LIB_H_ + +#include +#include +extern "C" { + #include + #include + #include +} + +struct MockDtPlatformDtbLoaderLib { + MOCK_INTERFACE_DECLARATION (MockDtPlatformDtbLoaderLib); + + MOCK_FUNCTION_DECLARATION ( + EFI_STATUS, + DtPlatformLoadDtb, + (OUT VOID **Dtb, + OUT UINTN *DtbSize) + ); +}; + +#endif diff --git a/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoad= erLib/MockDtPlatformDtbLoaderLib.cpp b/EmbeddedPkg/Test/Mock/Library/Google= Test/MockDtPlatformDtbLoaderLib/MockDtPlatformDtbLoaderLib.cpp new file mode 100644 index 000000000000..a5db68e59a09 --- /dev/null +++ b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLib/M= ockDtPlatformDtbLoaderLib.cpp @@ -0,0 +1,13 @@ +/** @file + Google Test mocks for MockDtPlatformDtbLoaderLib + + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include + +MOCK_INTERFACE_DEFINITION (MockDtPlatformDtbLoaderLib); + +MOCK_FUNCTION_DEFINITION (MockDtPlatformDtbLoaderLib, DtPlatformLoadDtb, 2= , EFIAPI); --=20 2.34.1 -=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 (#112992): https://edk2.groups.io/g/devel/message/112992 Mute This Topic: https://groups.io/mt/103407486/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-