Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43510 )
Change subject: tests: Add lib/bootmem-test test case ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/43510/1/tests/lib/bootmem-test.c File tests/lib/bootmem-test.c:
https://review.coreboot.org/c/coreboot/+/43510/1/tests/lib/bootmem-test.c@93 PS1, Line 93: test_
How about test_bootmem_write_mem_table, setup_bootmem_write_mem_table, and teardown_bootmem_write_me […]
Done
https://review.coreboot.org/c/coreboot/+/43510/1/tests/lib/bootmem-test.c@12... PS1, Line 122: /* This test need to be run first, in order to use bootmem library API */
You are right, I'm making use of one memory table across all the tests. […]
Done
https://review.coreboot.org/c/coreboot/+/43510/2/tests/lib/bootmem-test.c File tests/lib/bootmem-test.c:
https://review.coreboot.org/c/coreboot/+/43510/2/tests/lib/bootmem-test.c@21... PS2, Line 212: struct lb_memory *lb_mem; : : will_return_always(search_global_resources, &mem_device_mock); : : /* Allocate space for 5 lb_mem entries to be safe */ : lb_mem = malloc(sizeof(*lb_mem) + 5 * sizeof(struct lb_memory_range)); : : /* We need to call this only to initialize library */ : bootmem_write_memory_table(lb_mem); : free(lb_mem); : Rather than copy/pasting this code into three tests, put it in a function (call it something like "init_memory_table_library"), add comments to the function about why it needs to be called, and then call the function from each of these tests.