DBox dup, object identity etc.
| 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 |