2009-08-06 00:14:50 -04:00
|
|
|
require_relative 'base'
|
2009-08-06 00:00:38 -04:00
|
|
|
|
2009-08-06 00:30:15 -04:00
|
|
|
class TestMkmf
|
|
|
|
class TestSizeof < TestMkmf
|
2010-12-03 05:48:12 -05:00
|
|
|
def test_sizeof_builtin
|
|
|
|
%w[char short int long float double void*].each do |type|
|
|
|
|
assert_kind_of(Integer, mkmf {check_sizeof(type)})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_sizeof_struct
|
2009-08-06 00:00:38 -04:00
|
|
|
open("confdefs.h", "w") {|f|
|
|
|
|
f.puts "typedef struct {char x;} test1_t;"
|
|
|
|
}
|
2010-10-23 01:40:11 -04:00
|
|
|
assert_equal(1, mkmf {check_sizeof("test1_t", "confdefs.h")})
|
2009-08-06 00:00:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|