Attention is currently required from: Sam McNally, Anastasia Klimchuk. Daniel Campello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/63227 )
Change subject: tests: assert pathname and flags when calling open() ......................................................................
Patch Set 9:
(4 comments)
File tests/io_mock.h:
https://review.coreboot.org/c/flashrom/+/63227/comment/30ce6451_3780ec17 PS9, Line 118: /* An alternative to custom open mock. A test can either register its : * own mock open function or fallback_open_state. */
The text of the comment is alright, but formatting needs to be adjusted. […]
Done
https://review.coreboot.org/c/flashrom/+/63227/comment/13025611_4d6fa6cb PS9, Line 120: struct io_mock_fallback_open_state *fallback_open_state;
Just to double-check, did you choose longer names deliberately? I was suggesting […]
I think longer name is fine. If you want to have the "fallback" qualifier I think it should be in addition.
For a shorter name I would rather much more have the "io_mock" prefix (as it was before) than the "fallback" prefix for the struct name. The "io_mock" prefix points to the file where the struct lives and where it is used. The fallback quality can be learned from reading the comments around the use of the struct.
Regarding to the struct member again prefer open_state over fallback_open. fallback_open points to a function name while state makes clear that is the state maintained by the default mock function. If you want the fallback qualifier then I rather fallback_open_state.
File tests/io_mock.c:
https://review.coreboot.org/c/flashrom/+/63227/comment/97c9157a_4718c9b4 PS9, Line 24: /* A test can either register its own mock open function or : * fallback_open_state. */
This can be one-line comment. […]
Done
https://review.coreboot.org/c/flashrom/+/63227/comment/df4f4dd2_fb08bda3 PS9, Line 26: assert_true(io == NULL || io->open == NULL || : io->fallback_open_state == NULL);
This can be one line, as it was before, please return back :) […]
Done