mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
mark failing test_ctypes
This commit is contained in:
1 parent
7e6e0f66c8
commit
4a352344b6
12 files changed
+28
-4
No files matched your search
Vendored
+2
@@ -32,6 +32,8 @@ class Test(unittest.TestCase):
|
||||
ptr = cast(address, POINTER(c_int))
|
||||
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_p2a_objects(self):
|
||||
array = (c_char_p * 5)()
|
||||
self.assertEqual(array._objects, None)
|
||||
|
||||
Vendored
+1
@@ -54,6 +54,7 @@ class TestNullDlsym(unittest.TestCase):
|
||||
this 'dlsym returned NULL -> throw Error' rule.
|
||||
"""
|
||||
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
def test_null_dlsym(self):
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
+4
@@ -27,6 +27,8 @@ class ObjectsTestCase(unittest.TestCase):
|
||||
self.assertEqual(refcnt, sys.getrefcount(i))
|
||||
self.assertEqual(ci._objects, None)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_c_char_p(self):
|
||||
s = "Hello, World".encode("ascii")
|
||||
refcnt = sys.getrefcount(s)
|
||||
@@ -62,6 +64,8 @@ class ObjectsTestCase(unittest.TestCase):
|
||||
x1.a, x2.b = 42, 93
|
||||
self.assertEqual(y._objects, {"0": {}, "1": {}})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_xxx(self):
|
||||
class X(Structure):
|
||||
_fields_ = [("a", c_char_p), ("b", c_char_p)]
|
||||
|
||||
+4
@@ -12,6 +12,8 @@ class SimpleTestCase(unittest.TestCase):
|
||||
x = c_int(99)
|
||||
self.assertEqual(x._objects, None)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_ccharp(self):
|
||||
x = c_char_p()
|
||||
self.assertEqual(x._objects, None)
|
||||
@@ -33,6 +35,8 @@ class StructureTestCase(unittest.TestCase):
|
||||
x.b = 99
|
||||
self.assertEqual(x._objects, None)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_ccharp_struct(self):
|
||||
class X(Structure):
|
||||
_fields_ = [("a", c_char_p),
|
||||
|
||||
Vendored
+2
-1
@@ -58,7 +58,8 @@ import unittest
|
||||
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
tests.addTest(doctest.DocTestSuite())
|
||||
# TODO: RUSTPYTHON - doctest disabled due to null terminator in _objects
|
||||
# tests.addTest(doctest.DocTestSuite())
|
||||
return tests
|
||||
|
||||
|
||||
|
||||
+4
@@ -7,6 +7,8 @@ from ctypes import (pythonapi, POINTER, create_string_buffer, sizeof,
|
||||
|
||||
|
||||
class PythonAPITestCase(unittest.TestCase):
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_PyBytes_FromStringAndSize(self):
|
||||
PyBytes_FromStringAndSize = pythonapi.PyBytes_FromStringAndSize
|
||||
|
||||
@@ -57,6 +59,8 @@ class PythonAPITestCase(unittest.TestCase):
|
||||
del pyobj
|
||||
self.assertEqual(sys.getrefcount(s), ref)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_PyOS_snprintf(self):
|
||||
PyOS_snprintf = pythonapi.PyOS_snprintf
|
||||
PyOS_snprintf.argtypes = POINTER(c_char), c_size_t, c_char_p
|
||||
|
||||
+2
@@ -70,6 +70,8 @@ class CallbackTracbackTestCase(unittest.TestCase):
|
||||
with self.expect_unraisable(ZeroDivisionError):
|
||||
cb(0.0)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_TypeErrorDivisionError(self):
|
||||
cb = CFUNCTYPE(c_int, c_char_p)(callback_func)
|
||||
err_msg = "unsupported operand type(s) for /: 'int' and 'bytes'"
|
||||
|
||||
Vendored
+4
@@ -39,6 +39,8 @@ class ValuesTestCase(unittest.TestCase):
|
||||
class PythonValuesTestCase(unittest.TestCase):
|
||||
"""This test only works when python itself is a dll/shared library"""
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_optimizeflag(self):
|
||||
# This test accesses the Py_OptimizeFlag integer, which is
|
||||
# exported by the Python dll and should match the sys.flags value
|
||||
@@ -46,6 +48,8 @@ class PythonValuesTestCase(unittest.TestCase):
|
||||
opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value
|
||||
self.assertEqual(opt, sys.flags.optimize)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_frozentable(self):
|
||||
# Python exports a PyImport_FrozenModules symbol. This is a
|
||||
# pointer to an array of struct _frozen entries. The end of the
|
||||
|
||||
Vendored
+2
@@ -17,6 +17,8 @@ class FunctionCallTestCase(unittest.TestCase):
|
||||
@unittest.skipUnless('MSC' in sys.version, "SEH only supported by MSC")
|
||||
@unittest.skipIf(sys.executable.lower().endswith('_d.exe'),
|
||||
"SEH not enabled in debug builds")
|
||||
# TODO: RUSTPYTHON - SEH not implemented
|
||||
@unittest.skipIf("RustPython" in sys.version, "SEH not implemented in RustPython")
|
||||
def test_SEH(self):
|
||||
# Disable faulthandler to prevent logging the warning:
|
||||
# "Windows fatal exception: access violation"
|
||||
|
||||
@@ -158,6 +158,8 @@ class ForeignFunctionsThatWillCallComMethodsTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(0, ppst.Release())
|
||||
|
||||
# TODO: RUSTPYTHON - COM iid parameter handling not implemented
|
||||
@unittest.expectedFailure
|
||||
def test_with_paramflags_and_iid(self):
|
||||
class IUnknown(c_void_p):
|
||||
QueryInterface = proto_query_interface(None, IID_IUnknown)
|
||||
|
||||
Vendored
+1
@@ -430,6 +430,7 @@ class ExceptionTests(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'win32',
|
||||
'test specific to Windows')
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
def test_windows_message(self):
|
||||
"""Should fill in unknown error code in Windows error message"""
|
||||
ctypes = import_module('ctypes')
|
||||
|
||||
Vendored
-3
@@ -939,7 +939,6 @@ class UtimeTests(unittest.TestCase):
|
||||
return buf.value
|
||||
# return None if the filesystem is unknown
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; (ModuleNotFoundError: No module named '_ctypes')")
|
||||
def test_large_time(self):
|
||||
# Many filesystems are limited to the year 2038. At least, the test
|
||||
# pass with NTFS filesystem.
|
||||
@@ -2712,12 +2711,10 @@ class Win32KillTests(unittest.TestCase):
|
||||
os.kill(proc.pid, sig)
|
||||
self.assertEqual(proc.wait(), sig)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; (ModuleNotFoundError: No module named '_ctypes')")
|
||||
def test_kill_sigterm(self):
|
||||
# SIGTERM doesn't mean anything special, but make sure it works
|
||||
self._kill(signal.SIGTERM)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; (ModuleNotFoundError: No module named '_ctypes')")
|
||||
def test_kill_int(self):
|
||||
# os.kill on Windows can take an int which gets set as the exit code
|
||||
self._kill(100)
|
||||
|
||||
Reference in new issue
Block a user