mirror of
				https://gitlab.com/qemu-project/edk2.git
				synced 2025-10-30 07:56:39 +08:00 
			
		
		
		
	EmbeddedPkg: Add DtPlatformLoaderLib gmock support
Add Google Mock Library for DtPlatformLoaderDtbLib Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
This commit is contained in:
		 Jeff Brasen via groups.io
					Jeff Brasen via groups.io
				
			
				
					committed by
					
						![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
			
				
	
			
			
			![mergify[bot]](/assets/img/avatar_default.png) mergify[bot]
						mergify[bot]
					
				
			
						parent
						
							5804e94886
						
					
				
				
					commit
					7a5823f85b
				
			| @ -28,6 +28,7 @@ | ||||
| ################################################################################ | ||||
| [Includes.common] | ||||
|   Include                        # Root include for the package | ||||
|   Test/Mock/Include | ||||
|  | ||||
| [LibraryClasses.common] | ||||
|   PrePiLib|Include/Library/PrePiLib.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 <Library/GoogleTestLib.h> | ||||
| #include <Library/FunctionMockLib.h> | ||||
| extern "C" { | ||||
|   #include <Pi/PiMultiPhase.h> | ||||
|   #include <Uefi.h> | ||||
|   #include <Library/DtPlatformDtbLoaderLib.h> | ||||
| } | ||||
|  | ||||
| struct MockDtPlatformDtbLoaderLib { | ||||
|   MOCK_INTERFACE_DECLARATION (MockDtPlatformDtbLoaderLib); | ||||
|  | ||||
|   MOCK_FUNCTION_DECLARATION ( | ||||
|     EFI_STATUS, | ||||
|     DtPlatformLoadDtb, | ||||
|     (OUT   VOID   **Dtb, | ||||
|      OUT   UINTN  *DtbSize) | ||||
|     ); | ||||
| }; | ||||
|  | ||||
| #endif | ||||
| @ -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 <GoogleTest/Library/MockDtPlatformDtbLoaderLib.h> | ||||
|  | ||||
| MOCK_INTERFACE_DEFINITION (MockDtPlatformDtbLoaderLib); | ||||
|  | ||||
| MOCK_FUNCTION_DEFINITION (MockDtPlatformDtbLoaderLib, DtPlatformLoadDtb, 2, EFIAPI); | ||||
| @ -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                    = 0x00010005 | ||||
|   BASE_NAME                      = MockDtPlatformDtbLoaderLib | ||||
|   FILE_GUID                      = 34c05e81-3c56-4c78-b4b7-a39be19163a4 | ||||
|   MODULE_TYPE                    = HOST_APPLICATION | ||||
|   VERSION_STRING                 = 1.0 | ||||
|   LIBRARY_CLASS                  = DtPlatformDtbLoaderLib | ||||
|  | ||||
| [Sources] | ||||
| MockDtPlatformDtbLoaderLib.cpp | ||||
|  | ||||
| [Packages] | ||||
|   EmbeddedPkg/EmbeddedPkg.dec | ||||
|   MdePkg/MdePkg.dec | ||||
|   UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | ||||
|  | ||||
| [LibraryClasses] | ||||
|   GoogleTestLib | ||||
|  | ||||
| [BuildOptions] | ||||
|   MSFT:*_*_*_CC_FLAGS = /EHsc | ||||
		Reference in New Issue
	
	Block a user