home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_STANDARD_CLONE
-
- creation {ANY}
- make
-
- feature {ANY}
-
- s1, s2: STRING;
- a1, a2: ANIMAL;
-
- ai1, ai2: ARRAY[INTEGER];
-
- p1, p2: POINT;
- t1, t2: TRIANGLE;
-
- make is
- do
- s1 := "foo";
- s2 := standard_clone(s1);
- is_true(s1 /= s2);
- is_true(standard_equal(s1,s2));
- is_true(equal(s1,s2));
-
- !CAT!a1;
- a2 := standard_clone(a1);
- is_true(a1 /= a2);
- is_true(equal(a1,a2));
- is_true(standard_equal(a1,a2));
-
- ai1 := <<1,2,3>>;
- ai2 := standard_clone(ai1);
- is_true(equal(ai1,ai2));
- is_true(standard_equal(ai1,ai2));
- is_true(ai1 /= ai2);
-
- !!p1.make(1,2);
- p2 := standard_clone(p1);
- is_true(p1 /= p2);
- is_true(p1.x = p2.x);
- is_true(p1.y = p2.y);
- is_true(p1.same_type(p2));
-
- --- **** A SUIVRE
- end;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_STANDARD_CLONE: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- --std_output.put_string("Yes %N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_STANDARD_CLONE
-