Attention is currently required from: Evan Benn.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69263 )
Change subject: tests: Mock the mode_t variant of open ......................................................................
Patch Set 4:
(3 comments)
File tests/io_mock.h:
https://review.coreboot.org/c/flashrom/+/69263/comment/ef610289_b0e82984 PS4, Line 37: #include <fcntl.h> Is this a platform-specific header? Is this header present on non-Linux environments? The unit tests are running not only on Linux.
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/69263/comment/c7d5b98e_732aa5b3 PS4, Line 21: #include <fcntl.h> If you need to include the same header twice, this means it needs to be included on a higher level, so that it will be included only once. Specifically, the right place seems to be `include/test.h`.
I see that `io_mock.h` does not include `include/test.h` however `io_mock.c` includes it. Which means: you can do a little refactoring, in a separate patch before this one. Move include of `include/test.h` from `io_mock.c` into `io_mock.h`. And after that, this patch can add fcntl.h into `include/test.h`. But see also my other comment.
File tests/wraps.h:
https://review.coreboot.org/c/flashrom/+/69263/comment/375fadec_4d07bd67 PS4, Line 31: int __wrap_open(const char *pathname, int flags, ...); : int __wrap_open64(const char *pathname, int flags, ...); : int __wrap___open64_2(const char *pathname, int flags, ...); Just to check, will the wraps still capture two-args variant of `open` calls?