home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / makedce.zip / EXAMPLES.ZIP / examples / Binop / binop.c < prev    next >
C/C++ Source or Header  |  1994-05-08  |  626b  |  24 lines

  1. #include <stdio.h>
  2.  
  3. main(int argc, char *argv[], char *envp[])
  4. {
  5.     char *msg = "Binop Application Completed";
  6.     int i, n, pass, failures=0, PASSES=10, CALLS=10;
  7.  
  8.     for (pass = 1; pass <= PASSES; pass++) {
  9.         printf("PASS (%d):", pass);
  10.         for (i = 1; i <= CALLS; i++) {
  11.             binop_add(i, i, &n);
  12.             if (n != i+i) {
  13.                 printf("Two times %ld is NOT %ld\n", i, n);
  14.                 failures++;
  15.             }
  16.             printf(".");
  17.         }
  18.         printf("\n");
  19.      } 
  20.  
  21.      printf("%s: %d calls, %d failures\n",
  22.              msg, PASSES*CALLS, failures);
  23. }
  24.