/* reportframe-test.c test routines for the testing package.
* © Copyright 1999 by John Halleck
* All rights reserved.
*/
/* Version of August 18th, 1999 */
#include <stdio.h>
/* 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;
}
This page is http://www.cc.utah.edu/~nahaj/cave/survey/code/c/reportframe-test.c.html
© Copyright 2000 by John Halleck, All Rights Reserved.
This snapshot was last modified on August 23rd, 2000
And the underlying file was last modified on May 11th, 2000