Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add tests to erase a chip ......................................................................
Patch Set 3:
(2 comments)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/8973261b_f6f7777a PS1, Line 42: printf("Unlock chip called\n");
If you're emulating a chip, I'd also mock and verify locking to increase test coverage
I added chip state which counts how many times unlock was called, and then read/write/erase check that unlock has been called. This is all added for fake chip test.
https://review.coreboot.org/c/flashrom/+/56501/comment/17177d48_13e309c9 PS1, Line 57: char *param_dup = strdup("");
Hmmm, I guess the `memmove` inside that function changes the haystack. If so... […]
Yes, from my memory it is memmove. I remember spending a while on this when I was writing the very first test, memmove did segfault because it was trying to modify read-only memory. Eventually I added strdup to workaround that.