Attention is currently required from: Anastasia Klimchuk. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51243 )
Change subject: Enable dynamic memory allocation checks for cmocka unit tests. ......................................................................
Patch Set 1: Code-Review+1
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/51243/comment/e78b5ebc_8f8fbacd PS1, Line 7: . nit: no trailing period in the commit summary
File tests/flashrom.c:
https://review.coreboot.org/c/flashrom/+/51243/comment/6feefcf8_34efa83e PS1, Line 31: free(text); I'd define a helper macro to avoid repeating this pattern:
#define assert_string_equal_with_free(text, expected) \ do { \ assert_string_equal(text, expected); \ free(text); \ while (0)
Two things to note: - I've intentionally used a macro instead of a function. Because `assert_string_equal` is a macro that uses `__FILE__` and `__LINE__`, using a helper function would result in the wrong line number being printed. - The do-while construct in the macro is intentional: https://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html