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/+/56413 )
Change subject: tests: Mock file i/o for linux_mtd and linux_spi tests ......................................................................
Patch Set 4:
(5 comments)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/56413/comment/7ef74282_f8bda603 PS4, Line 208: 2021 this number is very arbitrary. Something that is obvious like -1 or 0x55AA [01010101 10101010] is better.
https://review.coreboot.org/c/flashrom/+/56413/comment/688237a7_01994af0 PS4, Line 219: // why not just `/` is something special happening here?
https://review.coreboot.org/c/flashrom/+/56413/comment/198059a8_9841a0f3 PS4, Line 230: num_bytes = 0; seems like a bug? strings in C are null terminated which is a byte.
https://review.coreboot.org/c/flashrom/+/56413/comment/289d44f8_ddde1b1a PS4, Line 274: Provide pagesize into buf. It is better to describe where the value is from and why it has it the particular value than re-describing what the code already shows.
`/* Fix pagesize to 1MB. */`
seems to be wht you are doing here?
https://review.coreboot.org/c/flashrom/+/56413/comment/21c89362_580c2fcc PS4, Line 275: memcpy(buf, "1048576", len); just, `return memcpy(buf, "1048576", len);` memcpy returns the ptr to dest (buf in this case).