r2corba 1.5.4 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -2
  3. data/ext/libr2tao/any.cpp +11 -10
  4. data/ext/libr2tao/exception.cpp +6 -8
  5. data/ext/libr2tao/exception.h +1 -1
  6. data/ext/libr2tao/longdouble.cpp +5 -9
  7. data/ext/libr2tao/object.cpp +37 -53
  8. data/ext/libr2tao/orb.cpp +46 -73
  9. data/ext/libr2tao/r2tao_ext.h +8 -19
  10. data/ext/libr2tao/required.cpp +3 -8
  11. data/ext/libr2tao/required.h +18 -34
  12. data/ext/libr2tao/values.cpp +97 -98
  13. data/ext/libr2tao/values.h +35 -37
  14. data/ext/librpoa/iortable.cpp +6 -7
  15. data/ext/librpoa/poa.cpp +29 -32
  16. data/ext/librpoa/servant.cpp +39 -113
  17. data/ext/librpoa/servant.h +18 -40
  18. data/lib/corba/cbase/ORB.rb +26 -23
  19. data/lib/corba/cbase/Request.rb +3 -3
  20. data/lib/corba/cbase/Streams.rb +2 -2
  21. data/lib/corba/cbase/Typecode.rb +6 -6
  22. data/lib/corba/cbase/Values.rb +4 -2
  23. data/lib/corba/cbase/exception.rb +6 -4
  24. data/lib/corba/cbase/poa.rb +1 -1
  25. data/lib/corba/cbase/policies.rb +2 -2
  26. data/lib/corba/cbase/require.rb +8 -1
  27. data/lib/corba/cmds/base.rb +1 -1
  28. data/lib/corba/common/Any.rb +3 -2
  29. data/lib/corba/common/IDL.rb +1 -1
  30. data/lib/corba/common/ORB.rb +22 -22
  31. data/lib/corba/common/Object.rb +14 -14
  32. data/lib/corba/common/Servant.rb +4 -4
  33. data/lib/corba/common/Stub.rb +6 -6
  34. data/lib/corba/common/Typecode.rb +69 -42
  35. data/lib/corba/common/Union.rb +5 -0
  36. data/lib/corba/common/Values.rb +1 -0
  37. data/lib/corba/common/const.rb +2 -2
  38. data/lib/corba/common/exception.rb +2 -1
  39. data/lib/corba/common/version.rb +2 -2
  40. data/lib/corba/idl/IDL.rb +1 -1
  41. data/lib/corba/jbase/Any.rb +28 -26
  42. data/lib/corba/jbase/ORB.rb +5 -5
  43. data/lib/corba/jbase/Object.rb +13 -13
  44. data/lib/corba/jbase/Request.rb +8 -8
  45. data/lib/corba/jbase/Servant.rb +10 -10
  46. data/lib/corba/jbase/ServerRequest.rb +7 -7
  47. data/lib/corba/jbase/Streams.rb +67 -3
  48. data/lib/corba/jbase/Typecode.rb +17 -16
  49. data/lib/corba/jbase/Values.rb +2 -0
  50. data/lib/corba/jbase/exception.rb +2 -1
  51. data/lib/corba/jbase/poa.rb +20 -20
  52. data/lib/corba/jbase/policies.rb +32 -32
  53. data/lib/corba/jbase/require.rb +4 -0
  54. data/lib/corba/poa.rb +1 -1
  55. data/lib/corba/policies.rb +1 -1
  56. data/lib/corba/require.rb +2 -2
  57. data/lib/corba/svcs/ins/cos_naming.rb +37 -28
  58. data/lib/corba/svcs/ins/ins.rb +51 -51
  59. data/lib/corba/svcs/ins/naming_service.rb +8 -8
  60. data/lib/corba.rb +1 -1
  61. data/lib/ridlbe/ruby/config.rb +37 -30
  62. data/lib/ridlbe/ruby/walker.rb +295 -272
  63. data/mkrf_conf_srcgem.rb +6 -6
  64. data/rakelib/bin.rake +1 -1
  65. data/rakelib/bin.rb +3 -3
  66. data/rakelib/build.rake +16 -16
  67. data/rakelib/config.rake +1 -1
  68. data/rakelib/config.rb +22 -22
  69. data/rakelib/ext.rake +7 -68
  70. data/rakelib/ext.rb +15 -15
  71. data/rakelib/ext_r2tao.rb +12 -55
  72. data/rakelib/gem.rake +25 -25
  73. data/rakelib/gem.rb +6 -6
  74. data/rakelib/package.rake +1 -1
  75. data/test/BiDirectional/client.rb +17 -17
  76. data/test/BiDirectional/run_test.rb +11 -11
  77. data/test/BiDirectional/server.rb +24 -25
  78. data/test/CORBA_Services/Naming/BindingIterator/client.rb +17 -17
  79. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +13 -13
  80. data/test/CORBA_Services/Naming/BindingIterator/server.rb +19 -19
  81. data/test/CORBA_Services/Naming/Corbaname/client.rb +15 -15
  82. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +13 -13
  83. data/test/CORBA_Services/Naming/Corbaname/server.rb +30 -30
  84. data/test/CORBA_Services/Naming/Simple/client.rb +16 -16
  85. data/test/CORBA_Services/Naming/Simple/run_test.rb +13 -13
  86. data/test/CORBA_Services/Naming/Simple/server.rb +19 -19
  87. data/test/Collocation/run_test.rb +10 -10
  88. data/test/Collocation/test.rb +27 -20
  89. data/test/Connect_Timeout/client.rb +16 -17
  90. data/test/Connect_Timeout/run_test.rb +10 -10
  91. data/test/DII/client.rb +30 -30
  92. data/test/DII/run_test.rb +11 -11
  93. data/test/DII/server.rb +16 -16
  94. data/test/DSI/client.rb +16 -16
  95. data/test/DSI/run_test.rb +11 -11
  96. data/test/DSI/server.rb +17 -17
  97. data/test/Exceptions/client.rb +21 -21
  98. data/test/Exceptions/run_test.rb +11 -11
  99. data/test/Exceptions/server.rb +16 -16
  100. data/test/Hello/client.rb +16 -16
  101. data/test/Hello/run_test.rb +11 -11
  102. data/test/Hello/server.rb +17 -17
  103. data/test/IDL_Test/client.rb +21 -21
  104. data/test/IDL_Test/run_test.rb +11 -11
  105. data/test/IDL_Test/server.rb +19 -19
  106. data/test/IORMap/client.rb +14 -14
  107. data/test/IORMap/run_test.rb +11 -11
  108. data/test/IORMap/server.rb +26 -26
  109. data/test/IORTable/client.rb +14 -14
  110. data/test/IORTable/run_test.rb +11 -11
  111. data/test/IORTable/server.rb +26 -26
  112. data/test/Implicit_Conversion/client.rb +20 -17
  113. data/test/Implicit_Conversion/run_test.rb +11 -11
  114. data/test/Implicit_Conversion/server.rb +16 -16
  115. data/test/Multi_Threading/Multiple_ORB/client.rb +14 -14
  116. data/test/Multi_Threading/Multiple_ORB/run_test.rb +12 -12
  117. data/test/Multi_Threading/Multiple_ORB/server.rb +17 -17
  118. data/test/Multi_Threading/Simple/client.rb +17 -17
  119. data/test/Multi_Threading/Simple/run_test.rb +11 -11
  120. data/test/Multi_Threading/Simple/server.rb +16 -16
  121. data/test/Multi_Threading/Threads/client.rb +16 -16
  122. data/test/Multi_Threading/Threads/run_test.rb +11 -11
  123. data/test/Multi_Threading/Threads/server.rb +22 -22
  124. data/test/Multi_Threading/Threads/watchdog.rb +16 -16
  125. data/test/Multiple_Servant_Interfaces/client.rb +14 -14
  126. data/test/Multiple_Servant_Interfaces/run_test.rb +11 -11
  127. data/test/Multiple_Servant_Interfaces/server.rb +18 -18
  128. data/test/Nil/run_test.rb +10 -10
  129. data/test/Nil/test.rb +14 -15
  130. data/test/OBV/AbstractInterface/client.rb +14 -14
  131. data/test/OBV/AbstractInterface/run_test.rb +11 -11
  132. data/test/OBV/AbstractInterface/server.rb +20 -19
  133. data/test/OBV/Custom/OBV_impl.rb +2 -0
  134. data/test/OBV/Custom/client.rb +14 -14
  135. data/test/OBV/Custom/run_test.rb +11 -11
  136. data/test/OBV/Custom/server.rb +16 -16
  137. data/test/OBV/Simple/OBV_impl.rb +1 -0
  138. data/test/OBV/Simple/client.rb +14 -14
  139. data/test/OBV/Simple/run_test.rb +11 -11
  140. data/test/OBV/Simple/server.rb +16 -16
  141. data/test/OBV/Simple_Event/Event_impl.rb +1 -0
  142. data/test/OBV/Simple_Event/client.rb +14 -14
  143. data/test/OBV/Simple_Event/run_test.rb +11 -11
  144. data/test/OBV/Simple_Event/server.rb +16 -16
  145. data/test/OBV/Supports/client.rb +19 -19
  146. data/test/OBV/Supports/run_test.rb +11 -11
  147. data/test/OBV/Supports/server.rb +15 -15
  148. data/test/OBV/Supports/supports_impl.rb +3 -0
  149. data/test/OBV/Tree/client.rb +14 -14
  150. data/test/OBV/Tree/run_test.rb +11 -11
  151. data/test/OBV/Tree/server.rb +19 -19
  152. data/test/OBV/Truncatable/Truncatable_impl.rb +1 -1
  153. data/test/OBV/Truncatable/client.rb +57 -57
  154. data/test/OBV/Truncatable/run_test.rb +11 -11
  155. data/test/OBV/Truncatable/server.rb +15 -15
  156. data/test/OBV/ValueBox/client.rb +154 -153
  157. data/test/OBV/ValueBox/run_test.rb +11 -11
  158. data/test/OBV/ValueBox/server.rb +42 -42
  159. data/test/Object/client.rb +15 -15
  160. data/test/Object/run_test.rb +11 -11
  161. data/test/Object/server.rb +19 -19
  162. data/test/POA/run_test.rb +10 -10
  163. data/test/POA/test.rb +16 -16
  164. data/test/Param_Test/client.rb +51 -51
  165. data/test/Param_Test/run_test.rb +11 -11
  166. data/test/Param_Test/server.rb +59 -59
  167. data/test/Performance/Simple/client.rb +16 -16
  168. data/test/Performance/Simple/run_test.rb +11 -11
  169. data/test/Performance/Simple/server.rb +16 -16
  170. data/test/Policies/run_test.rb +10 -10
  171. data/test/Policies/test.rb +23 -24
  172. data/test/Timeout/client.rb +21 -21
  173. data/test/Timeout/run_test.rb +11 -11
  174. data/test/Timeout/server.rb +22 -22
  175. data/test/lib/assert.rb +0 -1
  176. data/test/lib/test.rb +28 -23
  177. data/test/test_runner.rb +21 -22
  178. metadata +6 -9
  179. data/ext/extload/extload.c +0 -60
  180. data/ext/librpoa/srvreq_fix.cpp +0 -282
  181. data/ext/librpoa/srvreq_fix.h +0 -148
@@ -21,22 +21,22 @@ ARGV.options do |opts|
21
21
  script_name = File.basename($0)
22
22
  opts.banner = "Usage: ruby #{script_name} [options]"
23
23
 
24
- opts.separator ""
24
+ opts.separator ''
25
25
 
26
- opts.on("--o IORFILE",
27
- "Set IOR filename.",
28
- "Default: 'server.ior'") { |v| OPTIONS[:iorfile]=v }
29
- opts.on("--d LVL",
30
- "Set ORBDebugLevel value.",
31
- "Default: 0") { |v| OPTIONS[:orb_debuglevel]=v }
32
- opts.on("--use-implement",
33
- "Load IDL through CORBA.implement() instead of precompiled code.",
34
- "Default: off") { |v| OPTIONS[:use_implement]=v }
26
+ opts.on('--o IORFILE',
27
+ 'Set IOR filename.',
28
+ "Default: 'server.ior'") { |v| OPTIONS[:iorfile] = v }
29
+ opts.on('--d LVL',
30
+ 'Set ORBDebugLevel value.',
31
+ 'Default: 0') { |v| OPTIONS[:orb_debuglevel] = v }
32
+ opts.on('--use-implement',
33
+ 'Load IDL through CORBA.implement() instead of precompiled code.',
34
+ 'Default: off') { |v| OPTIONS[:use_implement] = v }
35
35
 
36
- opts.separator ""
36
+ opts.separator ''
37
37
 
38
- opts.on("-h", "--help",
39
- "Show this help message.") { puts opts; exit }
38
+ opts.on('-h', '--help',
39
+ 'Show this help message.') { puts opts; exit }
40
40
 
41
41
  opts.parse!
42
42
  end
@@ -60,9 +60,9 @@ class MyHello < POA::Test::Hello
60
60
  def shutdown()
61
61
  @orb.shutdown()
62
62
  end
63
- end #of servant MyHello
63
+ end # of servant MyHello
64
64
 
65
- orb = CORBA.ORB_init(["-ORBDebugLevel", OPTIONS[:orb_debuglevel]], 'myORB')
65
+ orb = CORBA.ORB_init(['-ORBDebugLevel', OPTIONS[:orb_debuglevel]], 'myORB')
66
66
 
67
67
  obj = orb.resolve_initial_references('RootPOA')
68
68
 
@@ -83,7 +83,7 @@ open(OPTIONS[:iorfile], 'w') { |io|
83
83
  }
84
84
 
85
85
  Signal.trap('INT') do
86
- puts "SIGINT - shutting down ORB..."
86
+ puts 'SIGINT - shutting down ORB...'
87
87
  orb.shutdown()
88
88
  end
89
89
 
@@ -20,19 +20,19 @@ ARGV.options do |opts|
20
20
  script_name = File.basename($0)
21
21
  opts.banner = "Usage: ruby #{script_name} [options]"
22
22
 
23
- opts.separator ""
23
+ opts.separator ''
24
24
 
25
- opts.on("-d",
26
- "Run with debugging output.",
27
- "Default: false") { OPTIONS[:debug_opt] = '--d 10' }
28
- opts.on("--use-stubs",
29
- "Use stubs generated by RIDL.",
30
- "Default: false (uses embedded IDL)") { OPTIONS[:use_implement] = '' }
25
+ opts.on('-d',
26
+ 'Run with debugging output.',
27
+ 'Default: false') { OPTIONS[:debug_opt] = '--d 10' }
28
+ opts.on('--use-stubs',
29
+ 'Use stubs generated by RIDL.',
30
+ 'Default: false (uses embedded IDL)') { OPTIONS[:use_implement] = '' }
31
31
 
32
- opts.separator ""
32
+ opts.separator ''
33
33
 
34
- opts.on("-h", "--help",
35
- "Show this help message.") { puts opts; exit }
34
+ opts.on('-h', '--help',
35
+ 'Show this help message.') { puts opts; exit }
36
36
 
37
37
  opts.parse!
38
38
  end
@@ -22,19 +22,19 @@ ARGV.options do |opts|
22
22
  script_name = File.basename($0)
23
23
  opts.banner = "Usage: ruby #{script_name} [options]"
24
24
 
25
- opts.separator ""
25
+ opts.separator ''
26
26
 
27
- opts.on("--d LVL",
28
- "Set ORBDebugLevel value.",
29
- "Default: 0") { |v| OPTIONS[:orb_debuglevel]=v }
30
- opts.on("--use-implement",
31
- "Load IDL through CORBA.implement() instead of precompiled code.",
32
- "Default: off") { |v| OPTIONS[:use_implement]=v }
27
+ opts.on('--d LVL',
28
+ 'Set ORBDebugLevel value.',
29
+ 'Default: 0') { |v| OPTIONS[:orb_debuglevel] = v }
30
+ opts.on('--use-implement',
31
+ 'Load IDL through CORBA.implement() instead of precompiled code.',
32
+ 'Default: off') { |v| OPTIONS[:use_implement] = v }
33
33
 
34
- opts.separator ""
34
+ opts.separator ''
35
35
 
36
- opts.on("-h", "--help",
37
- "Show this help message.") { puts opts; exit }
36
+ opts.on('-h', '--help',
37
+ 'Show this help message.') { puts opts; exit }
38
38
 
39
39
  opts.parse!
40
40
  end
@@ -53,24 +53,24 @@ class MyHello < POA::Test::Hello
53
53
  end
54
54
 
55
55
  def get_string()
56
- "Hello there!"
56
+ 'Hello there!'
57
57
  end
58
58
 
59
59
  def shutdown()
60
60
  @orb.shutdown()
61
61
  end
62
- end #of servant MyHello
62
+ end # of servant MyHello
63
63
 
64
64
  if defined?(JRUBY_VERSION)
65
65
  ## JacORB needs explicit activation of this option
66
66
  props = {
67
- "org.omg.PortableInterceptor.ORBInitializerClass.bidir_init" =>
68
- "org.jacorb.orb.giop.BiDirConnectionInitializer"
67
+ 'org.omg.PortableInterceptor.ORBInitializerClass.bidir_init' =>
68
+ 'org.jacorb.orb.giop.BiDirConnectionInitializer'
69
69
  }
70
70
  else
71
71
  props = {}
72
72
  end
73
- orb = CORBA.ORB_init(["-ORBDebugLevel", OPTIONS[:orb_debuglevel]], 'myORB', props)
73
+ orb = CORBA.ORB_init(['-ORBDebugLevel', OPTIONS[:orb_debuglevel]], 'myORB', props)
74
74
 
75
75
  begin
76
76
 
@@ -81,31 +81,31 @@ begin
81
81
  assert_not 'Failed to resolve RootPOA', CORBA.is_nil(rootpoa) || !rootpoa.is_a?(PortableServer::POA)
82
82
 
83
83
  pol = rootpoa.create_thread_policy(PortableServer::SINGLE_THREAD_MODEL)
84
- assert 'Failed to create correct policy' ,
84
+ assert 'Failed to create correct policy',
85
85
  !pol.nil? and pol.is_a?(PortableServer::ThreadPolicy) and pol.value == PortableServer::SINGLE_THREAD_MODEL
86
86
 
87
87
  pol = rootpoa.create_lifespan_policy(PortableServer::PERSISTENT)
88
- assert 'Failed to create correct policy' ,
88
+ assert 'Failed to create correct policy',
89
89
  !pol.nil? and pol.is_a?(PortableServer::LifespanPolicy) and pol.value == PortableServer::PERSISTENT
90
90
 
91
91
  pol = rootpoa.create_id_uniqueness_policy(PortableServer::UNIQUE_ID)
92
- assert 'Failed to create correct policy' ,
92
+ assert 'Failed to create correct policy',
93
93
  !pol.nil? and pol.is_a?(PortableServer::IdUniquenessPolicy) and pol.value == PortableServer::UNIQUE_ID
94
94
 
95
95
  pol = rootpoa.create_id_assignment_policy(PortableServer::USER_ID)
96
- assert 'Failed to create correct policy' ,
96
+ assert 'Failed to create correct policy',
97
97
  !pol.nil? and pol.is_a?(PortableServer::IdAssignmentPolicy) and pol.value == PortableServer::USER_ID
98
98
 
99
99
  pol = rootpoa.create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION)
100
- assert 'Failed to create correct policy' ,
100
+ assert 'Failed to create correct policy',
101
101
  !pol.nil? and pol.is_a?(PortableServer::ImplicitActivationPolicy) and pol.value == PortableServer::NO_IMPLICIT_ACTIVATION
102
102
 
103
103
  pol = rootpoa.create_servant_retention_policy(PortableServer::RETAIN)
104
- assert 'Failed to create correct policy' ,
104
+ assert 'Failed to create correct policy',
105
105
  !pol.nil? and pol.is_a?(PortableServer::ServantRetentionPolicy) and pol.value == PortableServer::RETAIN
106
106
 
107
107
  pol = rootpoa.create_request_processing_policy(PortableServer::USE_DEFAULT_SERVANT)
108
- assert 'Failed to create correct policy' ,
108
+ assert 'Failed to create correct policy',
109
109
  !pol.nil? and pol.is_a?(PortableServer::RequestProcessingPolicy) and pol.value == PortableServer::USE_DEFAULT_SERVANT
110
110
 
111
111
  assert_except('orb.create_policy should have thrown a PolicyError',
@@ -113,7 +113,7 @@ begin
113
113
 
114
114
  pol = orb.create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
115
115
  CORBA::Any.to_any(BiDirPolicy::BOTH, BiDirPolicy::BidirectionalPolicyValue._tc))
116
- assert 'Failed to create correct policy' ,
116
+ assert 'Failed to create correct policy',
117
117
  !pol.nil? and pol.is_a?(BiDirPolicy) and pol.value == BiDirPolicy::BOTH
118
118
 
119
119
  poa_man = rootpoa.the_POAManager
@@ -140,4 +140,3 @@ begin
140
140
  ensure
141
141
  orb.destroy()
142
142
  end
143
-
@@ -23,22 +23,22 @@ ARGV.options do |opts|
23
23
  script_name = File.basename($0)
24
24
  opts.banner = "Usage: ruby #{script_name} [options]"
25
25
 
26
- opts.separator ""
26
+ opts.separator ''
27
27
 
28
- opts.on("--k IORFILE",
29
- "Set IOR.",
30
- "Default: 'file://server.ior'") { |v| OPTIONS[:iorfile]=v }
31
- opts.on("--d LVL",
32
- "Set ORBDebugLevel value.",
33
- "Default: 0", Integer) { |v| OPTIONS[:orb_debuglevel]=v }
34
- opts.on("--use-implement",
35
- "Load IDL through CORBA.implement() instead of precompiled code.",
36
- "Default: off") { |v| OPTIONS[:use_implement]=v }
28
+ opts.on('--k IORFILE',
29
+ 'Set IOR.',
30
+ "Default: 'file://server.ior'") { |v| OPTIONS[:iorfile] = v }
31
+ opts.on('--d LVL',
32
+ 'Set ORBDebugLevel value.',
33
+ 'Default: 0', Integer) { |v| OPTIONS[:orb_debuglevel] = v }
34
+ opts.on('--use-implement',
35
+ 'Load IDL through CORBA.implement() instead of precompiled code.',
36
+ 'Default: off') { |v| OPTIONS[:use_implement] = v }
37
37
 
38
- opts.separator ""
38
+ opts.separator ''
39
39
 
40
- opts.on("-h", "--help",
41
- "Show this help message.") { puts opts; exit }
40
+ opts.on('-h', '--help',
41
+ 'Show this help message.') { puts opts; exit }
42
42
 
43
43
  opts.parse!
44
44
  end
@@ -55,7 +55,7 @@ Min_timeout = 0
55
55
  Max_timeout = 20
56
56
 
57
57
  None, Orb1, Thread1, Object1 = (0..3).to_a
58
- To_type_names = [ "none", "orb", "thread", "object" ]
58
+ To_type_names = ['none', 'orb', 'thread', 'object']
59
59
 
60
60
  Timeout_count = [0, 0, 0, 0]
61
61
  In_time_count = [0, 0, 0, 0]
@@ -69,7 +69,7 @@ def send_echo (ctype, orb, server, t)
69
69
  Timeout_count[ctype] += 1
70
70
 
71
71
  # Trap this exception and continue...
72
- puts "==> Trapped a TIMEOUT exception (expected)"
72
+ puts '==> Trapped a TIMEOUT exception (expected)'
73
73
 
74
74
  # Sleep so the server can send the reply...
75
75
  tv = Max_timeout / 1000.0 # max_timeout is in msec, so get seconds
@@ -82,12 +82,12 @@ def send_echo (ctype, orb, server, t)
82
82
  # This is a non-standard TAO call that's used to give the
83
83
  # client ORB a chance to cleanup the reply that's come back
84
84
  # from the server.
85
- #orb.run(tv)
85
+ # orb.run(tv)
86
86
  end
87
87
  end
88
88
 
89
89
 
90
- orb = CORBA.ORB_init(["-ORBDebugLevel", OPTIONS[:orb_debuglevel]], 'myORB')
90
+ orb = CORBA.ORB_init(['-ORBDebugLevel', OPTIONS[:orb_debuglevel]], 'myORB')
91
91
 
92
92
  begin
93
93
 
@@ -113,8 +113,8 @@ begin
113
113
  mid_value = 10000 * (Min_timeout + Max_timeout) / 2 # convert from msec to "TimeT" (0.1 usec units)
114
114
 
115
115
  any_orb = CORBA::Any.to_any(mid_value, TimeBase::TimeT._tc)
116
- any_thread = CORBA::Any.to_any(mid_value+10000, TimeBase::TimeT._tc) # midvalue + 1 msec
117
- any_object = CORBA::Any.to_any(mid_value+20000, TimeBase::TimeT._tc) # midvalue + 2 msec
116
+ any_thread = CORBA::Any.to_any(mid_value + 10000, TimeBase::TimeT._tc) # midvalue + 1 msec
117
+ any_object = CORBA::Any.to_any(mid_value + 20000, TimeBase::TimeT._tc) # midvalue + 2 msec
118
118
 
119
119
  policies = []
120
120
  policies << orb.create_policy(Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, any_object)
@@ -129,7 +129,7 @@ begin
129
129
  puts "client (#{Process.pid}) testing from #{Min_timeout} to #{Max_timeout} milliseconds"
130
130
 
131
131
  for t in Min_timeout...Max_timeout
132
- puts ""
132
+ puts ''
133
133
  puts "client (#{Process.pid}) ================================"
134
134
  puts "client (#{Process.pid}) Trying with timeout = #{t} msec"
135
135
 
@@ -187,7 +187,7 @@ begin
187
187
  for i in 0..3
188
188
  timeout_count_total += Timeout_count[i]
189
189
  in_time_count_total += In_time_count[i]
190
- puts "client (#{Process.pid}) in_time_count[#{To_type_names[i]}]= #{In_time_count[i]} "+
190
+ puts "client (#{Process.pid}) in_time_count[#{To_type_names[i]}]= #{In_time_count[i]} " +
191
191
  "timeout_count[#{To_type_names[i]}]= #{Timeout_count[i]}"
192
192
  end
193
193
 
@@ -20,19 +20,19 @@ ARGV.options do |opts|
20
20
  script_name = File.basename($0)
21
21
  opts.banner = "Usage: ruby #{script_name} [options]"
22
22
 
23
- opts.separator ""
23
+ opts.separator ''
24
24
 
25
- opts.on("-d",
26
- "Run with debugging output.",
27
- "Default: false") { OPTIONS[:debug_opt] = '--d 10' }
28
- opts.on("--use-stubs",
29
- "Use stubs generated by RIDL.",
30
- "Default: false (uses embedded IDL)") { OPTIONS[:use_implement] = '' }
25
+ opts.on('-d',
26
+ 'Run with debugging output.',
27
+ 'Default: false') { OPTIONS[:debug_opt] = '--d 10' }
28
+ opts.on('--use-stubs',
29
+ 'Use stubs generated by RIDL.',
30
+ 'Default: false (uses embedded IDL)') { OPTIONS[:use_implement] = '' }
31
31
 
32
- opts.separator ""
32
+ opts.separator ''
33
33
 
34
- opts.on("-h", "--help",
35
- "Show this help message.") { puts opts; exit }
34
+ opts.on('-h', '--help',
35
+ 'Show this help message.') { puts opts; exit }
36
36
 
37
37
  opts.parse!
38
38
  end
@@ -59,7 +59,7 @@ end
59
59
 
60
60
  exrc = clt.wait(400)
61
61
 
62
- if exrc ==0
62
+ if exrc == 0
63
63
  srv.wait(400)
64
64
  else
65
65
  srv.wait_term(400)
@@ -22,25 +22,25 @@ ARGV.options do |opts|
22
22
  script_name = File.basename($0)
23
23
  opts.banner = "Usage: ruby #{script_name} [options]"
24
24
 
25
- opts.separator ""
26
-
27
- opts.on("--o IORFILE",
28
- "Set IOR filename.",
29
- "Default: 'server.ior'") { |v| OPTIONS[:iorfile]=v }
30
- opts.on("--d LVL",
31
- "Set ORBDebugLevel value.",
32
- "Default: 0") { |v| OPTIONS[:orb_debuglevel]=v }
33
- opts.on("--use-implement",
34
- "Load IDL through CORBA.implement() instead of precompiled code.",
35
- "Default: off") { |v| OPTIONS[:use_implement]=v }
36
- opts.on("--i ITERATIONS",
37
- "Set number of iterations.",
38
- "Default: 10", Integer) { |v| OPTIONS[:iter_num]=v }
39
-
40
- opts.separator ""
41
-
42
- opts.on("-h", "--help",
43
- "Show this help message.") { puts opts; exit }
25
+ opts.separator ''
26
+
27
+ opts.on('--o IORFILE',
28
+ 'Set IOR filename.',
29
+ "Default: 'server.ior'") { |v| OPTIONS[:iorfile] = v }
30
+ opts.on('--d LVL',
31
+ 'Set ORBDebugLevel value.',
32
+ 'Default: 0') { |v| OPTIONS[:orb_debuglevel] = v }
33
+ opts.on('--use-implement',
34
+ 'Load IDL through CORBA.implement() instead of precompiled code.',
35
+ 'Default: off') { |v| OPTIONS[:use_implement] = v }
36
+ opts.on('--i ITERATIONS',
37
+ 'Set number of iterations.',
38
+ 'Default: 10', Integer) { |v| OPTIONS[:iter_num] = v }
39
+
40
+ opts.separator ''
41
+
42
+ opts.on('-h', '--help',
43
+ 'Show this help message.') { puts opts; exit }
44
44
 
45
45
  opts.parse!
46
46
  end
@@ -74,9 +74,9 @@ class Simple_Server_i < POA::Simple_Server
74
74
  puts "server (#{Process.pid}) received shutdown request from client"
75
75
  @orb.shutdown()
76
76
  end
77
- end #of servant Simple_Server_i
77
+ end # of servant Simple_Server_i
78
78
 
79
- orb = CORBA.ORB_init(["-ORBDebugLevel", OPTIONS[:orb_debuglevel]], 'myORB')
79
+ orb = CORBA.ORB_init(['-ORBDebugLevel', OPTIONS[:orb_debuglevel]], 'myORB')
80
80
 
81
81
  obj = orb.resolve_initial_references('RootPOA')
82
82
 
@@ -97,7 +97,7 @@ open(OPTIONS[:iorfile], 'w') { |io|
97
97
  }
98
98
 
99
99
  Signal.trap('INT') do
100
- puts "SIGINT - shutting down ORB..."
100
+ puts 'SIGINT - shutting down ORB...'
101
101
  orb.shutdown()
102
102
  end
103
103
 
data/test/lib/assert.rb CHANGED
@@ -39,4 +39,3 @@ module TestUtil
39
39
  end
40
40
 
41
41
  end
42
-
data/test/lib/test.rb CHANGED
@@ -21,7 +21,7 @@ module TestUtil
21
21
  end
22
22
 
23
23
  def self.is_win32?
24
- (RB_CONFIG['target_os'] =~ /win32/ || RB_CONFIG['target_os'] =~ /mingw32/) ? true : false
24
+ (RB_CONFIG['target_os'] =~ /win32/ || RB_CONFIG['target_os'] =~ /mingw/) ? true : false
25
25
  end
26
26
 
27
27
  RBVersion = RUBY_VERSION.split('.').collect {|x| x.to_i}
@@ -65,7 +65,7 @@ if defined?(JRUBY_VERSION)
65
65
  # const char *const *argv,
66
66
  # const char *const *envp);
67
67
 
68
- attach_function :_spawnvpe,:_spawnvpe, [:int, :string, :pointer, :pointer], :pointer
68
+ attach_function :_spawnvpe, :_spawnvpe, [:int, :string, :pointer, :pointer], :pointer
69
69
 
70
70
  P_NOWAIT = 1
71
71
 
@@ -105,7 +105,7 @@ if defined?(JRUBY_VERSION)
105
105
  def self.wait(pid)
106
106
  stat_ptr = FFI::MemoryPointer.new(:int, 1)
107
107
  tmp_pid = _wait(stat_ptr, pid, 0)
108
- if tmp_pid==pid
108
+ if tmp_pid == pid
109
109
  return [pid, stat_ptr.get_int()]
110
110
  else
111
111
  return [pid, 0]
@@ -120,7 +120,7 @@ if defined?(JRUBY_VERSION)
120
120
  args_ary.put_array_of_pointer(0, str_ptrs)
121
121
 
122
122
  env_ary = FFI::MemoryPointer.new(:pointer, ENV.length + 1)
123
- env_ptrs = ENV.map {|key,value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
123
+ env_ptrs = ENV.map {|key, value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
124
124
  env_ary.put_array_of_pointer(0, env_ptrs)
125
125
 
126
126
  [P_NOWAIT, args[0], args_ary, env_ary]
@@ -159,8 +159,8 @@ if defined?(JRUBY_VERSION)
159
159
  def self.wait(pid)
160
160
  begin
161
161
  tmp, status = ::Process.waitpid2(pid, ::Process::WNOHANG)
162
- if tmp==pid and status.success? != nil
163
- return [pid, status.success?() ? 0 : status.exitstatus ]
162
+ if tmp == pid and status.success? != nil
163
+ return [pid, status.success?() ? 0 : status.exitstatus]
164
164
  end
165
165
  return [nil, 0]
166
166
  rescue Errno::ECHILD
@@ -178,13 +178,14 @@ if defined?(JRUBY_VERSION)
178
178
  args_ary.put_array_of_pointer(0, str_ptrs)
179
179
 
180
180
  env_ary = FFI::MemoryPointer.new(:pointer, ENV.length + 1)
181
- env_ptrs = ENV.map {|key,value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
181
+ env_ptrs = ENV.map {|key, value| FFI::MemoryPointer.from_string("#{key}=#{value}")}
182
182
  env_ary.put_array_of_pointer(0, env_ptrs)
183
183
 
184
184
  [pid_ptr, args[0], nil, nil, args_ary, env_ary]
185
185
  end
186
186
  end
187
187
  end
188
+
188
189
  def initialize(cmd_, arg_)
189
190
  @pid = nil
190
191
  @exitstatus = nil
@@ -197,7 +198,7 @@ if defined?(JRUBY_VERSION)
197
198
  sleep 0.01
198
199
 
199
200
  tmp_pid, tmp_status = Exec.wait(@pid)
200
- if tmp_pid==@pid
201
+ if tmp_pid == @pid
201
202
  exit_status = tmp_status
202
203
  is_running = false
203
204
  end
@@ -237,7 +238,8 @@ if defined?(JRUBY_VERSION)
237
238
  end
238
239
 
239
240
  def is_running?; @exitstatus.nil?; end
240
- def has_error? ; @trd.status.nil? or (!self.is_running? and self.exitstatus!=0) ;end
241
+
242
+ def has_error? ; @trd.status.nil? or (!self.is_running? and self.exitstatus != 0) ;end
241
243
 
242
244
  def stop
243
245
  Exec.stop(@pid)
@@ -264,7 +266,7 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
264
266
 
265
267
  protected
266
268
  # Used by Process.create
267
- ProcessInfo = Struct.new("ProcessInfo",
269
+ ProcessInfo = Struct.new('ProcessInfo',
268
270
  :process_handle,
269
271
  :thread_handle,
270
272
  :process_id,
@@ -287,9 +289,9 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
287
289
  extend WinAPI
288
290
 
289
291
  def Process.create(cmd_)
290
- startinfo = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
292
+ startinfo = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
291
293
  startinfo = startinfo.pack('LLLLLLLLLLLLSSLLLL')
292
- procinfo = [0,0,0,0].pack('LLLL')
294
+ procinfo = [0, 0, 0, 0].pack('LLLL')
293
295
 
294
296
  bool = CreateProcess(
295
297
  0, # App name
@@ -305,14 +307,14 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
305
307
  )
306
308
 
307
309
  unless bool
308
- raise ProcessError, "CreateProcess() failed: ", get_last_error
310
+ raise ProcessError, 'CreateProcess() failed: ', get_last_error
309
311
  end
310
312
 
311
313
  ProcessInfo.new(
312
- procinfo[0,4].unpack('L').first, # hProcess
313
- procinfo[4,4].unpack('L').first, # hThread
314
- procinfo[8,4].unpack('L').first, # hProcessId
315
- procinfo[12,4].unpack('L').first # hThreadId
314
+ procinfo[0, 4].unpack('L').first, # hProcess
315
+ procinfo[4, 4].unpack('L').first, # hThread
316
+ procinfo[8, 4].unpack('L').first, # hProcessId
317
+ procinfo[12, 4].unpack('L').first # hThreadId
316
318
  )
317
319
  end
318
320
 
@@ -324,7 +326,7 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
324
326
  else
325
327
  CloseHandle(pi_.process_handle) unless pi_.process_handle == INVALID_HANDLE_VALUE
326
328
  pi_.process_handle = INVALID_HANDLE_VALUE
327
- raise ProcessError, "GetExitCodeProcess failed: ", get_last_error
329
+ raise ProcessError, 'GetExitCodeProcess failed: ', get_last_error
328
330
  end
329
331
  end
330
332
 
@@ -395,6 +397,7 @@ elsif is_win32? && TestUtil::RBVersion[0] < 2 && TestUtil::RBVersion[1] < 9
395
397
  def exitstatus; @exitstatus; end
396
398
 
397
399
  def is_running?; @exitstatus.nil?; end
400
+
398
401
  def has_error?; !@exitstatus.nil? and (@exitstatus != 0); end
399
402
 
400
403
  def stop
@@ -441,7 +444,7 @@ else # !win32
441
444
  def check_status
442
445
  begin
443
446
  tmp, @status = ::Process.waitpid2(@pid, ::Process::WNOHANG)
444
- if tmp==@pid and @status.success? == false
447
+ if tmp == @pid and @status.success? == false
445
448
  @exitstatus = @status.exitstatus
446
449
  return false
447
450
  end
@@ -457,6 +460,7 @@ else # !win32
457
460
  end
458
461
 
459
462
  def is_running?; @exitstatus.nil?; end
463
+
460
464
  def has_error?; !@status.nil? and (@status.success? == false); end
461
465
 
462
466
  def stop
@@ -472,7 +476,7 @@ end
472
476
  class Test
473
477
  def initialize
474
478
  @proc = nil
475
- @cmd = ""
479
+ @cmd = ''
476
480
  end
477
481
 
478
482
  def run(cmd_, arg_)
@@ -487,10 +491,12 @@ end
487
491
  end
488
492
 
489
493
  def pid; @proc.pid; end
494
+
490
495
  def is_running?; @proc.is_running?; end
496
+
491
497
  def exit_status; @proc.exitstatus; end
492
498
 
493
- def wait(timeout, check_exit=true)
499
+ def wait(timeout, check_exit = true)
494
500
  t = Time.now
495
501
  begin
496
502
  if @proc.check_status
@@ -523,7 +529,7 @@ end
523
529
 
524
530
  def TestUtil.wait_for_file(filename, timeout)
525
531
  t = Time.now
526
- while !File.readable?(filename) do
532
+ while !File.readable?(filename)
527
533
  sleep(0.1)
528
534
  if (Time.now() - t) >= timeout.to_f
529
535
  STDERR.puts "ERROR: could not find file '#{filename}'"
@@ -538,4 +544,3 @@ end
538
544
  end
539
545
 
540
546
  end
541
-