@@ -411,6 +411,31 @@ test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored))
411411 Py_RETURN_NONE ;
412412}
413413
414+ static PyObject *
415+ test_buildvalue_p (PyObject * self , PyObject * Py_UNUSED (ignored ))
416+ {
417+ PyObject * res = Py_BuildValue ("p" , 3 );
418+ if (res == NULL ) {
419+ return NULL ;
420+ }
421+ if (!Py_IsTrue (res )) {
422+ Py_DECREF (res );
423+ return raiseTestError (self , "test_buildvalue_p" , "Py_BuildValue(\"p\", 3) returned wrong result" );
424+ }
425+ Py_DECREF (res );
426+
427+ res = Py_BuildValue ("p" , 0 );
428+ if (res == NULL ) {
429+ return NULL ;
430+ }
431+ if (!Py_IsFalse (res )) {
432+ Py_DECREF (res );
433+ return raiseTestError (self , "test_buildvalue_p" , "Py_BuildValue(\"p\", 0) returned wrong result" );
434+ }
435+ Py_DECREF (res );
436+
437+ Py_RETURN_NONE ;
438+ }
414439
415440static PyObject *
416441pyobject_repr_from_null (PyObject * self , PyObject * Py_UNUSED (ignored ))
@@ -2512,6 +2537,7 @@ static PyMethodDef TestMethods[] = {
25122537 {"py_buildvalue" , py_buildvalue , METH_VARARGS },
25132538 {"py_buildvalue_ints" , py_buildvalue_ints , METH_VARARGS },
25142539 {"test_buildvalue_N" , test_buildvalue_N , METH_NOARGS },
2540+ {"test_buildvalue_p" , test_buildvalue_p , METH_NOARGS },
25152541 {"test_reftracer" , test_reftracer , METH_NOARGS },
25162542 {"_test_thread_state" , test_thread_state , METH_VARARGS },
25172543 {"gilstate_ensure_release" , gilstate_ensure_release , METH_NOARGS },
0 commit comments