]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
UnitTestFrameworkPkg: Modify APIs in UnitTestPersistenceLib
[mirror_edk2.git] / UnitTestFrameworkPkg / Include / Library / UnitTestPersistenceLib.h
index be29e079ec3e0b2743442c03caf95ee41f8e2bc1..5543b79a0d0ded6e65e6db0d36d15015fff24cbc 100644 (file)
@@ -4,7 +4,7 @@
   (eg. a reboot-based test).\r
 \r
   Copyright (c) Microsoft Corporation.<BR>\r
-  Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -12,7 +12,7 @@
 #ifndef _UNIT_TEST_PERSISTENCE_LIB_H_\r
 #define _UNIT_TEST_PERSISTENCE_LIB_H_\r
 \r
-#include <UnitTestFrameworkTypes.h>\r
+#include <Library/UnitTestLib.h>\r
 \r
 #define UNIT_TEST_PERSISTENCE_LIB_VERSION  1\r
 \r
@@ -40,6 +40,7 @@ DoesCacheExist (
   @param[in]  FrameworkHandle   A pointer to the framework that is being persisted.\r
   @param[in]  SaveData          A pointer to the buffer containing the serialized\r
                                 framework internal state.\r
+  @param[in]  SaveStateSize     The size of SaveData in bytes.\r
 \r
   @retval     EFI_SUCCESS   Data is persisted and the test can be safely quit.\r
   @retval     Others        Data is not persisted and test cannot be resumed upon exit.\r
@@ -49,7 +50,8 @@ EFI_STATUS
 EFIAPI\r
 SaveUnitTestCache (\r
   IN UNIT_TEST_FRAMEWORK_HANDLE  FrameworkHandle,\r
-  IN UNIT_TEST_SAVE_HEADER       *SaveData\r
+  IN VOID                        *SaveData,\r
+  IN UINTN                       SaveStateSize\r
   );\r
 \r
 /**\r
@@ -57,8 +59,9 @@ SaveUnitTestCache (
   Will allocate a buffer to hold the loaded data.\r
 \r
   @param[in]  FrameworkHandle   A pointer to the framework that is being persisted.\r
-  @param[in]  SaveData          A pointer pointer that will be updated with the address\r
+  @param[out] SaveData          A pointer pointer that will be updated with the address\r
                                 of the loaded data buffer.\r
+  @param[out] SaveStateSize     Return the size of SaveData in bytes.\r
 \r
   @retval     EFI_SUCCESS       Data has been loaded successfully and SaveData is updated\r
                                 with a pointer to the buffer.\r
@@ -70,7 +73,8 @@ EFI_STATUS
 EFIAPI\r
 LoadUnitTestCache (\r
   IN  UNIT_TEST_FRAMEWORK_HANDLE  FrameworkHandle,\r
-  OUT UNIT_TEST_SAVE_HEADER       **SaveData\r
+  OUT VOID                        **SaveData,\r
+  OUT UINTN                       *SaveStateSize\r
   );\r
 \r
 #endif\r