25#define UNIT_TEST_APP_NAME "DxeResetSystemLib Unit Tests"
26#define UNIT_TEST_APP_VERSION "1.0"
50 IN VOID *ResetData OPTIONAL
53 check_expected_ptr (ResetType);
54 check_expected_ptr (ResetStatus);
66 EFI_RUNTIME_SERVICES_SIGNATURE,
67 EFI_RUNTIME_SERVICES_REVISION,
114 return UNIT_TEST_PASSED;
143 return UNIT_TEST_PASSED;
172 return UNIT_TEST_PASSED;
201 return UNIT_TEST_PASSED;
235 return UNIT_TEST_PASSED;
254 UNIT_TEST_FRAMEWORK_HANDLE Framework;
255 UNIT_TEST_SUITE_HANDLE ResetTests;
259 DEBUG ((DEBUG_INFO,
"%a v%a\n", UNIT_TEST_APP_NAME, UNIT_TEST_APP_VERSION));
264 Status =
InitUnitTestFramework (&Framework, UNIT_TEST_APP_NAME, gEfiCallerBaseName, UNIT_TEST_APP_VERSION);
265 if (EFI_ERROR (Status)) {
266 DEBUG ((DEBUG_ERROR,
"Failed in InitUnitTestFramework. Status = %r\n", Status));
274 if (EFI_ERROR (Status)) {
275 DEBUG ((DEBUG_ERROR,
"Failed in CreateUnitTestSuite for ResetTests\n"));
276 Status = EFI_OUT_OF_RESOURCES;
VOID EFIAPI ResetWarm(VOID)
VOID EFIAPI ResetShutdown(VOID)
VOID EFIAPI ResetSystem(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
VOID EFIAPI ResetPlatformSpecific(IN UINTN DataSize, IN VOID *ResetData)
VOID EFIAPI ResetCold(VOID)
int main()
=== TEST ENGINE ================================================================================
EFI_RUNTIME_SERVICES MockRuntime
STATIC VOID EFIAPI MockResetSystem(IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL)
UNIT_TEST_STATUS EFIAPI ResetShutdownShouldIssueAShutdown(IN UNIT_TEST_CONTEXT Context)
UNIT_TEST_STATUS EFIAPI ResetSystemShouldPassTheParametersThrough(IN UNIT_TEST_CONTEXT Context)
UNIT_TEST_STATUS EFIAPI ResetColdShouldIssueAColdReset(IN UNIT_TEST_CONTEXT Context)
UNIT_TEST_STATUS EFIAPI ResetWarmShouldIssueAWarmReset(IN UNIT_TEST_CONTEXT Context)
STATIC EFI_STATUS EFIAPI UnitTestingEntry(VOID)
UNIT_TEST_STATUS EFIAPI ResetPlatformSpecificShouldIssueAPlatformSpecificReset(IN UNIT_TEST_CONTEXT Context)
#define DEBUG(Expression)
@ EfiResetPlatformSpecific
EFI_STATUS EFIAPI RunAllTestSuites(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
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)