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_standard_clone.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.2 KB  |  64 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_STANDARD_CLONE
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    s1, s2: STRING;
  12.    a1, a2: ANIMAL;
  13.    
  14.    ai1, ai2: ARRAY[INTEGER];
  15.    
  16.    p1, p2: POINT;
  17.    t1, t2: TRIANGLE;
  18.    
  19.    make is
  20.       do
  21.      s1 := "foo";
  22.      s2 := standard_clone(s1);
  23.      is_true(s1 /= s2);
  24.      is_true(standard_equal(s1,s2));
  25.      is_true(equal(s1,s2));
  26.      
  27.      !CAT!a1;
  28.      a2 := standard_clone(a1);
  29.      is_true(a1 /= a2);
  30.      is_true(equal(a1,a2));
  31.      is_true(standard_equal(a1,a2));
  32.      
  33.      ai1 := <<1,2,3>>;
  34.      ai2 := standard_clone(ai1);
  35.      is_true(equal(ai1,ai2));
  36.      is_true(standard_equal(ai1,ai2));
  37.      is_true(ai1 /= ai2);
  38.      
  39.      !!p1.make(1,2);
  40.      p2 := standard_clone(p1);
  41.      is_true(p1 /= p2);
  42.      is_true(p1.x = p2.x);
  43.      is_true(p1.y = p2.y);
  44.      is_true(p1.same_type(p2));
  45.      
  46.      --- **** A SUIVRE 
  47.       end;
  48.    
  49.    is_true(b: BOOLEAN) is
  50.       do
  51.      cpt := cpt + 1;
  52.      if not b then
  53.         std_output.put_string("TEST_STANDARD_CLONE: ERROR Test # ");
  54.         std_output.put_integer(cpt);
  55.         std_output.put_string("%N");
  56.      else
  57.         --std_output.put_string("Yes %N");
  58.      end;
  59.       end;
  60.    
  61.    cpt: INTEGER;
  62.    
  63. end -- TEST_STANDARD_CLONE
  64.