1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/fiddle/test_cparser.rb
ktsj 1dafd4ebf1 * test/fiddle/test_c_struct_entry.rb,
test/fiddle/test_c_union_entity.rb,
  test/fiddle/test_cparser.rb, test/fiddle/test_func.rb,
  test/fiddle/test_handle.rb, test/fiddle/test_import.rb,
  test/fiddle/test_pointer.rb: don't run test if the system
  don't support fiddle.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 14:29:02 +00:00

35 lines
739 B
Ruby

begin
require_relative 'helper'
require 'fiddle/cparser'
rescue LoadError
end
module Fiddle
class TestCParser < TestCase
include CParser
def test_uint_ctype
assert_equal(-TYPE_INT, parse_ctype('uint'))
end
def test_size_t_ctype
assert_equal(TYPE_SIZE_T, parse_ctype("size_t"))
end
def test_ssize_t_ctype
assert_equal(TYPE_SSIZE_T, parse_ctype("ssize_t"))
end
def test_ptrdiff_t_ctype
assert_equal(TYPE_PTRDIFF_T, parse_ctype("ptrdiff_t"))
end
def test_intptr_t_ctype
assert_equal(TYPE_INTPTR_T, parse_ctype("intptr_t"))
end
def test_uintptr_t_ctype
assert_equal(TYPE_UINTPTR_T, parse_ctype("uintptr_t"))
end
end
end if defined?(Fiddle)