Could you be a bit more specific
Could you be a bit more specific
for example, let say i have a function to scan devices around the area,
How do we proceed to test it?
7 Replies
So a unit test implies that you are testing that function by itself.
So you would need to set it up with mocks/stubs
mocking is where you provide a known response, so here you would need to mock finding a device and also not finding any devices
Then check that your function responds correctly to both situations
Voila! you have a unit test
If you are on Zephyr still check this out https://docs.zephyrproject.org/latest/develop/test/ztest.html
and here is an actual example https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/boards/nrf/i2c/i2c_slave/src/main.c
GitHub
zephyr/tests/boards/nrf/i2c/i2c_slave/src/main.c at main · zephyrpr...
Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures. - zephyrproject-rtos/zephyr
Thank you!
considering a testing live stream
I would join it,
Lacking a lot in that domain...
would be added bonus, if you could show, how is the your thoughtprocess when attempting this via some examples
just for you I will do one one Wednesday
Damn,
That would be amazing