PageRenderTime 24ms CodeModel.GetById 8ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/ruby/bools_runme.rb

#
Ruby | 82 lines | 54 code | 17 blank | 11 comment | 26 complexity | dfae08d1ca447e9951051c0c2aa130c6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12
13require 'bools'
14
15# bool constant check
16if (Bools::Constbool != false)
17    print "Runtime test 1 failed\n"
18    exit 1
19end
20
21# bool variables check
22if (Bools.bool1 != true)
23    print "Runtime test 2 failed\n"
24    exit 1
25end
26
27if (Bools.bool2 != false)
28    print "Runtime test 3 failed\n"
29    exit 1
30end
31
32if (Bools.value(Bools.pbool) != Bools.bool1)
33    print "Runtime test 4 failed\n"
34    exit 1
35end
36
37if (Bools.value(Bools.rbool) != Bools.bool2)
38    print "Runtime test 5 failed\n"
39    exit 1
40end
41
42if (Bools.value(Bools.const_pbool) != Bools.bool1)
43    print "Runtime test 6 failed\n"
44    exit 1
45end
46
47if (Bools.const_rbool != Bools.bool2)
48    print "Runtime test 7 failed\n"
49    exit 1
50end
51
52# bool functions check
53if (Bools.bo(false) != false)
54    print "Runtime test 8 failed\n"
55    exit 1
56end
57
58if (Bools.bo(true) != true)
59    print "Runtime test 9 failed\n"
60    exit 1
61end
62
63if (Bools.value(Bools.rbo(Bools.rbool)) != Bools.value(Bools.rbool))
64    print "Runtime test 10 failed\n"
65    exit 1
66end
67
68if (Bools.value(Bools.pbo(Bools.pbool)) != Bools.value(Bools.pbool))
69    print "Runtime test 11 failed\n"
70    exit 1
71end
72
73if (Bools.const_rbo(Bools.const_rbool) != Bools.const_rbool)
74    print "Runtime test 12 failed\n"
75    exit 1
76end
77
78if (Bools.value(Bools.const_pbo(Bools.const_pbool)) != Bools.value(Bools.const_pbool))
79    print "Runtime test 13 failed\n"
80    exit 1
81end
82