home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog_oth / debugutl.lha / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-21  |  1.7 KB  |  122 lines

  1. /*                                    FILE:    test.c
  2.  *
  3.  *    Project:            Debug Utilities
  4.  *    Version:            v1.1
  5.  *
  6.  *
  7.  * This file contains:
  8.  *
  9.  *                        1.    main()
  10.  *                        2. func1()
  11.  *                        3. func2()
  12.  *
  13.  *
  14.  * Created:            Thursday 07-May-92 22:15:44
  15.  * Author:        Mark Porter (fog)
  16.  *
  17.  *
  18.  *    Copyright © 1992 if...only Amiga
  19.  *
  20.  *    Permission is granted to distribute this program's source, executable,
  21.  *    and documentation for non-commercial use only, provided the copyright
  22.  *    and header information are left intact.
  23.  *
  24.  */
  25.  
  26.  
  27.  
  28. #include    "debug.h"
  29.  
  30. void func1(),func2();
  31.  
  32.  
  33.  
  34. /*------------ main() ------------
  35.  *
  36.  *
  37.  * FUNCTION:    Tests the trace.lib debugging utilities.
  38.  *
  39.  * ARGUMENTS:    Standard command line arguments.
  40.  *
  41.  * RETURNS:        Nothing.
  42.  *
  43.  * COMMENTS:    
  44.  *
  45.  */
  46.  
  47. main( argc,argv )
  48.     int    argc;
  49.     char *argv[];
  50. {
  51.     ENTER( "main" );
  52.  
  53.     DB( Trace( 0,"main","First Message to appear\n" ));
  54.  
  55.     func1();
  56.     func2();
  57.  
  58.     DB( Trace( 0,"main","About to exit to AmigaDos\n" ));
  59.  
  60.     EXIT( "main" );
  61. }
  62.  
  63.  
  64.  
  65. /*------------ func1() ------------
  66.  *
  67.  *
  68.  * FUNCTION:    Tries out some of the DB_Level options.
  69.  *
  70.  * ARGUMENTS:    None.
  71.  *
  72.  * RETURNS:        Nothing.
  73.  *
  74.  * COMMENTS:    
  75.  *
  76.  */
  77.  
  78. void func1()
  79. {
  80.     int    i;
  81.     int    num = 1234;
  82.     float x     = 45.678;
  83.  
  84.     ENTER( "func1" );
  85.  
  86.     DB( Trace( 0,"func1","Testing Floating Point x = %3.2f\n",x ));
  87.     DB( Trace( 0,"func1","About to enter loop\n" ));
  88.  
  89.     for ( i = 0; i < 10; i++ )
  90.     {
  91.         DB( Trace( 1,"func1","Looping, i = %d\n",i ));
  92.  
  93.         DB( Trace( i,"func1","Incrementing DB_Level, num = %d\n",num ));
  94.     }
  95.  
  96.     EXIT( "func1" );
  97. }
  98.  
  99.  
  100.  
  101. /*------------ func2() ------------
  102.  *
  103.  *
  104.  * FUNCTION:    Tries out some more of the DB_Level options.
  105.  *
  106.  * ARGUMENTS:    None.
  107.  *
  108.  * RETURNS:        Nothing.
  109.  *
  110.  * COMMENTS:    
  111.  *
  112.  */
  113.  
  114. void func2()
  115. {
  116.     ENTER( "func2" );
  117.  
  118.     DB( Trace( 0,"func2","Printing this message\n" ));
  119.  
  120.     EXIT( "func2" );
  121. }
  122.