summaryrefslogtreecommitdiffstats
path: root/Lib/test/_testcppext.cpp
diff options
context:
space:
mode:
authorNeil Schemenauer <nas-github@arctrix.com>2022-06-05 03:53:16 (GMT)
committerGitHub <noreply@github.com>2022-06-05 03:53:16 (GMT)
commit713eb184b50f2b8b138fb01187ee32fa29a815c9 (patch)
treed5f1a953de648ca8ce473df12280a707e21b43d8 /Lib/test/_testcppext.cpp
parent8bcc3fa3453e28511d04eaa0aa7d8e1a3495d518 (diff)
downloadcpython-713eb184b50f2b8b138fb01187ee32fa29a815c9.zip
cpython-713eb184b50f2b8b138fb01187ee32fa29a815c9.tar.gz
cpython-713eb184b50f2b8b138fb01187ee32fa29a815c9.tar.bz2
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505)
Diffstat (limited to 'Lib/test/_testcppext.cpp')
-rw-r--r--Lib/test/_testcppext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/_testcppext.cpp b/Lib/test/_testcppext.cpp
index 70f434e..5e3d76b 100644
--- a/Lib/test/_testcppext.cpp
+++ b/Lib/test/_testcppext.cpp
@@ -77,6 +77,9 @@ test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
// gh-93442: Pass 0 as NULL for PyObject*
Py_XINCREF(0);
Py_XDECREF(0);
+ // ensure that nullptr works too
+ Py_XINCREF(nullptr);
+ Py_XDECREF(nullptr);
Py_DECREF(obj);
Py_RETURN_NONE;