[pypy-commit] pypy default: Test ioctl with int args

Gabriel noreply at buildbot.pypy.org
Thu Oct 18 15:28:24 CEST 2012


Author: Gabriel <g2p.code at gmail.com>
Branch: 
Changeset: r58211:52fe31bb9ef9
Date: 2012-10-12 17:35 +0200
http://bitbucket.org/pypy/pypy/changeset/52fe31bb9ef9/

Log:	Test ioctl with int args

diff --git a/pypy/module/fcntl/test/test_fcntl.py b/pypy/module/fcntl/test/test_fcntl.py
--- a/pypy/module/fcntl/test/test_fcntl.py
+++ b/pypy/module/fcntl/test/test_fcntl.py
@@ -171,6 +171,17 @@
         res = fcntl.ioctl(0, TIOCGPGRP, "\x00\x00")
         assert res == expected
 
+    def test_ioctl_int(self):
+        import os
+        import fcntl
+        #from termios import TCFLSH, TCIOFLUSH
+        TCFLSH = 0x540b
+        TCIOFLUSH = 2
+
+        if not os.isatty(0):
+            skip("stdin is not a tty")
+        assert fcntl.ioctl(0, TCFLSH, TCIOFLUSH) == 0
+
     def test_lockf_with_ex(self):
         import fcntl
         f = open(self.tmp, "w")


More information about the pypy-commit mailing list