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 >
Text File  |  1992-08-12  |  613b  |  34 lines

  1. /* Listing 1 */
  2.  
  3. #define TEST
  4. #define MAX 10
  5.  
  6. int  target( int a )
  7. {
  8.      if ( a < MAX )
  9.           return 1;
  10.      else
  11.           return 0;
  12. }
  13.  
  14.  
  15. /******** beginning of test code **********
  16. Leave this code in place even after release to enable
  17. later maintainers (you maybe) to thouroughly test
  18. this module after making modifications.
  19. */
  20.  
  21. #if defined( TEST )
  22.  
  23. main()
  24. {
  25.      /* test first path */
  26.      if ( target( 0 ) != 1 )
  27.           ErrorMsg( "target failed valid test" );
  28.  
  29.      /* test second path */
  30.      if ( target( 0 ) != 0 )
  31.           ErrorMsg( "target failed invalid test" );
  32. }
  33. #endif /* end of test code */
  34.