home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_10
/
1010048a
< prev
next >
Wrap
Text File
|
1992-08-12
|
613b
|
34 lines
/* Listing 1 */
#define TEST
#define MAX 10
int target( int a )
{
if ( a < MAX )
return 1;
else
return 0;
}
/******** beginning of test code **********
Leave this code in place even after release to enable
later maintainers (you maybe) to thouroughly test
this module after making modifications.
*/
#if defined( TEST )
main()
{
/* test first path */
if ( target( 0 ) != 1 )
ErrorMsg( "target failed valid test" );
/* test second path */
if ( target( 0 ) != 0 )
ErrorMsg( "target failed invalid test" );
}
#endif /* end of test code */