summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Test/Mock
diff options
context:
space:
mode:
Diffstat (limited to 'SecurityPkg/Test/Mock')
-rw-r--r--SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtectionLib.h28
-rw-r--r--SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp11
-rw-r--r--SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf34
3 files changed, 73 insertions, 0 deletions
diff --git a/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtectionLib.h b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtectionLib.h
new file mode 100644
index 0000000000..8024f4be29
--- /dev/null
+++ b/SecurityPkg/Test/Mock/Include/GoogleTest/Library/MockPlatformPKProtectionLib.h
@@ -0,0 +1,28 @@
+/** @file
+ Google Test mocks for PlatformPKProtectionLib
+
+ Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef MOCK_PLATFORM_PK_PROTECTION_LIB_H_
+#define MOCK_PLATFORM_PK_PROTECTION_LIB_H_
+
+#include <Library/GoogleTestLib.h>
+#include <Library/FunctionMockLib.h>
+extern "C" {
+#include <Uefi.h>
+#include <Library/PlatformPKProtectionLib.h>
+}
+
+struct MockPlatformPKProtectionLib {
+ MOCK_INTERFACE_DECLARATION (MockPlatformPKProtectionLib);
+
+ MOCK_FUNCTION_DECLARATION (
+ EFI_STATUS,
+ DisablePKProtection,
+ ()
+ );
+};
+
+#endif
diff --git a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp
new file mode 100644
index 0000000000..5ea030f6df
--- /dev/null
+++ b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.cpp
@@ -0,0 +1,11 @@
+/** @file
+ Google Test mocks for PlatformPKProtectionLib
+
+ Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+#include <GoogleTest/Library/MockPlatformPKProtectionLib.h>
+
+MOCK_INTERFACE_DEFINITION(MockPlatformPKProtectionLib);
+
+MOCK_FUNCTION_DEFINITION(MockPlatformPKProtectionLib, DisablePKProtection, 0, EFIAPI);
diff --git a/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf
new file mode 100644
index 0000000000..3ed638eaf7
--- /dev/null
+++ b/SecurityPkg/Test/Mock/Library/GoogleTest/MockPlatformPKProtectionLib/MockPlatformPKProtectionLib.inf
@@ -0,0 +1,34 @@
+## @file
+# Google Test mocks for PlatformPKProtectionLib
+#
+# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = MockPlatformPKProtectionLib
+ FILE_GUID = C1383D85-E0ED-44E0-A0A6-125F1D78B6E9
+ MODULE_TYPE = HOST_APPLICATION
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = PlatformPKProtectionLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Sources]
+ MockPlatformPKProtectionLib.cpp
+
+[Packages]
+ MdePkg/MdePkg.dec
+ SecurityPkg/SecurityPkg.dec
+ UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
+
+[LibraryClasses]
+ GoogleTestLib
+
+[BuildOptions]
+ MSFT:*_*_*_CC_FLAGS = /EHsc