summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg/Include
diff options
context:
space:
mode:
authorLiu, Zhiguang <Zhiguang.Liu@intel.com>2022-12-06 13:25:43 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-12-14 13:34:33 +0000
commit1cd902f1f468500eac6c90a13cbf49a5db4ef32e (patch)
treeac68d9c7a194c8a3ef6b262e43a80f80c84ec57a /UnitTestFrameworkPkg/Include
parente986f4ce969e8d95a966dd2f19a3559b336e48f5 (diff)
downloadedk2-1cd902f1f468500eac6c90a13cbf49a5db4ef32e.tar.gz
edk2-1cd902f1f468500eac6c90a13cbf49a5db4ef32e.tar.bz2
edk2-1cd902f1f468500eac6c90a13cbf49a5db4ef32e.zip
UnitTestFrameworkPkg: Modify APIs in UnitTestPersistenceLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4183 UnitTestPersistenceLib now consumes private struct definition. Modify APIs in UnitTestPersistenceLib to make it easy to become a public library. Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'UnitTestFrameworkPkg/Include')
-rw-r--r--UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
index be29e079ec..5543b79a0d 100644
--- a/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
+++ b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
@@ -4,7 +4,7 @@
(eg. a reboot-based test).
Copyright (c) Microsoft Corporation.<BR>
- Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -12,7 +12,7 @@
#ifndef _UNIT_TEST_PERSISTENCE_LIB_H_
#define _UNIT_TEST_PERSISTENCE_LIB_H_
-#include <UnitTestFrameworkTypes.h>
+#include <Library/UnitTestLib.h>
#define UNIT_TEST_PERSISTENCE_LIB_VERSION 1
@@ -40,6 +40,7 @@ DoesCacheExist (
@param[in] FrameworkHandle A pointer to the framework that is being persisted.
@param[in] SaveData A pointer to the buffer containing the serialized
framework internal state.
+ @param[in] SaveStateSize The size of SaveData in bytes.
@retval EFI_SUCCESS Data is persisted and the test can be safely quit.
@retval Others Data is not persisted and test cannot be resumed upon exit.
@@ -49,7 +50,8 @@ EFI_STATUS
EFIAPI
SaveUnitTestCache (
IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
- IN UNIT_TEST_SAVE_HEADER *SaveData
+ IN VOID *SaveData,
+ IN UINTN SaveStateSize
);
/**
@@ -57,8 +59,9 @@ SaveUnitTestCache (
Will allocate a buffer to hold the loaded data.
@param[in] FrameworkHandle A pointer to the framework that is being persisted.
- @param[in] SaveData A pointer pointer that will be updated with the address
+ @param[out] SaveData A pointer pointer that will be updated with the address
of the loaded data buffer.
+ @param[out] SaveStateSize Return the size of SaveData in bytes.
@retval EFI_SUCCESS Data has been loaded successfully and SaveData is updated
with a pointer to the buffer.
@@ -70,7 +73,8 @@ EFI_STATUS
EFIAPI
LoadUnitTestCache (
IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
- OUT UNIT_TEST_SAVE_HEADER **SaveData
+ OUT VOID **SaveData,
+ OUT UINTN *SaveStateSize
);
#endif