Jan Dabros has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43510 )
Change subject: tests: Add lib/bootmem-test test case ......................................................................
Patch Set 1:
(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_
Since this isn't actually a test, I don't think it should have a test_ prefix. […]
Hmm.. while it is not actually a test, it is tightly coupled with a particular test. It is easy to identify setup and teardown functions for every test case. Don't you think that _setup and _teardown suffixes are enough to tell that it is not a real test but rather a helper? That being said, removing test_ prefix still will allow developers to match helpers and test method, so I can go with your proposal.
The main problem is probably that I'm not using the scheme <test_name>_setup and <test_name>_teardown consistently throughout the module (since test_basic_setup() is for test_bootmem_write_mem_table()).
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 */
Requiring tests to be run in a specific order is usually a sign that the tests have hidden dependenc […]
You are right, I'm making use of one memory table across all the tests. However I can simply call bootmem_write_memory_table() in every test and simply ignore its output.
https://review.coreboot.org/c/coreboot/+/43510/1/tests/lib/bootmem-test.c@15... PS1, Line 150: bool
These functions only get called once, and their return value is not used. […]
These functions are callbacks defined as typedef bool (*range_action_t)(const struct range_entry *r, void *arg);
, so I need to keep this format. "The caller has to return false to break out of the loop any time, or return true to continue". I want to iterate through all entries, that's why true is always returned.