ruby-changes:40955
From: nobu <ko1@a...>
Date: Fri, 11 Dec 2015 14:57:11 +0900 (JST)
Subject: [ruby-changes:40955] nobu:r53034 (trunk): test_io.rb: fix IO#advise on aarch64-linux
nobu 2015-12-11 14:56:43 +0900 (Fri, 11 Dec 2015) New Revision: 53034 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53034 Log: 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. Modified files: trunk/test/ruby/test_io.rb Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 53033) +++ test/ruby/test_io.rb (revision 53034) @@ -2565,6 +2565,8 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2565 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3007 # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/