mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
C API tests: use special markers to test that output parameters were set (GH-109014)
This commit is contained in:
parent
db1ee6a19a
commit
bf414b7fcb
7 changed files with 60 additions and 30 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "parts.h"
|
||||
#include "util.h"
|
||||
|
||||
static Py_ssize_t
|
||||
get_code_extra_index(PyInterpreterState* interp) {
|
||||
|
|
@ -75,7 +76,7 @@ test_code_extra(PyObject* self, PyObject *Py_UNUSED(callable))
|
|||
}
|
||||
|
||||
// Check the value is initially NULL
|
||||
void *extra;
|
||||
void *extra = UNINITIALIZED_PTR;
|
||||
int res = PyUnstable_Code_GetExtra(test_func_code, code_extra_index, &extra);
|
||||
if (res < 0) {
|
||||
goto finally;
|
||||
|
|
@ -88,6 +89,7 @@ test_code_extra(PyObject* self, PyObject *Py_UNUSED(callable))
|
|||
goto finally;
|
||||
}
|
||||
// Assert it was set correctly
|
||||
extra = UNINITIALIZED_PTR;
|
||||
res = PyUnstable_Code_GetExtra(test_func_code, code_extra_index, &extra);
|
||||
if (res < 0) {
|
||||
goto finally;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue