Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56501 )
Change subject: tests: Add test to erase a chip ......................................................................
Patch Set 1: Code-Review+1
(2 comments)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/56501/comment/f894eea1_dddffc2d PS1, Line 26: /* : * Populate buf with the value used for erase operation, this allows to pass : * verification checks and also emulates successful erase. : */ : buf = memset(buf, 0xff, len); should this memset happen instead in the block erase fn and use a singleton state here to see if that was called yet or not?
I think in this particular case of emulating a hw state a singleton global is the highly exceptional case of it being a good pattern.
https://review.coreboot.org/c/flashrom/+/56501/comment/e4ff1415_5ed59c7c PS1, Line 42: printf("Unlock chip called\n"); The singleton state could also be queried with a counter to ensure a double unlock isn't done?