/tutorial/triangle/version4/example2.e
Specman e | 34 lines | 25 code | 6 blank | 3 comment | 0 complexity | 21bb4b2a9a0c92060b6c9aab8aecb3c1 MD5 | raw file
1class EXAMPLE2 2 3create {ANY} 4 main 5 6feature {ANY} 7 main 8 local 9 t1, t2: TRIANGLE 10 do 11 sedb_breakpoint 12 -- Under sedb, try the 'G' command now. 13 create t1.make(create {POINT}.make(1.0, 2.0), create {POINT}.make(3.0, 4.0), create {POINT}.make(5.0, 6.0)) 14 sedb_breakpoint 15 -- Under sedb, try the 'G' again and check for the number of 16 -- created TRIANGLEs and created POINTs. 17 18 t2 := t1.twin 19 check 20 t1 /= t2 21 t1.is_equal(t2) 22 end 23 t2.copy(t1) 24 io.put_string("[ 25 26 It is a good exercice to run this example with the 27 garbage collector information enabled: 28 Type: 29 compile -gc_info -sedb example2 30 31 ]") 32 end 33 34end -- class EXAMPLE2