aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-16 02:36:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-16 02:36:12 +0000
commit632b1e9442d3d5ced2c51b71a85f8f9a47aa9aae (patch)
treecafd0f78b7ec344105bc3c400bd97f54c65bfce9
parentbfd34365b6b01898649cfd570306e062c170628b (diff)
downloadruby-632b1e9442d3d5ced2c51b71a85f8f9a47aa9aae.tar.gz
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
-rw-r--r--test/ruby/test_io.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index ad9e4fa08f..bd92634785 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -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