diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-05 03:38:28 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-05 03:38:28 +0000 |
commit | 6ef15ce55a095ac8fea78d579b86b41efc9dcbab (patch) | |
tree | ffc3db8d8fb35679a2db76759789567c26e2453d /test | |
parent | 88fbd108a2afa59c1f7aa542745a582073d92e63 (diff) |
merge revision(s) 40887,40888,40894,40896: [Backport #8431]
* win32/win32.c (setup_overlapped, finish_overlapped): extract from
rb_w32_read() and rb_w32_write().
* win32/win32.c (setup_overlapped): check the error code in addition
to the result of SetFilePointer() to determine if an error occurred,
because INVALID_SET_FILE_POINTER is a valid value.
[ruby-core:55098] [Bug #8431]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ad9b80faec..da6c904028 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2147,4 +2147,35 @@ End IO.select(tempfiles) }, bug8080 end + + def test_read_32bit_boundary + bug8431 = '[ruby-core:55098] [Bug #8431]' + make_tempfile {|t| + assert_separately(["-", bug8431, t.path], <<-"end;") + msg = ARGV.shift + f = open(ARGV[0], "rb") + f.seek(0xffff_ffff) + assert_nil(f.read(1), msg) + end; + } + end if /mswin|mingw/ =~ RUBY_PLATFORM + + def test_write_32bit_boundary + bug8431 = '[ruby-core:55098] [Bug #8431]' + make_tempfile {|t| + assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30) + msg = ARGV.shift + f = open(ARGV[0], "wb") + f.seek(0xffff_ffff) + begin + # this will consume very long time or fail by ENOSPC on a + # filesystem which sparse file is not supported + f.write('1') + rescue SystemCallError + else + assert_equal(0x1_0000_0000, f.tell, msg) + end + end; + } + end if /mswin|mingw/ =~ RUBY_PLATFORM end |