From 9b0c36b39032cffff3c62a2b0e1fc38fa429f5ea Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Fri, 11 Dec 2020 09:41:12 +0900 Subject: Import fiddle-1.0.4 (#3860) I don't use tool/sync_default_gem.rb because the last sync was incomplete. Co-authored-by: Hiroshi SHIBATA Co-authored-by: Alan Wu Co-authored-by: sinisterchipmunk Co-authored-by: Sutou Kouhei --- test/fiddle/test_c_union_entity.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'test/fiddle/test_c_union_entity.rb') 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) -- cgit v1.2.3