Attention is currently required from: Nico Huber.
3 comments:
Patchset:
Nico thank you so much, you really help me, this patch explains the idea perfectly!! I need some time, I am implementing this idea gradually. Two thoughts, added as comments.
File tests/init_shutdown.c:
Patch Set #1, Line 63: .outb = mec1308_outb,
I think, maybe I could get away with a default implementation of outx functions, and only customise inx functions? And this also means have 3 variables in io_mock
uint8_t outb_val
uint16_t outw_val
uint32_t outl_val
instead of void *priv.
Outx functions are mocked, so they do not do any actual output. The only useful thing could be the value passed to outx, the value definitely needed to be stored.
Having said that, maybe you see further than me and you see that default outx won't be sufficient?
what do you think?
File tests/tests.c:
Patch Set #1, Line 23: const struct io_mock *current_io = NULL;
Do you think it would work if I try to swap this line with extern definition in io_mock.h ? I want to try have extern const struct definition for current_io here (without assigning to NULL), and const struct with = NULL in io_mock.h
The reason is, it wasn't easy for me to understand why current_io is assigned NULL on the top, and then used in functions below. It takes some time (at least it took some time for me) to understand that current_io is reassigned in different file. When it is extern without any assignment, it is more clear that it is taken care of elsewhere.
I want to try swap lines, hope it can work.
To view, visit change 52604. To unsubscribe, or for help writing mail filters, visit settings.