TianoCore EDK2 master
Loading...
Searching...
No Matches
DxePrmModuleDiscoveryLibUnitTest.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrmModuleDiscoveryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UnitTestLib.h>
#include "../PrmModuleDiscovery.h"

Go to the source code of this file.

Macros

#define UNIT_TEST_NAME   "PRM Module Discovery Library Unit Test"
 
#define UNIT_TEST_VERSION   "0.1"
 

Functions

UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryShouldDeallocate (IN UNIT_TEST_CONTEXT Context)
 === TEST CASES =================================================================================
 
UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntrySignatureShouldBeValid (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryImageContextShouldBeZeroed (IN UNIT_TEST_CONTEXT Context)
 
int main ()
 === TEST ENGINE ================================================================================
 

Detailed Description

Unit tests for the PRM Module Discovery Library.

Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DxePrmModuleDiscoveryLibUnitTest.c.

Macro Definition Documentation

◆ UNIT_TEST_NAME

#define UNIT_TEST_NAME   "PRM Module Discovery Library Unit Test"

Definition at line 27 of file DxePrmModuleDiscoveryLibUnitTest.c.

◆ UNIT_TEST_VERSION

#define UNIT_TEST_VERSION   "0.1"

Definition at line 28 of file DxePrmModuleDiscoveryLibUnitTest.c.

Function Documentation

◆ main()

int main ( )

=== TEST ENGINE ================================================================================

Entry point for the PRM Context Buffer Library unit tests.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point executed successfully.
otherSome error occurred when executing this entry point.

Definition at line 135 of file DxePrmModuleDiscoveryLibUnitTest.c.

◆ PrmModuleImageContextListEntryImageContextShouldBeZeroed()

UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryImageContextShouldBeZeroed ( IN UNIT_TEST_CONTEXT  Context)

Verifies that the Context buffer in the list entry is initialized to zero.

Parameters
[in]Context[Optional] An optional context parameter. Not used in this unit test.
Return values
UNIT_TEST_PASSEDUnit test case prerequisites are met.
UNIT_TEST_ERROR_PREREQUISITE_NOT_METTest case should be skipped..

Definition at line 103 of file DxePrmModuleDiscoveryLibUnitTest.c.

◆ PrmModuleImageContextListEntryShouldDeallocate()

UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntryShouldDeallocate ( IN UNIT_TEST_CONTEXT  Context)

=== TEST CASES =================================================================================

===== CREATE NEW PRM MODULE IMAGE CONTEXT LIST ENTRY TESTS SUITE ================================================== Verifies that the buffer returned can be deallocated.

Parameters
[in]Context[Optional] An optional context parameter. Not used in this unit test.
Return values
UNIT_TEST_PASSEDUnit test case prerequisites are met.
UNIT_TEST_ERROR_PREREQUISITE_NOT_METTest case should be skipped..

Definition at line 46 of file DxePrmModuleDiscoveryLibUnitTest.c.

◆ PrmModuleImageContextListEntrySignatureShouldBeValid()

UNIT_TEST_STATUS EFIAPI PrmModuleImageContextListEntrySignatureShouldBeValid ( IN UNIT_TEST_CONTEXT  Context)

Verifies that the list entry signature is set to the appropriate value.

Parameters
[in]Context[Optional] An optional context parameter. Not used in this unit test.
Return values
UNIT_TEST_PASSEDUnit test case prerequisites are met.
UNIT_TEST_ERROR_PREREQUISITE_NOT_METTest case should be skipped..

Definition at line 74 of file DxePrmModuleDiscoveryLibUnitTest.c.