UnitTestPersistenceLibNull.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /** @file
  2. This is an instance of the Unit Test Persistence Lib that does nothing.
  3. Copyright (c) Microsoft Corporation.<BR>
  4. Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #include <Uefi.h>
  8. #include <Library/UnitTestPersistenceLib.h>
  9. /**
  10. Determines whether a persistence cache already exists for
  11. the given framework.
  12. @param[in] FrameworkHandle A pointer to the framework that is being persisted.
  13. @retval TRUE
  14. @retval FALSE Cache doesn't exist or an error occurred.
  15. **/
  16. BOOLEAN
  17. EFIAPI
  18. DoesCacheExist (
  19. IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle
  20. )
  21. {
  22. return FALSE;
  23. }
  24. /**
  25. Will save the data associated with an internal Unit Test Framework
  26. state in a manner that can persist a Unit Test Application quit or
  27. even a system reboot.
  28. @param[in] FrameworkHandle A pointer to the framework that is being persisted.
  29. @param[in] SaveData A pointer to the buffer containing the serialized
  30. framework internal state.
  31. @param[in] SaveStateSize The size of SaveData in bytes.
  32. @retval EFI_SUCCESS Data is persisted and the test can be safely quit.
  33. @retval Others Data is not persisted and test cannot be resumed upon exit.
  34. **/
  35. EFI_STATUS
  36. EFIAPI
  37. SaveUnitTestCache (
  38. IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
  39. IN VOID *SaveData,
  40. IN UINTN SaveStateSize
  41. )
  42. {
  43. return EFI_UNSUPPORTED;
  44. }
  45. /**
  46. Will retrieve any cached state associated with the given framework.
  47. Will allocate a buffer to hold the loaded data.
  48. @param[in] FrameworkHandle A pointer to the framework that is being persisted.
  49. @param[out] SaveData A pointer pointer that will be updated with the address
  50. of the loaded data buffer.
  51. @param[out] SaveStateSize Return the size of SaveData in bytes.
  52. @retval EFI_SUCCESS Data has been loaded successfully and SaveData is updated
  53. with a pointer to the buffer.
  54. @retval Others An error has occurred and no data has been loaded. SaveData
  55. is set to NULL.
  56. **/
  57. EFI_STATUS
  58. EFIAPI
  59. LoadUnitTestCache (
  60. IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
  61. OUT VOID **SaveData,
  62. OUT UINTN *SaveStateSize
  63. )
  64. {
  65. return EFI_UNSUPPORTED;
  66. }