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_is_static.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  2.5 KB  |  139 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_IS_STATIC
  5. creation {ANY}
  6.    make
  7. feature {ANY}
  8.    
  9.    make is
  10.       local
  11.      b_true, b_false: BOOLEAN;
  12.       do
  13.      b_true := true;
  14.      b_false := false;
  15.      if true then
  16.         always_run;
  17.      else
  18.         c_inline_c("*** never run ***");
  19.      end;
  20.      if false then
  21.         c_inline_c("*** never run ***");
  22.      else
  23.         always_run;
  24.      end;
  25.      if false then
  26.         c_inline_c("*** never run ***");
  27.      elseif true then
  28.         always_run;
  29.      else
  30.         c_inline_c("*** never run ***");
  31.      end;
  32.      if 3 = 3 then
  33.         always_run;
  34.      else
  35.         c_inline_c("*** never run ***");
  36.      end;
  37.      if always_false then
  38.         is_true(false);
  39.      end;
  40.      if always_true then
  41.         always_run;
  42.      end;
  43.      if true then
  44.         always_run;
  45.      else
  46.      end;
  47.      if false then
  48.      else
  49.         always_run;
  50.      end;
  51.      if false then
  52.         c_inline_c("*** never run ***");
  53.      elseif false then
  54.         c_inline_c("*** never run ***");
  55.      elseif true then
  56.         always_run;
  57.      elseif true then
  58.         c_inline_c("*** never run ***");
  59.      else
  60.         c_inline_c("*** never run ***");
  61.      end;
  62.      if false then
  63.         c_inline_c("*** never run ***");
  64.      elseif false then
  65.         c_inline_c("*** never run ***");
  66.      elseif true then
  67.         always_run;
  68.      elseif b_true then
  69.         c_inline_c("*** never run ***");
  70.      else
  71.         c_inline_c("*** never run ***");
  72.      end;
  73.      if b_false then
  74.         is_true(false);
  75.      elseif false then
  76.         c_inline_c("*** never run ***");
  77.      elseif true then
  78.         always_run;
  79.      elseif b_true then
  80.         c_inline_c("*** never run ***");
  81.      else
  82.         c_inline_c("*** never run ***");
  83.      end;
  84.      if false then
  85.         c_inline_c("*** never run ***");
  86.      elseif always_false then
  87.         is_true(false);
  88.      else
  89.         always_run;
  90.      end;
  91.      if b_true then
  92.         always_run;
  93.      elseif always_false then
  94.         is_true(false);
  95.      elseif always_false then
  96.         is_true(false);
  97.      else
  98.         is_true(false);
  99.      end;
  100.      if 4 \\ 2 = 0 then
  101.         always_run;
  102.      else
  103.         c_inline_c("*** never run ***");
  104.      end;
  105.      if 4 // 2 = 2 then
  106.         always_run;
  107.      else
  108.         c_inline_c("*** never run ***");
  109.      end;
  110.       end;
  111.    
  112.    always_run is
  113.       do
  114.      is_true(true);
  115.       end;
  116.    
  117.    always_true: BOOLEAN is
  118.       do
  119.      Result := true;
  120.       end;
  121.    
  122.    always_false: BOOLEAN is do end;
  123.    
  124.    is_true(b: BOOLEAN) is
  125.       do
  126.      cpt := cpt + 1;
  127.      if not b then
  128.         std_output.put_string("TEST_IS_STATIC: ERROR Test # ");
  129.         std_output.put_integer(cpt);
  130.         std_output.put_string("%N");
  131.      else
  132.         -- std_output.put_string("Yes%N");
  133.      end;
  134.       end;
  135.    
  136.    cpt: INTEGER;
  137.    
  138. end -- TEST_IS_STATIC
  139.