25#include "../PrmModuleDiscovery.h"
27#define UNIT_TEST_NAME "PRM Module Discovery Library Unit Test"
28#define UNIT_TEST_VERSION "0.1"
55 if (ListEntry !=
NULL) {
59 return UNIT_TEST_PASSED;
82 UT_ASSERT_TRUE (ListEntry->Signature == PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY_SIGNATURE);
84 if (ListEntry !=
NULL) {
88 return UNIT_TEST_PASSED;
112 ZeroMem (&ImageContext,
sizeof (ImageContext));
115 if (ListEntry !=
NULL) {
119 return UNIT_TEST_PASSED;
139 UNIT_TEST_FRAMEWORK_HANDLE Framework;
140 UNIT_TEST_SUITE_HANDLE CreateNewPrmModuleImageContextListEntryTests;
144 DEBUG ((DEBUG_INFO,
"%a v%a\n", UNIT_TEST_NAME, UNIT_TEST_VERSION));
150 if (EFI_ERROR (Status)) {
151 DEBUG ((DEBUG_ERROR,
"Failed in InitUnitTestFramework. Status = %r\n", Status));
156 &CreateNewPrmModuleImageContextListEntryTests,
158 "Create New PRM Module Image Context List Entry Tests",
159 "PrmModuleDiscoveryLib.CreateNewPrmModuleImageContextListEntry",
163 if (EFI_ERROR (Status)) {
164 DEBUG ((DEBUG_ERROR,
"Failed in CreateUnitTestSuite for PrmModuleDiscoveryLib.CreateNewPrmModuleImageContextListEntry\n"));
165 Status = EFI_OUT_OF_RESOURCES;
170 CreateNewPrmModuleImageContextListEntryTests,
172 "PrmModuleDiscoveryLib.CreateNewPrmModuleImageContextListEntry.ListEntryShouldDeallocate",
180 CreateNewPrmModuleImageContextListEntryTests,
182 "PrmModuleDiscoveryLib.CreateNewPrmModuleImageContextListEntry.ListEntrySignatureShouldBeValid",
190 CreateNewPrmModuleImageContextListEntryTests,
192 "PrmModuleDiscoveryLib.CreateNewPrmModuleImageContextListEntry.ListEntryImageContextShouldBeZeroed",
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
PRM_MODULE_IMAGE_CONTEXT_LIST_ENTRY * CreateNewPrmModuleImageContextListEntry(VOID)
UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryShouldDeallocate(IN UNIT_TEST_CONTEXT Context)
=== TEST CASES =================================================================================
UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryImageContextShouldBeZeroed(IN UNIT_TEST_CONTEXT Context)
UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntrySignatureShouldBeValid(IN UNIT_TEST_CONTEXT Context)
int main()
=== TEST ENGINE ================================================================================
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
EFI_STATUS EFIAPI RunAllTestSuites(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
#define UT_ASSERT_NOT_NULL(Pointer)
#define UT_ASSERT_MEM_EQUAL(BufferA, BufferB, Length)
#define UT_ASSERT_TRUE(Expression)
EFI_STATUS EFIAPI CreateUnitTestSuite(OUT UNIT_TEST_SUITE_HANDLE *SuiteHandle, IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, IN CHAR8 *Title, IN CHAR8 *Name, IN UNIT_TEST_SUITE_SETUP Setup OPTIONAL, IN UNIT_TEST_SUITE_TEARDOWN Teardown OPTIONAL)
EFI_STATUS EFIAPI FreeUnitTestFramework(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
EFI_STATUS EFIAPI AddTestCase(IN UNIT_TEST_SUITE_HANDLE SuiteHandle, IN CHAR8 *Description, IN CHAR8 *Name, IN UNIT_TEST_FUNCTION Function, IN UNIT_TEST_PREREQUISITE Prerequisite OPTIONAL, IN UNIT_TEST_CLEANUP CleanUp OPTIONAL, IN UNIT_TEST_CONTEXT Context OPTIONAL)
EFI_STATUS EFIAPI InitUnitTestFramework(OUT UNIT_TEST_FRAMEWORK_HANDLE *FrameworkHandle, IN CHAR8 *Title, IN CHAR8 *ShortTitle, IN CHAR8 *VersionString)