summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34229: Check start and stop of slice object to be long when they are not ↵Xtreak2018-07-261-0/+24
| | | | int in PySlice_GetIndices (GH-8480)
* [2.7] bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192). (GH-8255)Serhiy Storchaka2018-07-111-0/+61
| | | | | (cherry picked from commit 504373c59b48f1ea12132d515459022730db6047) Also backport tests for skipitem() and handling errors.
* Don't export pending_threadfunc from _testcapi. (GH-8075)Miss Islington (bot)2018-07-041-1/+2
| | | | | (cherry picked from commit b4588c2fffbda91e4c2f0cf2b0fc3d14def95608) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-31719: Fix test_regrtest.test_crashed() on s390x (#3912)Victor Stinner2017-10-091-0/+17
| | | | | | | Add a new _testcapi._read_null() function to crash Python in a reliable way on s390x. On s390x, ctypes.string_at(0) returns an empty string rather than crashing.
* consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563)Benjamin Peterson2017-09-141-4/+2
| | | This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
* [2.7] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3235)Oren Milman2017-08-291-9/+18
|
* bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3071)Victor Stinner2017-08-111-0/+22
| | | | | | | | | | | | | | The current test_child_terminated_in_stopped_state() function test creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and then crash (SIGSEGV). The problem is that calling os.waitpid() in the parent process is not enough to close the process: the child process remains alive and so the unit test leaks a child process in a strange state. Closing the child process requires non-trivial code, maybe platform specific. Remove the functional test and replaces it with an unit test which mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to test the WIFSTOPPED() path. (cherry picked from commit 7b7c6dcfff6a35333988a3c74c895ed19dff2e09)
* bpo-30764: Windows support.SuppressCrashReport (#2423)Victor Stinner2017-06-271-0/+51
| | | | | | * Add Windows support to test.support.SuppressCrashReport: call SetErrorMode() and CrtSetReportMode(). * _testcapi: add CrtSetReportMode() and CrtSetReportFile() functions and CRT_xxx and CRTDBG_xxx constants needed by SuppressCrashReport.
* [2.7] bpo-30283: Backport test_regrtest from master to 2.7 (#1513)Victor Stinner2017-05-091-0/+20
| | | | | | | | | | * bpo-30283: regrtest: add --testdir option * bpo-30283: Backport _testcapi.raise_signal() Function used by test_regrtest to simulate an interrupted unit test. * bpo-30283: Backport test_regrtest from master
* fix _testcapi to work when statically linked into pythonBenjamin Peterson2017-01-161-2/+2
|
* Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"Serhiy Storchaka2016-05-201-0/+95
| | | | format unit.
* Issue #26995: Added tests for "f", "d", "D", "S", "Y", and "U" format codesSerhiy Storchaka2016-05-161-0/+67
| | | | in PyArg_ParseTuple().
* Backported tests for issue #18531.Serhiy Storchaka2016-05-161-0/+22
|
* Fixed a crash in new tests in test_getargs2 added in 60a2d67dacb3 (issue ↵Serhiy Storchaka2016-01-281-8/+8
| | | | #26198).
* Issue #26198: Added tests for string-related format units of PyArg_Parse*()Serhiy Storchaka2016-01-281-3/+294
| | | | | functions: "s", "s*", "s#", "t#", "z", "z*", "z#", "w", "w*", "w#", "u", "u#", "es", "et", "es#", "et#" and "c".
* Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar().Antoine Pitrou2015-06-231-0/+12
|
* Issue #23392: Added tests for marshal C API that works with FILE*.Serhiy Storchaka2015-02-061-0/+166
|
* Issue #23370: Fix off-by-one error for non-contiguous buffers.Stefan Krah2015-02-011-0/+53
|
* Issue #23349: Fix off-by-one error in PyBuffer_ToContiguous(). Initial patchStefan Krah2015-01-301-0/+48
| | | | by Richard Hansen.
* Issue #14432: Generator now clears the borrowed reference to the thread stateVictor Stinner2013-12-131-0/+94
| | | | | | | Fix a crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
* Issue #15866: The xmlcharrefreplace error handler no more produces two XMLSerhiy Storchaka2013-08-061-1/+1
| | | | entities for a non-BMP character on narrow build.
* Issue #17928: Fix test_structmembers on 64-bit big-endian machines.Antoine Pitrou2013-05-081-1/+1
| | | | (_testcapi isn't Py_ssize_t-clean, the "s#" code should use an int for length)
* Issue #13093: Fix _testcapi.unicode_encodedecimal()Victor Stinner2011-11-281-1/+1
| | | | | _testcapimodule.c is not "ssize_t" safe in Python 2.7: the length argument type is int, not Py_ssize_t.
* Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()Victor Stinner2011-11-221-0/+36
| | | | Add tests for PyUnicode_EncodeDecimal()
* PyEval_CallObject requires a tuple of args (closes #13186)Benjamin Peterson2011-10-151-0/+14
|
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-1401/+1401
|
* Fix a couple of issues with the test_structmembersType class in _testcapimoduleMark Dickinson2010-04-031-10/+17
| | | | | | | | | | | | | - rename to _test_structmembersType to avoid the class being automatically called by test_capi - allow space for trailing NUL in inplace_member field of all_structmembers - use T_STRING_INPLACE instead of T_INPLACE_STRING as keyword argument to _test_structmembersType initializer - don't attempt to initialize inplace_member field if T_STRING_INPLACE argument wasn't supplied.
* give TypeError when trying to set T_STRING_INPLACEBenjamin Peterson2010-04-031-3/+14
|
* Backported PyCapsule from 3.1, and converted most uses ofLarry Hastings2010-03-251-0/+152
| | | | CObject to PyCapsule.
* Issue #7385: Fix a crash in `MemoryView_FromObject` whenAntoine Pitrou2010-02-021-0/+95
| | | | `PyObject_GetBuffer` fails. Patch by Florent Xicluna.
* be robust against test being run over and over (such as -R)Benjamin Peterson2010-01-301-3/+13
|
* move test outside WITH_THREAD sectionBenjamin Peterson2010-01-301-2/+3
|
* Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, aMark Dickinson2010-01-301-0/+167
| | | | | long long variant of PyLong_AsLongAndOverflow. Patch by Case Van Horsen.
* #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new ↵Georg Brandl2009-12-281-0/+22
| | | | exceptions a docstring.
* Additional edge-case tests for test_long_and_overflow.Mark Dickinson2009-12-211-16/+107
|
* Fix reference counts for test_long_and_overflow.Mark Dickinson2009-12-211-0/+6
|
* Issue #7528: Backport PyLong_AsLongAndOverflow from py3k to trunk.Mark Dickinson2009-12-211-0/+70
| | | | Thanks Case Van Horsen for the patch.
* Add missing tests for PyArg_Parse* with format 'h'Mark Dickinson2009-12-201-0/+10
|
* add a test of loading the datetime capiBenjamin Peterson2009-12-131-0/+16
|
* Issue #7228: Add '%lld' and '%llu' support to PyFormat_FromString,Mark Dickinson2009-11-151-0/+6
| | | | PyFormat_FromStringV and PyErr_Format.
* PyCode_NewEmpty:Jeffrey Yasskin2009-05-081-0/+16
| | | | | | | | Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New are trying to build an empty code object, usually to put it in a dummy frame object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify just the filename, function name, and first line number, instead of also requiring lots of code internals.
* tabify :(Benjamin Peterson2009-05-051-5/+5
|
* fix running test_capi with -R ::Benjamin Peterson2009-05-051-0/+9
| | | | Also, fix a refleak in the test that was preventing running. :)
* Issue 4474: On platforms with sizeof(wchar_t) == 4 andMark Dickinson2009-03-181-0/+43
| | | | | | | | | sizeof(Py_UNICODE) == 2, PyUnicode_FromWideChar now converts each character outside the BMP to the appropriate surrogate pair. Thanks Victor Stinner for the patch. (backport of r70452 from py3k to trunk)
* Issue 4293: Make Py_AddPendingCall() thread safeKristján Valur Jónsson2009-01-091-0/+38
| | | | Add test cases and documentation
* Just inserted blank line.Hirokazu Yamamoto2008-12-311-0/+1
|
* Fixed compile error on windows.Hirokazu Yamamoto2008-12-311-1/+2
|
* Issue #4701: implicitly call PyType_Ready from PyObject_HashNick Coghlan2008-12-301-0/+101
|
* make global staticBenjamin Peterson2008-12-231-1/+1
|
* use a global variable, so the compiler doesn't optimize the assignment outBenjamin Peterson2008-12-231-2/+3
|