ruby-changes:26485
From: kou <ko1@a...>
Date: Fri, 21 Dec 2012 22:44:55 +0900 (JST)
Subject: [ruby-changes:26485] kou:r38536 (trunk): * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof):
kou 2012-12-21 22:44:44 +0900 (Fri, 21 Dec 2012) New Revision: 38536 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38536 Log: * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): CPtr -> Pointer. * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof): Added the test for the above. Modified files: trunk/ChangeLog trunk/ext/fiddle/lib/fiddle/import.rb trunk/test/fiddle/test_import.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 38535) +++ ChangeLog (revision 38536) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Dec 21 22:43:36 2012 Kouhei Sutou <kou@c...> + + * ext/fiddle/lib/fiddle/import.rb (Fiddle::Importer#sizeof): + CPtr -> Pointer. + * test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof): + Added the test for the above. + Fri Dec 21 22:34:17 2012 Koichi Sasada <ko1@a...> * test/ruby/test_iseq.rb: disable a test which checks features Index: ext/fiddle/lib/fiddle/import.rb =================================================================== --- ext/fiddle/lib/fiddle/import.rb (revision 38535) +++ ext/fiddle/lib/fiddle/import.rb (revision 38536) @@ -127,7 +127,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/ext/fiddle/lib/fiddle/import.rb#L127 return ty.size() end end - return CPtr[ty].size() + return Pointer[ty].size() end def parse_bind_options(opts) Index: test/fiddle/test_import.rb =================================================================== --- test/fiddle/test_import.rb (revision 38535) +++ test/fiddle/test_import.rb (revision 38536) @@ -59,6 +59,7 @@ module Fiddle https://github.com/ruby/ruby/blob/trunk/test/fiddle/test_import.rb#L59 def test_sizeof() assert_equal(SIZEOF_VOIDP, LIBC.sizeof("FILE*")) assert_equal(LIBC::MyStruct.size(), LIBC.sizeof(LIBC::MyStruct)) + assert_equal(LIBC::MyStruct.size(), LIBC.sizeof(LIBC::MyStruct.malloc())) end def test_unsigned_result() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/