Attention is currently required from: Edward O'Callaghan.
6 comments:
Commit Message:
linux_spi unit-test does not
check
I think unit-tests in general had no implementation to mock repeated calls to open, it is not specific to linux_spi.
Since you are adding generic open mock and state which support multiple calls to open, you can say something like "add ABCD infrastructure to unit tests and use this infra for linux_spi test"?
Also, maybe it is just me, but I didn't understand what "subsequent path validation" is until I read the code. Can we call it "repeated calls to open"? It really only supports open, not fopen or any other path.
Also I would emphasise it more, in a separate paragraph (even if small) that this patch also adds something to cover "/dev/null".
File tests/init_shutdown.c:
Patch Set #4, Line 39: #define DEFAULT_MOCK_FD 0xC0FE
Is there a specific meaning behind this number? We have already a NON_ZERO which is defined as
#define NON_ZERO (0xf000baaa)
is possible to reuse?
NON_ZERO is defined in include/test.h so it can be used anywhere in tests.
Patch Set #4, Line 41: default_io_mock_state
I would like to rename this, I have two reasons in mind.
The most important, "default" doesn't tell much about what the state actually use. Something like "multipath_io_state" gives information about the state.
Another reason, I am not sure how much this is actually default, because default is no state. Also further in the chain in CB:62324 you create another struct with the same name, but it can't be two defaults with the same name.
Just wondering, why 2 ?
Patch Set #4, Line 48: default_open
For the same reasons as above, I would rename this to something more self-explanatory, maybe "multipath_open" ?
I would keep the naming to indicate this piece of data belongs to linux_spi test, "linux_spi_io_state". Even if the struct type is shared between multiple tests, this piece of data belongs to this one test.
To view, visit change 62319. To unsubscribe, or for help writing mail filters, visit settings.