Test unit code device open and close
Before a device can be tested by one of the test units, it must be opened for access through the interfaces defined in the Programming Interfaces for TUs and Interrupt Handlers section.
Also, when testing is complete, the device must be closed and restored to its original state. The opening and closing of the device for testing presents some problems that must be accounted for in the design of the Test Unit library for the device:
- Errors may occur on the open and close operation, and these must be presented back to the calling applications in a form those applications know how to handle; that is, test unit results.
- Since the calling application will typically run through all or most of the Test Units for a given device, the performance penalty of opening and closing the device for each call to a Test Unit is prohibitive.
- Under different conditions, test units may be run in different combinations and sequences, so the calling application must be able to call the functions which do device open and close independent of the other test functions.