Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: c3769e392b9293d8fdd124665f12b08c704e5952
https://github.com/tianocore/edk2/commit/c3769e392b9293d8fdd124665f12b08c704e5952
Author: Pedro Falcato <[email protected]>
Date: 2023-12-03 (Sun, 03 Dec 2023)
Changed paths:
M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg: Fix Google Test components with multiple files
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4610
Google Test hides test registration in global constructors on global
objects. Global constructors are traditionally implemented by placing
references to the global constructor's symbol in special sections
(traditionally named .ctors or .init_array). These sections are not
explicitly referenced by the linker, and libc only looks at special
start and end symbols (and calls them).
This works fine if you're linking a program manually using
gcc a.o b.o c.o -o test_suite
but fails miserably when using static libraries (such as what EDK2
does), because traditional static archive symbol resolution rules don't
allow for object files to be pulled in to the link if there isn't an
undefined symbol reference to that .o elsewhere.
Fix it by passing --whole-archive (GCC) and /WHOLEARCHIVE (MSVC). These
options force the linker to pull in the entire static library, thus
including previously-unreferenced constructors and making sure
multi-file gtest EDK2 components work.
Cc: Michael D Kinney <[email protected]>
Cc: Michael Kubacki <[email protected]>
Cc: Sean Brogan <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Reviewed-by: Cc: Michael D Kinney <[email protected]>
Commit: 7182621edc67260a322fa0fb8bb4c8e398d9323e
https://github.com/tianocore/edk2/commit/7182621edc67260a322fa0fb8bb4c8e398d9323e
Author: Pedro Falcato <[email protected]>
Date: 2023-12-03 (Sun, 03 Dec 2023)
Changed paths:
M UnitTestFrameworkPkg/ReadMe.md
Log Message:
-----------
UnitTestFrameworkPkg/Readme.md: Remove gtest main() limitation
As of the previous commit, this limitation is no longer a thing.
You can now write gtest unit tests with multiple files and no need for
any hack such as #include.
Cc: Michael D Kinney <[email protected]>
Cc: Michael Kubacki <[email protected]>
Cc: Sean Brogan <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Reviewed-by: Cc: Michael D Kinney <[email protected]>
Commit: e2d4f759137dea60a402a1810a4014a7cf00116b
https://github.com/tianocore/edk2/commit/e2d4f759137dea60a402a1810a4014a7cf00116b
Author: Pedro Falcato <[email protected]>
Date: 2023-12-03 (Sun, 03 Dec 2023)
Changed paths:
M MdePkg/Include/Library/BaseLib.h
M MdePkg/Library/BaseLib/CheckSum.c
Log Message:
-----------
MdePkg/BaseLib: Fix CRC16-ANSI calculation
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4609
The current CalculateCrc16Ansi implementation does the following:
1) Invert the passed checksum
2) Calculate the new checksum by going through data and using the
lookup table
3) Invert it back again
This emulated my design for CalculateCrc32c, where 0 is
passed as the initial checksum, and it inverts in the end.
However, CRC16 does not invert the checksum on input and output.
So this is incorrect.
Fix the problem by not inverting input checksums nor output checksums.
Callers should now pass CRC16ANSI_INIT as the initial value instead of
"0". This is a breaking change.
This problem was found out-of-list when older ext4 filesystems
(that use crc16 checksums) failed to mount with "corruption".
Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Commit: 3e133f730b69a2b5a5cb875ed27e0439053663c4
https://github.com/tianocore/edk2/commit/3e133f730b69a2b5a5cb875ed27e0439053663c4
Author: Pedro Falcato <[email protected]>
Date: 2023-12-03 (Sun, 03 Dec 2023)
Changed paths:
A MdePkg/Test/GoogleTest/Library/BaseLib/GoogleTestBaseLib.inf
A MdePkg/Test/GoogleTest/Library/BaseLib/TestBaseLibMain.cpp
A MdePkg/Test/GoogleTest/Library/BaseLib/TestCheckSum.cpp
M MdePkg/Test/MdePkgHostTest.dsc
Log Message:
-----------
MdePkg/Test: Add google tests for BaseLib
Add GoogleTestBaseLib, which contains gtest unit tests for BaseLib.
For now, only add checksum tests for CRC32C and CRC16; these tests check
for correctness on various inputs using precomputed hashes.
Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Compare: https://github.com/tianocore/edk2/compare/70b174e24db4...3e133f730b69
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits