Your IP : 216.73.216.213


Current Path : /opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyo

�
��]c@s�dZddlZddlZddlZddlmZddlmZddlZddlmZm	Z	dej
fd��YZdS(s�
Test libpython.py. This is already partly tested by test_libcython_in_gdb and
Lib/test/test_gdb.py in the Python source. These tests are run in gdb and
called from test_libcython_in_gdb.main()
i����N(t	libcython(t	libpython(t_debugtinferior_python_versiontTestPrettyPrinterscBszeZdZd�Zd�Zdd�Zd�Zdd�Zdd�Z	d�Z
d�Zd	�Zd
�Z
d�ZRS(
s�
    Test whether types of Python objects are correctly inferred and that
    the right libpython.PySomeTypeObjectPtr classes are instantiated.

    Also test whether values are appropriately formatted (don't be too
    laborious as Lib/test/test_gdb.py already covers this extensively).

    Don't take care of decreffing newly allocated objects as a new
    interpreter is started for every test anyway.
    cCs$tt|�j�|jd�dS(Ns
b = c = d = 0(tsuperRtsetUpt
break_and_run(tself((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyR!scCstj|�}|S(N(tgdbtparse_and_eval(Rtcodetvalue((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pytget_pyobject%scCsW|dk	r>i|d6|d6}tjd|�d|}ntjj|j|��S(NtvarnameRsset $%(varname)s = %(code)st$(tNoneR	texecuteRtPyObjectPtrtfrom_pyobject_ptrR
(RRtgdbvartd((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pytpyobject_fromcode*s

cCs|jtj�S(N(tget_truncated_reprRtMAX_OUTPUT_LEN(Rtpyobject((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pytget_repr2scCsGtdkrd}nd}d||t|�f}|j|d|�S(NiitPyString_FromStringAndSizetPyBytes_FromStringAndSizes(PyObject *) %s("%s", %d)R(ii(RtlenR(RtstringRtfuncnameR((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pytalloc_bytestring5s
	cCsL|j|jd�dd�tj�}d|f}|jd|d|�S(NsUTF-8Rt_tempsPyUnicode%s_FromEncodedObjects*(PyObject *) %s($_temp, "UTF-8", "strict")(R tencodeRtget_inferior_unicode_postfixR(RRRtpostfixR((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pytalloc_unicodestringAs

cCsu|jd�}tdkr3tj}td�}ntj}d}|jt|�|�|j|j|�|�dS(Ntspamiisb'spam'(ii(	R RRtPyStringObjectPtrtreprtPyBytesObjectPtrtassertEqualttypeR(Rt
bytestringtbytestring_classtexpected((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyttest_bytestringKs		cCsd|jd�}d}tdkr.d|}n|jt|�tj�|j|j|�|�dS(Nuspam ἄλφαs'spam ἄλφα'iitu(ii(R%RR*R+RtPyUnicodeObjectPtrR(Rtunicode_stringR.((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyttest_unicodeXs
cCsTtdkrP|jd�}|jt|�tj�|j|j|�d�ndS(NiisPyInt_FromLong(100)t100(ii(RRR*R+RtPyIntObjectPtrR(Rtintval((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyttest_intbscCsK|jddd�}|jt|�tj�|j|j|�d�dS(NsPyLong_FromLong(200)Rtlongvalt200(RR*R+RtPyLongObjectPtrR(RR8((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyt	test_longhs	cCs,|jd�}|jt|�tj�dS(NsPyEval_GetFrame()(RR*R+RtPyFrameObjectPtr(Rtframe((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyttest_frame_typepsN(t__name__t
__module__t__doc__RR
RRRR R%R/R3R7R;R>(((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyRs
			
	
	
		(RAtostsysR	tCython.DebuggerRRttest_libcython_in_gdbRRt
DebugTestCaseR(((s^/opt/alt/python27/lib64/python2.7/site-packages/Cython/Debugger/Tests/test_libpython_in_gdb.pyt<module>s