PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1-3-15/SWIG/Examples/test-suite/ruby/constover_runme.rb

#
Ruby | 44 lines | 34 code | 10 blank | 0 comment | 12 complexity | 3795e3afaf7d513e0c53ffa8723812a6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1require 'constover'
 2
 3error = 0
 4
 5p = Constover.test("test")
 6if p != "test"
 7  puts "test failed!"
 8  error = 1
 9end
10
11p = Constover.test_pconst("test")
12if p != "test_pconst"
13  puts "test_pconst failed!"
14  error = 1
15end
16    
17f = Constover::Foo.new
18p = f.test("test")
19if p != "test"
20  print "member-test failed!"
21  error = 1
22end
23
24p = f.test_pconst("test")
25if p != "test_pconst"
26  print "member-test_pconst failed!"
27  error = 1
28end
29
30p = f.test_constm("test")
31if p != "test_constmethod"
32  print "member-test_constm failed!"
33  error = 1
34end
35
36p = f.test_pconstm("test")
37if p != "test_pconstmethod"
38  print "member-test_pconstm failed!"
39  error = 1
40end
41    
42exit(error)
43
44