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/+/56413 )
Change subject: tests: Mock file i/o for linux_mtd and linux_spi tests ......................................................................
Patch Set 11:
(3 comments)
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/56413/comment/491071ca_e86c78d5 PS4, Line 219: //
Hmmm, what I hoped for doesn't work. I expected fnmatch() to […]
Ah ok, I understand. Thank you for explanation.
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/56413/comment/35f3826f_d4d406f2 PS9, Line 236: + 1
Um, no. If we'd decide to end the strings with a '\n' that would […]
Thank you for explanation, again! I removed +1 from length. After reading your comment, I tried to find more exact info on 0-termination in sysfs file, for some reasons it is harder than I thought :( For this test, for the way linux_mtd written today, it works with or without +1, but that's probably a coincidence? I want to make it right.
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/56413/comment/b816eea6_44352e14 PS10, Line 239: strncpy(buf, entry->data, data_len);
Just noticed: used like this, isn't it doing the same as memcpy()? […]
Oh great thank you! That was my question two patchsets ago, I noticed after few rounds of code review I had strncpy() in one place and memcpy() in the other. Now it is the same memcpy in both places!
It has one interesting trait: clearing the unused bytes of the buffer
This is helpful, and I missed this.