diff options
Diffstat (limited to 'test/dl')
-rw-r--r-- | test/dl/test_cparser.rb | 20 | ||||
-rw-r--r-- | test/dl/test_dl2.rb | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/test/dl/test_cparser.rb b/test/dl/test_cparser.rb index 3be727a759..cea9ac73b0 100644 --- a/test/dl/test_cparser.rb +++ b/test/dl/test_cparser.rb @@ -9,5 +9,25 @@ module DL def test_uint_ctype assert_equal(-DL::TYPE_INT, parse_ctype('uint')) end + + def test_size_t_ctype + assert_equal(DL::TYPE_SIZE_T, parse_ctype("size_t")) + end + + def test_ssize_t_ctype + assert_equal(DL::TYPE_SSIZE_T, parse_ctype("ssize_t")) + end + + def test_ptrdiff_t_ctype + assert_equal(DL::TYPE_PTRDIFF_T, parse_ctype("ptrdiff_t")) + end + + def test_intptr_t_ctype + assert_equal(DL::TYPE_INTPTR_T, parse_ctype("intptr_t")) + end + + def test_uintptr_t_ctype + assert_equal(DL::TYPE_UINTPTR_T, parse_ctype("uintptr_t")) + end end end diff --git a/test/dl/test_dl2.rb b/test/dl/test_dl2.rb index 1d6e39114f..8f4275fb65 100644 --- a/test/dl/test_dl2.rb +++ b/test/dl/test_dl2.rb @@ -151,5 +151,17 @@ class TestDL < TestBase ary2 = dlunwrap(addr) assert_equal(ary, ary2) end + + def test_type_size_t + assert_equal(DL::TYPE_SSIZE_T, DL::TYPE_SIZE_T.abs) + end + + def test_type_uintptr_t + assert_equal(-DL::TYPE_INTPTR_T, DL::TYPE_UINTPTR_T) + end + + def test_sizeof_uintptr_t + assert_equal(DL::SIZEOF_VOIDP, DL::SIZEOF_INTPTR_T) + end end end # module DL |