From ec572a1171727d5570c337bf765b4f4ecdc3849d Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Dec 2015 05:56:43 +0000 Subject: test_io.rb: fix IO#advise on aarch64-linux * test/ruby/test_io.rb (test_advise, test_advise_pipe): fadvise on aarch64-linux returns ESYS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ad9e4fa08f..a237fa3b87 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2565,6 +2565,8 @@ End ret = assert_nothing_raised(lambda { os_and_fs(tf.path) }) { begin t.advise(adv, offset, len) + rescue Errno::ENOSYS + skip rescue Errno::EINVAL => e if /linux/ =~ RUBY_PLATFORM && (Etc.uname[:release].split('.').map(&:to_i) <=> [3,6]) < 0 next # [ruby-core:65355] tmpfs is not supported @@ -3005,8 +3007,8 @@ 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, Errno::ENOSYS) { r.advise(:willneed) } + assert_raise(Errno::ESPIPE, Errno::EINVAL, Errno::ENOSYS) { w.advise(:willneed) } end end if /linux/ =~ RUBY_PLATFORM -- cgit v1.2.3