From aa23f6b9fdecbf3be3e21b0f6b40e2b22f125090 Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 25 Nov 2011 02:45:50 +0000 Subject: * io.c (ioctl_narg_len, linux_iocparm_len): reinstantiate linux specific narg length calculation. * test/ruby/test_io.rb (test_ioctl_linux2): add new test for old and unstructured ioctl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 8899994897..01b3e681e5 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2123,6 +2123,19 @@ End assert_equal(File.size(__FILE__), buf.unpack('i!')[0]) end + def test_ioctl_linux2 + return if /linux/ !~ RUBY_PLATFORM + return if /^i?86|^x86_64/ !~ RUBY_PLATFORM + + File.open('/dev/tty') { |f| + tiocgwinsz=0x5413 + winsize="" + assert_nothing_raised { + f.ioctl(tiocgwinsz, winsize) + } + } + end + def test_setpos mkcdtmpdir { File.open("tmp.txt", "w") {|f| -- cgit v1.2.3