home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_gcd.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  655 b   |  35 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_GCD
  5.    
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.  
  11.    make is
  12.       do
  13.      is_true((3).gcd(4) = 1);
  14.      is_true((4).gcd(4) = 4);
  15.      is_true((8).gcd(4) = 4);
  16.      is_true((9).gcd(8) = 1);
  17.      is_true((9).gcd(12) = 3);
  18.       end;
  19.      
  20.    is_true(b: BOOLEAN) is
  21.       do
  22.      cpt := cpt + 1;
  23.      if not b then
  24.         std_output.put_string("TEST_GCD: ERROR Test # ");
  25.         std_output.put_integer(cpt);
  26.         std_output.put_string("%N");
  27.      else
  28.         -- std_output.put_string("Yes%N");
  29.      end;
  30.       end;
  31.    
  32.    cpt: INTEGER;
  33.    
  34. end -- TEST_GCD
  35.