Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk. Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56911 )
Change subject: tests: add init_shutdown test for realtek_mst_i2c_spi ......................................................................
Patch Set 6:
(10 comments)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/56911/comment/e9dcf4c8_ec20130d PS5, Line 217: if (strcmp(pathname, "/dev/i2c-254") != 0)
Actually, given that this is test, let's make it an assert. […]
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/596d2939_f0182b21 PS5, Line 219: if ((flags & O_RDWR) != O_RDWR)
assert_int_equal
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/05d0141c_fef7ee4e PS5, Line 229: if (fd != REALTEK_MST_MOCK_FD)
assert_int_equal
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/bbdda22e_899a3ced PS5, Line 231: if (request != I2C_SLAVE)
assert_int_equal
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/eeed3ac9_17ec039c PS5, Line 235: if (addr != 0x4a)
assert_int_equal
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/33a3fea6_b1f54d2b PS5, Line 243: if (fd != REALTEK_MST_MOCK_FD || sz != 1)
assert_int_equal twice (for FD and for sz)
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/1d2502a2_1e73c752 PS5, Line 250: if (fd != REALTEK_MST_MOCK_FD)
assert_int_equal
Done
https://review.coreboot.org/c/flashrom/+/56911/comment/b2432c8d_784b45d5 PS5, Line 252: if (sz == 1 || sz == 2)
assert_in_set
Done
File tests/io_mock.h:
https://review.coreboot.org/c/flashrom/+/56911/comment/0c469b81_16142e6f PS5, Line 78: int (*open)(void *state, const char *pathname, int flags);
In addition to my comment in tests.c: one more line here: […]
Ack
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/56911/comment/2c5b4a3f_c691b212 PS5, Line 93: return __wrap_open(pathname, flags);
When I said "wrap doesn't need to redirect to another wrap" I meant this: […]
I think it's so unlikely a test will ever care about the difference that it's better to pretend they're the same. The Linux manual for open(2) doesn't describe open64() at all, because whether open() or open64() is used is generally an implementation detail of the C library determined by whether _FILE_OFFSET_BITS is 32 or 64 at build-time, and that further is only relevant to 32-bit systems (per feature_test_macros(7)).
If a test cared about the difference, that would probably indicate a bug in the implementation that would cause it to fail on some systems when built with some settings!