summaryrefslogtreecommitdiff
path: root/test/fiddle/test_c_union_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fiddle/test_c_union_entity.rb')
-rw-r--r--test/fiddle/test_c_union_entity.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/fiddle/test_c_union_entity.rb b/test/fiddle/test_c_union_entity.rb
index 9310084733..e0a3757562 100644
--- a/test/fiddle/test_c_union_entity.rb
+++ b/test/fiddle/test_c_union_entity.rb
@@ -21,15 +21,16 @@ module Fiddle
end
def test_set_ctypes
- union = CUnionEntity.malloc [TYPE_INT, TYPE_LONG], Fiddle::RUBY_FREE
- union.assign_names %w[int long]
+ CUnionEntity.malloc([TYPE_INT, TYPE_LONG], Fiddle::RUBY_FREE) do |union|
+ union.assign_names %w[int long]
- # this test is roundabout because the stored ctypes are not accessible
- union['long'] = 1
- assert_equal 1, union['long']
+ # this test is roundabout because the stored ctypes are not accessible
+ union['long'] = 1
+ assert_equal 1, union['long']
- union['int'] = 1
- assert_equal 1, union['int']
+ union['int'] = 1
+ assert_equal 1, union['int']
+ end
end
end
end if defined?(Fiddle)