Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed May 22, 2023
commit 081e139b6040de0a10398ddc4c7cffef8d2039f0
20 changes: 16 additions & 4 deletions Modules/_testcapi/clinic/long.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions Modules/_testcapi/long.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ _testcapi_test_longlong_api_impl(PyObject *module)
/*[clinic input]
_testcapi.test_long_and_overflow

Test the PyLong_AsLongAndOverflow API. General conversion to PY_LONG is tested by test_long_api_inner. This test will concentrate on proper handling of overflow.
Test the PyLong_AsLongAndOverflow API.

General conversion to PY_LONG is tested by test_long_api_inner.

This test will concentrate on proper handling of overflow.
[clinic start generated code]*/

static PyObject *
_testcapi_test_long_and_overflow_impl(PyObject *module)
/*[clinic end generated code: output=f8460ca115e31d8e input=0eec7ad657143d42]*/
/*[clinic end generated code: output=f8460ca115e31d8e input=8e7eb2d3401c8623]*/
{
PyObject *num, *one, *temp;
long value;
Expand Down Expand Up @@ -265,12 +269,16 @@ _testcapi_test_long_and_overflow_impl(PyObject *module)
/*[clinic input]
_testcapi.test_long_long_and_overflow

Test the PyLong_AsLongLongAndOverflow API. General conversion to long long is tested by test_long_api_inner. This test will concentrate on proper handling of overflow.
Test the PyLong_AsLongLongAndOverflow API.

General conversion to long long is tested by test_long_api_inner.

This test will concentrate on proper handling of overflow.
[clinic start generated code]*/

static PyObject *
_testcapi_test_long_long_and_overflow_impl(PyObject *module)
/*[clinic end generated code: output=0b92330786f45483 input=96dc3e6c0cdc0475]*/
/*[clinic end generated code: output=0b92330786f45483 input=2496093514367165]*/
{
PyObject *num, *one, *temp;
long long value;
Expand Down Expand Up @@ -429,12 +437,16 @@ _testcapi_test_long_long_and_overflow_impl(PyObject *module)
/*[clinic input]
_testcapi.test_long_as_size_t

Test the PyLong_As{Size,Ssize}_t API. At present this just tests that non-integer arguments are handled correctly. It should be extended to test overflow handling.
Test the PyLong_As{Size,Ssize}_t API.

At present this just tests that non-integer arguments are handled correctly.

It should be extended to test overflow handling.
[clinic start generated code]*/

static PyObject *
_testcapi_test_long_as_size_t_impl(PyObject *module)
/*[clinic end generated code: output=f6490ea2b41e6173 input=47d303cdd7144351]*/
/*[clinic end generated code: output=f6490ea2b41e6173 input=4d2aafa054f3f9b4]*/
{
size_t out_u;
Py_ssize_t out_s;
Expand Down