/* reportframe-test.c test routines for the testing package. * (C) Copyright 1999 by John Halleck * All rights reserved. */ /* Version of August 18th, 1999 */ #include /* Standard IO */ #include "errors.h" /* Common error codes */ #include "reportframe.h" /* The testing package itself. */ /* ========================== MAIN ========================================== */ int main (argc, argv) int argc; char argv[]; { error problem; /* These are really stupid tests, far from complete. */ problem = inittests ("reportframe"); if (problem != NoError) goterrorstat ("Bad return from initialization?", problem); problem = newsection ("argument"); if (problem != NoError) goterrorstat ("Bad return from section?", problem); problem = newtest ("dummy"); if (problem != NoError) goterrorstat ("Bad return from newtest?", problem); if (!progerrors) { /* If things look OK, try tests that should fail. */ /* ... What tests should go here? */ progerrors = 0; } problem = endtest(); if (problem != NoError) goterrorstat ("Bad return from endtest?", problem); problem = newtest ("remark"); if (ERRnil != (problem = remark (0))) goterrorstat ("Didn't notice nil argument.", problem); if (ERRempty != (problem = remark (""))) goterrorstat ("Didn't notice empty argument", problem); if ((problem = remark ("This line is just commentary"))) goterrorstat ("Valid call failed", problem); endtest(); problem = newtest("dummy2"); if (problem != NoError) goterrorstat ("Bad return from newtest 2?", problem); problem = endtest(); if (problem != NoError) goterrorstat ("Bad return from endtest 2?", problem); problem = endsection(); if (problem != NoError) goterrorstat ("Bad return from endsection?", problem); problem = newtest("dummy3"); if (problem != NoError) goterrorstat ("Bad return from newtest 3?", problem); problem = endtest(); if (problem != NoError) goterrorstat ("Bad return from endtest 3?", problem); problem = finalizetests(); if (problem != NoError) { printf ("***\a finalize tests FAILED ************\n"); printerror (problem); } return progerrors; }