TianoCore EDK2 master
Loading...
Searching...
No Matches
EvaluateDependencyUnitTest.c File Reference

Go to the source code of this file.

Data Structures

struct  BASIC_TEST_CONTEXT
 

Macros

#define UNIT_TEST_APP_NAME   "FmpDependencyLib Unit Test Application"
 
#define UNIT_TEST_APP_VERSION   "1.0"
 
#define IMAGE_TYPE_ID_1   { 0x97144DFA, 0xEB8E, 0xD14D, {0x8B, 0x4D, 0x39, 0x88, 0x24, 0x96, 0x56, 0x42}}
 
#define IMAGE_TYPE_ID_2   { 0xA42A7370, 0x433A, 0x684D, {0x9A, 0xA1, 0xDE, 0x62, 0x23, 0x30, 0x6C, 0xF3}}
 

Functions

STATIC UNIT_TEST_STATUS EFIAPI EvaluateDependencyTest (IN UNIT_TEST_CONTEXT Context)
 
STATIC EFI_STATUS EFIAPI UnitTestingEntry (VOID)
 
EFI_STATUS EFIAPI FmpDependencyLibUnitTestAppEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
int main (int argc, char *argv[])
 

Detailed Description

Unit tests of EvaluateDependency API in FmpDependencyLib.

Copyright (c) 2020, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EvaluateDependencyUnitTest.c.

Macro Definition Documentation

◆ IMAGE_TYPE_ID_1

#define IMAGE_TYPE_ID_1   { 0x97144DFA, 0xEB8E, 0xD14D, {0x8B, 0x4D, 0x39, 0x88, 0x24, 0x96, 0x56, 0x42}}

Definition at line 30 of file EvaluateDependencyUnitTest.c.

◆ IMAGE_TYPE_ID_2

#define IMAGE_TYPE_ID_2   { 0xA42A7370, 0x433A, 0x684D, {0x9A, 0xA1, 0xDE, 0x62, 0x23, 0x30, 0x6C, 0xF3}}

Definition at line 35 of file EvaluateDependencyUnitTest.c.

◆ UNIT_TEST_APP_NAME

#define UNIT_TEST_APP_NAME   "FmpDependencyLib Unit Test Application"

Definition at line 18 of file EvaluateDependencyUnitTest.c.

◆ UNIT_TEST_APP_VERSION

#define UNIT_TEST_APP_VERSION   "1.0"

Definition at line 19 of file EvaluateDependencyUnitTest.c.

Function Documentation

◆ EvaluateDependencyTest()

STATIC UNIT_TEST_STATUS EFIAPI EvaluateDependencyTest ( IN UNIT_TEST_CONTEXT  Context)

Unit test for EvaluateDependency() API of the FmpDependencyLib.

Parameters
[in]Context[Optional] An optional parameter that enables: 1) test-case reuse with varied parameters and 2) test-case re-entry for Target tests that need a reboot. This parameter is a VOID* and it is the responsibility of the test author to ensure that the contents are well understood by all test cases that may consume it.
Return values
UNIT_TEST_PASSEDThe Unit test has completed and the test case was successful.
UNIT_TEST_ERROR_TEST_FAILEDA test case assertion has failed.

Definition at line 216 of file EvaluateDependencyUnitTest.c.

◆ FmpDependencyLibUnitTestAppEntry()

EFI_STATUS EFIAPI FmpDependencyLibUnitTestAppEntry ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Standard UEFI entry point for target based unit test execution from UEFI Shell.

Definition at line 315 of file EvaluateDependencyUnitTest.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Standard POSIX C entry point for host based unit test execution.

Definition at line 327 of file EvaluateDependencyUnitTest.c.

◆ UnitTestingEntry()

STATIC EFI_STATUS EFIAPI UnitTestingEntry ( VOID  )

Initialize the unit test framework, suite, and unit tests for the EvaluateDependency API in FmpDependencyLib and run the unit tests.

Return values
EFI_SUCCESSAll test cases were dispatched.
EFI_OUT_OF_RESOURCESThere are not enough resources available to initialize the unit tests.

Definition at line 250 of file EvaluateDependencyUnitTest.c.