diff options
author | Kenta Murata <mrkn@users.noreply.github.com> | 2020-12-11 09:41:12 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 09:41:12 +0900 |
commit | 9b0c36b39032cffff3c62a2b0e1fc38fa429f5ea (patch) | |
tree | 667648b7563a97e5d5270baccd5654d5de91358c /test/fiddle/test_c_union_entity.rb | |
parent | 6b1d2de6cc2e85fda7885fe77dbd7c99c4eb1ef2 (diff) |
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 <hsbt@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: sinisterchipmunk <sinisterchipmunk@gmail.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Notes
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
Diffstat (limited to 'test/fiddle/test_c_union_entity.rb')
-rw-r--r-- | test/fiddle/test_c_union_entity.rb | 15 |
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) |