Project

General

Profile

Actions

Backport #7454

closed

PPTestModule test failuere on Windows 8

Added by phasis68 (Heesob Park) almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
[ruby-core:50255]

Description

I found following test failures with VC 2012 64bit compiler on Windows 8.

[ 436/9569] PPTestModule::PPCycleTest#test_anonymous = 0.00 s

  1. Failure:
    test_anonymous(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:151]:
    <"#<#Class:0x00001682e1a2b0:0x00001682e1a260>\n"> expected but was
    <"#<#Class:0x00001682e1a2b0:0x00000082e1a260>\n">.

[ 439/9569] PPTestModule::PPCycleTest#test_object = 0.00 s
2) Failure:
test_object(PPTestModule::PPCycleTest) [C:/work/snapshot/test/test_pp.rb:146]:
<"#<Object:0x00001682e0b8f0 @A (A A)=#<Object:0x00001682e0b8f0 ...>>\n"> expected but was
<"#<Object:0x00000082e0b8f0 @A (A A)=#<Object:0x00000082e0b8f0 ...>>\n">.

[ 449/9569] PPTestModule::PPInspectTest#test_to_s_with_iv = 0.00 s
3) Failure:
test_to_s_with_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:109]:
<"#<Object:0x00001682db99b0 @a=nil>\n"> expected but was
<"#<Object:0x00000082db99b0 @a=nil>\n">.

[ 450/9569] PPTestModule::PPInspectTest#test_to_s_without_iv = 0.00 s
4) Failure:
test_to_s_without_iv(PPTestModule::PPInspectTest) [C:/work/snapshot/test/test_pp.rb:116]:
<"#Object:0x00001682db8f60\n"> expected but was
<"#Object:0x00000082db8f60\n">.

The above error is related with the address range of Object allocation on Windows 8.
The address is exceeded fixnum(32bit) range.
But object_id is fixnum and pp module is based on object_id.
Thus, pp module cannot restore the original address of the Object.

C:\WINDOWS\system32>irb
irb(main):001:0> a = Object.new
=> #Object:0x00001457366bc0
irb(main):002:0> a.object_id
=> 731592160
irb(main):003:0> require 'pp'
=> true
irb(main):004:0> PP.pp(a,'')
=> "#Object:0x00000057366bc0\n"

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0