summaryrefslogtreecommitdiff
path: root/test/fiddle/test_c_struct_entry.rb
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2023-10-28 06:11:30 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-08 09:25:44 +0900
commit2a6d6d3d65de43635a5f6ad38dbca170f1e40119 (patch)
tree097aff88d59c4e7329138d98408ff706846f28fe /test/fiddle/test_c_struct_entry.rb
parentd30ea5831e0aedada3362a2d268e7bc836b93f27 (diff)
[ruby/fiddle] Use Ruby's true/false for C bool
GitHub: fix https://github.com/ruby/fiddle/pull/130 Reported by Benoit Daloze. Thanks!!! https://github.com/ruby/fiddle/commit/2640e0148e
Diffstat (limited to 'test/fiddle/test_c_struct_entry.rb')
-rw-r--r--test/fiddle/test_c_struct_entry.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/fiddle/test_c_struct_entry.rb b/test/fiddle/test_c_struct_entry.rb
index 9fd16d7101..45de2efe21 100644
--- a/test/fiddle/test_c_struct_entry.rb
+++ b/test/fiddle/test_c_struct_entry.rb
@@ -8,7 +8,7 @@ end
module Fiddle
class TestCStructEntity < TestCase
def test_class_size
- types = [TYPE_DOUBLE, TYPE_CHAR]
+ types = [TYPE_DOUBLE, TYPE_CHAR, TYPE_DOUBLE, TYPE_BOOL]
size = CStructEntity.size types
@@ -20,6 +20,12 @@ module Fiddle
expected = PackInfo.align expected, alignments[1]
expected += PackInfo::SIZE_MAP[TYPE_CHAR]
+ expected = PackInfo.align expected, alignments[2]
+ expected += PackInfo::SIZE_MAP[TYPE_DOUBLE]
+
+ expected = PackInfo.align expected, alignments[3]
+ expected += PackInfo::SIZE_MAP[TYPE_BOOL]
+
expected = PackInfo.align expected, alignments.max
assert_equal expected, size