@@ -1039,6 +1039,32 @@ test_buildvalue_N_error(const char *fmt)
10391039 return 0 ;
10401040}
10411041
1042+ static PyObject *
1043+ test_buildvalue_p (PyObject * self , PyObject * Py_UNUSED (ignored ))
1044+ {
1045+ PyObject * res = Py_BuildValue ("p" , 3 );
1046+ if (res == NULL ) {
1047+ return NULL ;
1048+ }
1049+ if (!Py_IsTrue (res )) {
1050+ Py_DECREF (res );
1051+ return raiseTestError ("test_buildvalue_p" , "Py_BuildValue(\"p\", 3) returned wrong result" );
1052+ }
1053+ Py_DECREF (res );
1054+
1055+ res = Py_BuildValue ("p" , 0 );
1056+ if (res == NULL ) {
1057+ return NULL ;
1058+ }
1059+ if (!Py_IsFalse (res )) {
1060+ Py_DECREF (res );
1061+ return raiseTestError ("test_buildvalue_p" , "Py_BuildValue(\"p\", 0) returned wrong result" );
1062+ }
1063+ Py_DECREF (res );
1064+
1065+ Py_RETURN_NONE ;
1066+ }
1067+
10421068static PyObject *
10431069test_buildvalue_N (PyObject * self , PyObject * Py_UNUSED (ignored ))
10441070{
@@ -5717,6 +5743,7 @@ static PyMethodDef TestMethods[] = {
57175743#endif
57185744 {"getbuffer_with_null_view" , getbuffer_with_null_view , METH_O },
57195745 {"PyBuffer_SizeFromFormat" , test_PyBuffer_SizeFromFormat , METH_VARARGS },
5746+ {"test_buildvalue_p" , test_buildvalue_p , METH_NOARGS },
57205747 {"test_buildvalue_N" , test_buildvalue_N , METH_NOARGS },
57215748 {"test_buildvalue_issue38913" , test_buildvalue_issue38913 , METH_NOARGS },
57225749 {"get_args" , get_args , METH_VARARGS },
0 commit comments