summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-03-03 23:41:57 (GMT)
committerGitHub <noreply@github.com>2022-03-03 23:41:57 (GMT)
commitad1b04451d3aca2c6fa6dbe2891676a4e0baac49 (patch)
tree8fc21956e428436da9aaf698d5d11393d97ea4e1
parent6d0d7d2b8c1e04fd51c6cb29cc09a41b60b97b7b (diff)
downloadcpython-ad1b04451d3aca2c6fa6dbe2891676a4e0baac49.zip
cpython-ad1b04451d3aca2c6fa6dbe2891676a4e0baac49.tar.gz
cpython-ad1b04451d3aca2c6fa6dbe2891676a4e0baac49.tar.bz2
bpo-46913: Skip test_ctypes.test_shorts() on UBSan (GH-31674)
If Python is built with UBSan, test_ctypes now skips test_shorts(). This change allows to run test_ctypes to check for new UBSan regression, but the known test_shorts() undefined behavior must be fixed.
-rw-r--r--Lib/ctypes/test/test_bitfields.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_bitfields.py b/Lib/ctypes/test/test_bitfields.py
index 992b8c4..66acd62 100644
--- a/Lib/ctypes/test/test_bitfields.py
+++ b/Lib/ctypes/test/test_bitfields.py
@@ -1,5 +1,6 @@
from ctypes import *
from ctypes.test import need_symbol
+from test import support
import unittest
import os
@@ -39,6 +40,8 @@ class C_Test(unittest.TestCase):
setattr(b, name, i)
self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
+ # bpo-46913: _ctypes/cfield.c h_get() has an undefined behavior
+ @support.skip_if_sanitizer(ub=True)
def test_shorts(self):
b = BITS()
name = "M"