JRuby

New IO#readpartial and IO#seek spec failures

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.2
  • Component/s: RubySpec
  • Labels:
    None
  • Number of attachments :
    1

Description

A few new failures in readpartial and seek specs:

1)
IO#readpartial discards the existing buffer content upon successful read FAILED
Expected "existinghello world"
 to equal "hello world"

spec/ruby/core/io/readpartial_spec.rb:55
spec/ruby/core/io/readpartial_spec.rb:4
spec/ruby/core/io/readpartial_spec.rb:54:in `load'

2)
IO#readpartial discards the existing buffer content upon error FAILED
Expected EOFError but no exception was raised
spec/ruby/core/io/readpartial_spec.rb:61
spec/ruby/core/io/readpartial_spec.rb:4
spec/ruby/core/io/readpartial_spec.rb:54:in `load'

3)
IO#readpartial raises IOError if the stream is closed FAILED
Expected IOError but no exception was raised
spec/ruby/core/io/readpartial_spec.rb:67
spec/ruby/core/io/readpartial_spec.rb:4
spec/ruby/core/io/readpartial_spec.rb:54:in `load'

4)
IO#seek moves the read position and clears EOF with SEEK_CUR FAILED
Expected 10
 to equal nil

spec/ruby/core/io/seek_spec.rb:64
spec/ruby/core/io/seek_spec.rb:4
spec/ruby/core/io/seek_spec.rb:54:in `load'

5)
IO#seek moves the read position and clears EOF with SEEK_END FAILED
Expected 10
 to equal nil

spec/ruby/core/io/seek_spec.rb:71
spec/ruby/core/io/seek_spec.rb:4
spec/ruby/core/io/seek_spec.rb:54:in `load'

Activity

Hide
coderrr added a comment -

This patch fixes IO#readpartial in RubyIO.java to raise EOFError on eof. Currently it will return "" forever on eof. This patch also clears the output buffer if one is passed. All current readpartial_spec.rb test failures now pass:

$ mspec -t j readpartial_spec.rb
jruby 1.1.7 (ruby 1.8.6 patchlevel 114) (2009-01-06 rev 8588) [i386-java]
....FFFF..

1)
IO#readpartial discards the existing buffer content upon successful read FAILED
Expected "existinghello world"
to equal "hello world"

readpartial_spec.rb:55
readpartial_spec.rb:4
readpartial_spec.rb:54:in `load'

2)
IO#readpartial raises EOFError on EOF FAILED
Expected EOFError but no exception was raised
readpartial_spec.rb:62
readpartial_spec.rb:4
readpartial_spec.rb:54:in `load'

3)
IO#readpartial discards the existing buffer content upon error FAILED
Expected EOFError but no exception was raised
readpartial_spec.rb:68
readpartial_spec.rb:4
readpartial_spec.rb:54:in `load'

4)
IO#readpartial raises IOError if the stream is closed FAILED
Expected IOError but no exception was raised
readpartial_spec.rb:74
readpartial_spec.rb:4
readpartial_spec.rb:54:in `load'

after 'patch -p0 < io_readpartial.patch'

$ mspec -t j readpartial_spec.rb
jruby 1.1.7 (ruby 1.8.6 patchlevel 114) (2009-01-06 rev 8588) [i386-java]
..........

Show
coderrr added a comment - This patch fixes IO#readpartial in RubyIO.java to raise EOFError on eof. Currently it will return "" forever on eof. This patch also clears the output buffer if one is passed. All current readpartial_spec.rb test failures now pass: $ mspec -t j readpartial_spec.rb jruby 1.1.7 (ruby 1.8.6 patchlevel 114) (2009-01-06 rev 8588) [i386-java] ....FFFF.. 1) IO#readpartial discards the existing buffer content upon successful read FAILED Expected "existinghello world" to equal "hello world" readpartial_spec.rb:55 readpartial_spec.rb:4 readpartial_spec.rb:54:in `load' 2) IO#readpartial raises EOFError on EOF FAILED Expected EOFError but no exception was raised readpartial_spec.rb:62 readpartial_spec.rb:4 readpartial_spec.rb:54:in `load' 3) IO#readpartial discards the existing buffer content upon error FAILED Expected EOFError but no exception was raised readpartial_spec.rb:68 readpartial_spec.rb:4 readpartial_spec.rb:54:in `load' 4) IO#readpartial raises IOError if the stream is closed FAILED Expected IOError but no exception was raised readpartial_spec.rb:74 readpartial_spec.rb:4 readpartial_spec.rb:54:in `load' after 'patch -p0 < io_readpartial.patch' $ mspec -t j readpartial_spec.rb jruby 1.1.7 (ruby 1.8.6 patchlevel 114) (2009-01-06 rev 8588) [i386-java] ..........
Hide
Thomas E Enebo added a comment -

Fixed in commit 8606 (initial patch by coderrr). I fixed a few other things along the way and even made a shared method so that read_nonblock could share it. Thanks for the patch. Keep it up!

Show
Thomas E Enebo added a comment - Fixed in commit 8606 (initial patch by coderrr). I fixed a few other things along the way and even made a shared method so that read_nonblock could share it. Thanks for the patch. Keep it up!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: