summaryrefslogtreecommitdiff
path: root/test/fiddle/test_fiddle.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fiddle/test_fiddle.rb')
-rw-r--r--test/fiddle/test_fiddle.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fiddle/test_fiddle.rb b/test/fiddle/test_fiddle.rb
index 4c6ab97..f910978 100644
--- a/test/fiddle/test_fiddle.rb
+++ b/test/fiddle/test_fiddle.rb
@@ -4,6 +4,27 @@ rescue LoadError
end
class TestFiddle < Fiddle::TestCase
+ def test_constants_match
+ [
+ :TYPE_VOID,
+ :TYPE_VOIDP,
+ :TYPE_CHAR,
+ :TYPE_SHORT,
+ :TYPE_INT,
+ :TYPE_LONG,
+ :TYPE_LONG_LONG,
+ :TYPE_FLOAT,
+ :TYPE_DOUBLE,
+ :TYPE_SIZE_T,
+ :TYPE_SSIZE_T,
+ :TYPE_PTRDIFF_T,
+ :TYPE_INTPTR_T,
+ :TYPE_UINTPTR_T,
+ ].each do |name|
+ assert_equal(DL.const_get(name), Fiddle.const_get(name), "Fiddle::#{name}")
+ end
+ end
+
def test_windows_constant
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/