20#define UNIT_TEST_NAME "Sample Unit Test Generate Exception"
21#define UNIT_TEST_VERSION "0.1"
54DivideWithNoParameterChecking (
62 return (Dividend / Divisor);
95 return UNIT_TEST_PASSED;
113 UNIT_TEST_FRAMEWORK_HANDLE Framework;
114 UNIT_TEST_SUITE_HANDLE MacroTestsAssertsEnabled;
115 UNIT_TEST_SUITE_HANDLE MacroTestsAssertsDisabled;
119 DEBUG ((DEBUG_INFO,
"%a v%a\n", UNIT_TEST_NAME, UNIT_TEST_VERSION));
125 if (EFI_ERROR (Status)) {
126 DEBUG ((DEBUG_ERROR,
"Failed in InitUnitTestFramework. Status = %r\n", Status));
134 if (EFI_ERROR (Status)) {
135 DEBUG ((DEBUG_ERROR,
"Failed in CreateUnitTestSuite for MacroTestsAssertsEnabled\n"));
136 Status = EFI_OUT_OF_RESOURCES;
146 if (EFI_ERROR (Status)) {
147 DEBUG ((DEBUG_ERROR,
"Failed in CreateUnitTestSuite for MacroTestsAssertsDisabled\n"));
148 Status = EFI_OUT_OF_RESOURCES;
int main()
=== TEST ENGINE ================================================================================
#define DEBUG(Expression)
#define PcdGet8(TokenName)
#define PatchPcdSet8(TokenName, Value)
VOID * EFI_PEI_FILE_HANDLE
UNIT_TEST_STATUS EFIAPI GenerateUnexpectedException(IN UNIT_TEST_CONTEXT Context)
EFI_STATUS EFIAPI UefiTestMain(VOID)
VOID EFIAPI TestSuiteDisableAsserts(VOID)
VOID EFIAPI TestSuiteEnableAsserts(VOID)
EFI_STATUS EFIAPI DxeEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI PeiEntryPoint(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI RunAllTestSuites(IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle)
#define UT_ASSERT_EQUAL(ValueA, ValueB)
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)