Hi All,
I am a noob and have come to draw on the experience to be found here.
I am writing an application to automate test equipment in a manufacturing environment. I have been reading about TDD and unit testing and want to use it on my current project. My question is this: If I create a function that communicates with a piece of test equipment, for example to change the scale of the display, I send a command string to the equipment over the gpib bus. A error code is returned 0 for success or another integer value indicating an error. How do i write my unit test, testing for the 0 for success? It seems to me that is not a good test because the 0 means success but not neccessarily for the action I wanted, but maybe success at changing some other parameter. I thought if I sent a command to set the parameter and then read it back again and compare it to my expected value, then that is actually testing two actions not seperating the test out.
I hope I explained this clearly and someone can help me.
Thank you
Robert