Before the constructor of this function was opening the device
corresponding to the passed path. This did not allow for properly
mocking the device functionality. Now the device is passed as a
parameter instead, which allows us to tweak what the device returns for
ioctl calls, and we can thus test multiple scenarios.
Signed-off-by: Andreea Florescu <fandree@amazon.com>
Coverage is now increased by ~9%. Further tests should be relatively
straightforward to write by using the mock structure `DummyDevice`.
Signed-off-by: Andreea Florescu <fandree@amazon.com>
This still doesn't emulate the descriptors and descriptor chains over
the vrings. That will be added later.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reduce the test coverage score as the files apart from i2c.rs are
mostly boilerplate code and it is difficult to test them as well as it
may not be worth it.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>