summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Test
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Update DumpImageRecord() in ImagePropertiesRecordLibTaylor Beebe2023-11-271-0/+1
| | | | | | | | | | | | | | | Update DumpImageRecord() to be DumpImageRecords(), and improve the debug output. The function will output at DEBUG_INFO instead, and the function will be run in DXE and SMM MAT logic when the MAT is installed at EndOfDxe on DEBUG builds. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Taylor Beebe <taylor.d.beebe@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Add ImagePropertiesRecordLib Host-Based Unit TestTaylor Beebe2023-11-271-0/+5
| | | | | | | | | | | | | | Create a host-based unit test for the ImagePropertiesRecordLib SplitTable() logic. This test has 4 cases which tests different potential image and memory map layouts. 3/4 of these tests fail with the logic in its current state to provide proof of the bugs in the current MAT logic. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Taylor Beebe <taylor.d.beebe@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Apply uncrustify formatting to relevant files.Vivian Nowka-Keane2023-10-272-6/+6
| | | | | | | | | | | | Apply uncrustify formatting to GoogleTest cpp files and respective header file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg: Add more PciHostBridgeLib gmock supportGua Guo2023-05-104-0/+94
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4443 Add Google Mock Library for PciHostBridgeLib Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Chris Johnson <chris.n.johnson@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/Library/UefiSortLib: Add GoogleTestLib exampleChris Johnson2023-04-101-0/+6
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Chris Johnson <chris.n.johnson@intel.com> Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/UefiSortLib:Add UefiSortLib unit testWenyi Xie2021-08-121-0/+6
| | | | | | | | | | | | | Adding two unit test case for UefiSortLib. One is a test on sorting an array of UINT32 by using PerformQuickSort, another is a test on comparing the same buffer by using StringCompare. Add 'main' function name to ECC exception list to avoid ECC error. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/Variable/RuntimeDxe: Add Variable Lock Protocol Unit TestsMichael D Kinney2020-12-151-0/+11
| | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=3111 Add host based unit tests for the multiple lock case using Variable Lock Protocol, Variable Policy Protocol, and mixes of Variable Lock Protocol and Variable Policy Protocol. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg: Add DxeResetSystemLib unit testMichael D Kinney2020-02-071-0/+32
https://bugzilla.tianocore.org/show_bug.cgi?id=2505 * Add unit test of DxeResetSystemLib library instance that uses cmocka interfaces to mock the UEFI Runtime Services Table and its ResetSystem() service. When a unit test uses the cmocka interfaces, the unit test does not support being run from target environments. cmocka APIs: https://api.cmocka.org/index.html This example puts the unit test in a UnitTest directory below the library INF file and this location means the unit test is only designed to work this this one library instance. * Add Test/MdeModulePkgHostTest.dsc to build host based unit tests Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>