1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/dl/cptr.c (rb_dlptr_inspect): making inspect consistent across

platforms
* test/dl/test_cptr.rb (test_inspect): testing inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2009-11-07 21:37:27 +00:00
parent 4319b48ab6
commit a56bd8c31a
2 changed files with 3 additions and 3 deletions

View file

@ -388,7 +388,7 @@ rb_dlptr_inspect(VALUE self)
char str[1024];
TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
snprintf(str, 1023, "#<%s:%p ptr=%p size=%ld free=%p>",
snprintf(str, 1023, "#<%s:%p ptr=%#lx size=%ld free=%#lx>",
rb_class2name(CLASS_OF(self)), data, data->ptr, data->size, data->free);
return rb_str_new2(str);
}

View file

@ -59,8 +59,8 @@ module DL
ptr = CPtr.new(0)
inspect = ptr.inspect
assert_match(/size=#{ptr.size}/, inspect)
assert_match(/free=#{ptr.free}/, inspect)
assert_match(/ptr=#{ptr.to_i}/, inspect)
assert_match(/free=#{sprintf("%#x", ptr.free.to_i)}/, inspect)
assert_match(/ptr=#{sprintf("%#x", ptr.to_i)}/, inspect)
end
def test_to_ptr_string