Attention is currently required from: Jakub Czapiga, Jan Dabros. Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43510 )
Change subject: tests: Add lib/bootmem-test test case ......................................................................
Patch Set 6:
(4 comments)
File tests/lib/bootmem-test.c:
https://review.coreboot.org/c/coreboot/+/43510/comment/8703713e_3ddc4839 PS6, Line 9: #define assert(statement) mock_assert(statement, #statement, __FILE__, __LINE__) (Sorry for holding this patch up again but you added yet another new thing that requires discussion now. ;) )
Having a mechanism to mock asserts is great, but let's not hack it individually at the top of every test. We need something generic to do this that other tests can reuse. I think the only good option there is to put this into coreboot's <assert.h>.
So first, we need a way to distinguish building for tests from building normally. You should add a -D__TEST__ to TEST_CFLAGS, and then you can define an ENV_TEST in <rules.h> based on that (similar to what we have for stages). Then you can use that in <assert.h> to define different behavior for tests.
https://review.coreboot.org/c/coreboot/+/43510/comment/1910c188_5c0c9f6d PS6, Line 13: #include <string.h> nit: alphabetize?
https://review.coreboot.org/c/coreboot/+/43510/comment/c60a76f6_45d406ac PS6, Line 167: assert_memory_equal(sentinel_value_buffer, nit: I've seen this construct (malloc() and memset() something just to compare it) in a couple of tests now, maybe we should have a global assert_memory_filled_with() helper for that.
https://review.coreboot.org/c/coreboot/+/43510/comment/b4942849_0b514b61 PS6, Line 381: 0xE0000000 0xF0000000