I am writing C code for an AVR chip. The code is heavy on interrupt serivce routines which wait on serial ports, ADCs and timers. The ISRs write to buffers which the main loop examines when it gets to them.
I design the buffers so that ISRs can update them while the main loop is reading them. I want to verify that this works. I have unit tests to validate basic operation, but I'm not clear on how to test what happens if an interrupt fires while the main loop is read a buffer.
My unit test are really basic--some code in a main()
finction. I run the tests on my Linux box.