Skip to content

Linux isn't the only platform using glibc. Debian gnukfreebsd and hurd ports do too

Stefano Rivera requested to merge bitbucket/merged-pr-12 into branch/default

Was already merged in Bitbucket before import, marked as merged by the import user

Trivial test failures on Debian's non-Linux ports

============================================================================= FAILURES ==============================================================================
________________________________________________________________________ TestFFI.test_vararg ________________________________________________________________________

self = <testing.test_ffi_backend.TestFFI object at 0x240bd90>

    def test_vararg(self):
        ffi = FFI(backend=self.Backend())
        ffi.cdef("""
               int printf(const char *format, ...);
               int fflush(void *);
            """)
        ffi.C = ffi.dlopen(None)
        with FdWriteCapture() as fd:
            ffi.C.printf(b"hello with no arguments\n")
            ffi.C.printf(b"hello, %s!\n", ffi.new("char[]", b"world"))
            ffi.C.printf(ffi.new("char[]", b"hello, %s!\n"),
                         ffi.new("char[]", b"world2"))
            ffi.C.printf(b"hello int %d long %ld long long %lld\n",
                         ffi.cast("int", 42),
                         ffi.cast("long", 84),
                         ffi.cast("long long", 168))
            ffi.C.printf(b"hello %p\n", ffi.NULL)
            ffi.C.fflush(ffi.NULL)
        res = fd.getvalue()
        if sys.platform == 'win32':
            NIL = b"00000000"
        elif sys.platform.startswith('linux'):
            NIL = b"(nil)"
        else:
            NIL = b"0x0"    # OS/X at least
>       assert res == (b"hello with no arguments\n"
                       b"hello, world!\n"
                       b"hello, world2!\n"
                       b"hello int 42 long 84 long long 168\n"
                       b"hello " + NIL + b"\n")
E       assert 'hello with n...hello (nil)\n' == 'hello with no...\nhello 0x0\n'
E         Skipping 84 identical leading characters in diff
E           168
E         - hello (nil)
E         + hello 0x0

testing/test_function.py:163: AssertionError
_____________________________________________________________________ TestFunction.test_vararg ______________________________________________________________________

self = <testing.test_function.TestFunction object at 0x2416910>

    def test_vararg(self):
        ffi = FFI(backend=self.Backend())
        ffi.cdef("""
               int printf(const char *format, ...);
               int fflush(void *);
            """)
        ffi.C = ffi.dlopen(None)
        with FdWriteCapture() as fd:
            ffi.C.printf(b"hello with no arguments\n")
            ffi.C.printf(b"hello, %s!\n", ffi.new("char[]", b"world"))
            ffi.C.printf(ffi.new("char[]", b"hello, %s!\n"),
                         ffi.new("char[]", b"world2"))
            ffi.C.printf(b"hello int %d long %ld long long %lld\n",
                         ffi.cast("int", 42),
                         ffi.cast("long", 84),
                         ffi.cast("long long", 168))
            ffi.C.printf(b"hello %p\n", ffi.NULL)
            ffi.C.fflush(ffi.NULL)
        res = fd.getvalue()
        if sys.platform == 'win32':
            NIL = b"00000000"
        elif sys.platform.startswith('linux'):
            NIL = b"(nil)"
        else:
            NIL = b"0x0"    # OS/X at least
>       assert res == (b"hello with no arguments\n"
                       b"hello, world!\n"
                       b"hello, world2!\n"
                       b"hello int 42 long 84 long long 168\n"
                       b"hello " + NIL + b"\n")
E       assert 'hello with n...hello (nil)\n' == 'hello with no...\nhello 0x0\n'
E         Skipping 84 identical leading characters in diff
E           168
E         - hello (nil)
E         + hello 0x0

testing/test_function.py:163: AssertionError
======================================================== 2 failed, 881 passed, 51 skipped in 190.90 seconds =========================================================
$ python -c 'import sys; print sys.platform'
gnukfreebsd8
$ python -c 'import sys; print sys.platform'
gnu0

Merge request reports