2010-06-02 12:02:48 -04:00
|
|
|
require_relative 'test_base'
|
|
|
|
|
|
|
|
require 'dl/cparser'
|
|
|
|
|
|
|
|
module DL
|
|
|
|
class TestCParser < TestBase
|
2012-11-27 19:02:49 -05:00
|
|
|
include CParser
|
2010-06-02 12:02:48 -04:00
|
|
|
|
|
|
|
def test_uint_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(-TYPE_INT, parse_ctype('uint'))
|
2010-06-02 12:02:48 -04:00
|
|
|
end
|
2012-02-25 00:47:16 -05:00
|
|
|
|
|
|
|
def test_size_t_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(TYPE_SIZE_T, parse_ctype("size_t"))
|
2012-02-25 00:47:16 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_ssize_t_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(TYPE_SSIZE_T, parse_ctype("ssize_t"))
|
2012-02-25 00:47:16 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_ptrdiff_t_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(TYPE_PTRDIFF_T, parse_ctype("ptrdiff_t"))
|
2012-02-25 00:47:16 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_intptr_t_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(TYPE_INTPTR_T, parse_ctype("intptr_t"))
|
2012-02-25 00:47:16 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_uintptr_t_ctype
|
2012-11-27 19:02:49 -05:00
|
|
|
assert_equal(TYPE_UINTPTR_T, parse_ctype("uintptr_t"))
|
2012-02-25 00:47:16 -05:00
|
|
|
end
|
2010-06-02 12:02:48 -04:00
|
|
|
end
|
|
|
|
end
|