testCases.h: added error handling.