do not assume EXIT_FAILURE is 1
abstracted out some common testing functions