mirror of
https://github.com/python/cpython.git
synced 2025-09-22 08:23:36 +00:00

Move the following files from Modules/_testcapi/ to Modules/_testlimitedcapi/: * bytearray.c * bytes.c * pyos.c * sys.c Changes: * Replace PyBytes_AS_STRING() with PyBytes_AsString(). * Replace PyBytes_GET_SIZE() with PyBytes_Size(). * Update related test_capi tests. * Copy Modules/_testcapi/util.h to Modules/_testlimitedcapi/util.h.
48 lines
1 KiB
C
48 lines
1 KiB
C
/*
|
|
* Test the limited C API.
|
|
*
|
|
* The 'test_*' functions exported by this module are run as part of the
|
|
* standard Python regression test, via Lib/test/test_capi.py.
|
|
*/
|
|
|
|
#include "_testlimitedcapi/parts.h"
|
|
|
|
static PyMethodDef TestMethods[] = {
|
|
{NULL, NULL} /* sentinel */
|
|
};
|
|
|
|
static struct PyModuleDef _testlimitedcapimodule = {
|
|
PyModuleDef_HEAD_INIT,
|
|
.m_name = "_testlimitedcapi",
|
|
.m_size = 0,
|
|
.m_methods = TestMethods,
|
|
};
|
|
|
|
PyMODINIT_FUNC
|
|
PyInit__testlimitedcapi(void)
|
|
{
|
|
PyObject *mod = PyModule_Create(&_testlimitedcapimodule);
|
|
if (mod == NULL) {
|
|
return NULL;
|
|
}
|
|
|
|
if (_PyTestCapi_Init_ByteArray(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
if (_PyTestCapi_Init_Bytes(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
if (_PyTestCapi_Init_HeaptypeRelative(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
if (_PyTestCapi_Init_PyOS(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
if (_PyTestCapi_Init_Sys(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
if (_PyTestCapi_Init_VectorcallLimited(mod) < 0) {
|
|
return NULL;
|
|
}
|
|
return mod;
|
|
}
|