Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 896528 Details for
Bug 1098151
TestIO#test_seek and TestIO#test_seek_symwhence unit tests failed on PPC
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
revised lseek patch
ruby-2.1.1-lseek.patch (text/plain), 3.40 KB, created by
Karsten Hopp
on 2014-05-16 22:40:58 UTC
(
hide
)
Description:
revised lseek patch
Filename:
MIME Type:
Creator:
Karsten Hopp
Created:
2014-05-16 22:40:58 UTC
Size:
3.40 KB
patch
obsolete
>diff -up ruby-2.1.1/test/ruby/test_io.rb.seek ruby-2.1.1/test/ruby/test_io.rb >--- ruby-2.1.1/test/ruby/test_io.rb.seek 2013-12-18 05:24:04.000000000 +0100 >+++ ruby-2.1.1/test/ruby/test_io.rb 2014-05-16 23:02:33.000000000 +0200 >@@ -8,6 +8,7 @@ require 'stringio' > require 'timeout' > require 'tempfile' > require 'weakref' >+require 'file' > require_relative 'envutil' > > class TestIO < Test::Unit::TestCase >@@ -1666,6 +1667,28 @@ class TestIO < Test::Unit::TestCase > } > end > >+ def can_seek_data(f) >+ if /linux/ =~ RUBY_PLATFORM >+ return false if (`/bin/uname -r`.split('.').map(&:to_i) <=> [3,2]) < 0 >+ # include/uapi/linux/magic.h >+ case f.statfs.type >+ when 0x9123683E # BTRFS_SUPER_MAGIC >+ when 0x7461636f # OCFS2_SUPER_MAGIC >+ when 0xEF53 # EXT4_SUPER_MAGIC >+ return false if (`/bin/uname -r`.split('.').map(&:to_i) <=> [3,8]) < 0 >+ # ext3's timestamp resolution is seconds >+ s = f.stat >+ s.mtime.nsec != 0 || s.atime.nsec != 0 || s.ctime.nsec != 0 >+ when 0x58465342 # XFS_SUPER_MAGIC >+ return false if (`/bin/uname -r`.split('.').map(&:to_i) <=> [3,5]) < 0 >+ when 0x01021994 # TMPFS_MAGIC >+ return false if (`/bin/uname -r`.split('.').map(&:to_i) <=> [3,8]) < 0 >+ else >+ return false >+ end >+ end >+ true >+ end > > def test_seek > make_tempfile {|t| >@@ -1692,16 +1715,30 @@ class TestIO < Test::Unit::TestCase > > if defined?(IO::SEEK_DATA) > open(t.path) { |f| >+ break unless can_seek_data(f) > assert_equal("foo\n", f.gets) >- f.seek(0, IO::SEEK_DATA) >+ assert_nothing_raised(proc {"cannot SEEK_DATA on FS(0x%X)" % f.statfs.type}) do >+ f.seek(0, IO::SEEK_DATA) >+ end > assert_equal("foo\nbar\nbaz\n", f.read) > } >+ open(t.path, 'r+') { |f| >+ break unless can_seek_data(f) >+ f.seek(100*1024, IO::SEEK_SET) >+ f.print("zot\n") >+ f.seek(50*1024, IO::SEEK_DATA) >+ assert_operator(f.pos, :>=, 50*1024) >+ assert_match(/\A\0*zot\n\z/, f.read) >+ } > end > > if defined?(IO::SEEK_HOLE) > open(t.path) { |f|2 >+ break unless can_seek_data(f) > assert_equal("foo\n", f.gets) > f.seek(0, IO::SEEK_HOLE) >+ assert_operator(f.pos, :>, 20) >+ f.seek(100*1024, IO::SEEK_HOLE) > assert_equal("", f.read) > } > end >@@ -1728,16 +1765,30 @@ class TestIO < Test::Unit::TestCase > > if defined?(IO::SEEK_DATA) > open(t.path) { |f| >+ break unless can_seek_data(f) > assert_equal("foo\n", f.gets) >- f.seek(0, :DATA) >+ assert_nothing_raised(proc {"cannot SEEK_DATA on FS(0x%X)" % f.statfs.type}) do >+ f.seek(0, :DATA) >+ end > assert_equal("foo\nbar\nbaz\n", f.read) > } >+ open(t.path, 'r+') { |f| >+ break unless can_seek_data(f) >+ f.seek(100*1024, :SET) >+ f.print("zot\n") >+ f.seek(50*1024, :DATA) >+ assert_operator(f.pos, :>=, 50*1024) >+ assert_match(/\A\0*zot\n\z/, f.read) >+ } > end > > if defined?(IO::SEEK_HOLE) > open(t.path) { |f| >+ break unless can_seek_data(f) > assert_equal("foo\n", f.gets) > f.seek(0, :HOLE) >+ assert_operator(f.pos, :>, 20) >+ f.seek(100*1024, :HOLE) > assert_equal("", f.read) > } > end
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1098151
:
895873
|
895977
| 896528