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

test_io.rb: ignore not-implemented fadvice

* test/ruby/test_io.rb (test_advise_pipe): ignore not-implemented
  fadvice(2) when it is present but not implemented, as IO#advice
  does nothing and raises no exceptions.  [Feature #11806]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-16 02:36:12 +00:00
parent bfd34365b6
commit 632b1e9442

View file

@ -3005,8 +3005,12 @@ End
# we don't know if other platforms have a real posix_fadvise()
with_pipe do |r,w|
# Linux 2.6.15 and earlier returned EINVAL instead of ESPIPE
assert_raise(Errno::ESPIPE, Errno::EINVAL) { r.advise(:willneed) }
assert_raise(Errno::ESPIPE, Errno::EINVAL) { w.advise(:willneed) }
assert_raise(Errno::ESPIPE, Errno::EINVAL) {
r.advise(:willneed) or skip "fadvice(2) is not implemented"
}
assert_raise(Errno::ESPIPE, Errno::EINVAL) {
w.advise(:willneed) or skip "fadvice(2) is not implemented"
}
end
end if /linux/ =~ RUBY_PLATFORM