Attention is currently required from: Angel Pons, Anastasia Klimchuk. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add tests to erase a chip ......................................................................
Patch Set 4: Code-Review+1
(5 comments)
Patchset:
PS4: Definitely split this like you suggested but the first test looks great now!
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/1107942f_d7dac37b PS4, Line 25: int `unsigned` unless negative unlocks encode something special?
https://review.coreboot.org/c/flashrom/+/56501/comment/6afff89b_9a264512 PS4, Line 52: memcpy(&g_chip_state.buf[start], buf, len); validate len does not exceed the actual buffer length. Possibly with a test assert
https://review.coreboot.org/c/flashrom/+/56501/comment/cb30a29c_6a8a2cc4 PS4, Line 59: g_chip_state.unlock_calls++; : return 0; this does depend on the chip I suppose but another possible behavior is the following:
``` g_chip_state.unlock_calls++; if (g_chip_state.unlock_calls > 1) return -1; // chip already unlocked return 0; ```
not sure if that finds anything interesting or is just a wast of time?
https://review.coreboot.org/c/flashrom/+/56501/comment/31de3859_2c76e3ce PS4, Line 71: memset(&g_chip_state.buf[blockaddr], 0xff, blocklen); ditto, ensure blocklen does not exceed the global buffer size.