MCPcopy Create free account
hub / github.com/KLayout/klayout / test_5_DBox

Method test_5_DBox

testdata/ruby/dbBoxTest.rb:205–226  ·  view source on GitHub ↗

DBox dup, object identity etc.

Source from the content-addressed store, hash-verified

203
204 # DBox dup, object identity etc.
205 def test_5_DBox
206
207 ref1 = RBA::DBox.new( 10, 5, 20, 17 )
208 ref2 = RBA::DBox.new( 10, 5, 20, 17 )
209 ref2.move( RBA::DPoint.new(-0.5, 0.0) )
210
211 box1 = RBA::DBox.new( 10, 5, 20, 17 )
212 box2 = box1
213 box3 = box1.dup
214
215 assert_equal( box1, ref1 )
216 assert_equal( box2, ref1 )
217 assert_equal( box3, ref1 )
218
219 box1.p1 = box1.p1 + RBA::DPoint.new( -0.5, 0.0 )
220 box1.p2 = box1.p2 + RBA::DPoint.new( -0.5, 0.0 )
221
222 assert_equal( box1, ref2 )
223 assert_equal( box2, ref2 )
224 assert_equal( box3, ref1 )
225
226 end
227
228 # DBox dup, object identity etc.
229 def test_6_DBox

Callers

nothing calls this directly

Calls 4

moveMethod · 0.45
dupMethod · 0.45
p1Method · 0.45
p2Method · 0.45

Tested by

no test coverage detected