Fix mocked versions of GetVariable() and SetVariable().
* VendorGuid parameter use expect_memory() not expect_value()
* MockSetVariable() use check_expected() for Attributes parameter
* MockSetVariable() use check_expected_ptr() for Data parameter
* Calls to MockGetVariable() use (UINTN) cast for will_return()
of pointer to data buffer returned.
Issues found with Linux GCC NOOPT IA32 builds of unit tests.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Fix uninitialized variable error in unit tests detected by
clang by zeroing local variable structure before use in unit
test cases.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.
Since it's more standard, replace __FUNCTION__ with __func__ throughout
SecurityPkg.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
The unit test code for the SecureBootVariableLib is initializing
local variable structures in their declaration from other local
variables that are also initialized in their declaration. ANSI C
does not allow this and error 4122 is generated on VS20xx compilers.
The test cases are updated to initialize the local structure
fields in C statements instead of their local variable declaration.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com>