PageRenderTime 21ms CodeModel.GetById 1ms app.highlight 15ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/ruby/li_factory_runme.rb

#
Ruby | 38 lines | 22 code | 8 blank | 8 comment | 12 complexity | 7c40f425b98e3b072fee82a0c3064551 MD5 | raw file
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12require 'li_factory'
13
14circle = Li_factory::Geometry.create(Li_factory::Geometry::CIRCLE)
15r = circle.radius()
16if (r != 1.5)
17	raise RuntimeError, "Invalid value for r"
18end
19
20new_circle = circle.clone()
21r = new_circle.radius()
22if (r != 1.5)
23	raise RuntimeError, "Invalid value for r"
24end
25
26point = Li_factory::Geometry.create(Li_factory::Geometry::POINT)
27w = point.width()
28
29if (w != 1.0)
30	raise RuntimeError, "Invalid value for w"
31end
32
33new_point = point.clone()
34w = new_point.width()
35
36if (w != 1.0)
37	raise RuntimeError, "Invalid value for w"
38end