ó o®¸Qc @s¸ddlZddlZddlTddlZeeeeee e e e e eeg Zeeeeeeeeeeeeg Zdejfd„ƒYZedkr´ejƒndS(iÿÿÿÿN(t*tPointersTestCasecBsteZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z RS( cCsOdttƒfd„ƒY}ttƒtdƒƒ|jt|tdƒƒdS(NtAcBseZRS((t__name__t __module__(((s//sys/lib/python2.7/ctypes/test/test_pointers.pyRsii!(tPOINTERtc_ulongt assertRaisest TypeError(tselfR((s//sys/lib/python2.7/ctypes/test/test_pointers.pyttest_pointer_crash scCsªttjƒ}|j}t|_tdƒ}|t|ƒƒ}|jtj |ƒj dƒt tƒ|_|t |ƒƒ}|j|j j dƒ|j|ddƒdS(NiNa¼i(tCDLLt _ctypes_testt__file__t _testfunc_p_ptc_longtrestypetc_inttbyreft assertEqualt from_addresstvalueRtpointertcontents(R tdlltfunctitaddresstres((s//sys/lib/python2.7/ctypes/test/test_pointers.pyttest_pass_pointerss   cCsÄttjƒ}|j}tdƒ}ttƒ|_ttƒf|_|t|ƒƒ}|j |ddƒ|j |j j dƒd|d<|j |j dƒtdƒ|_ |j |j dƒdS(NifViiIÔi!0( R R R RRRRtargtypesRRRR(R RRRR((s//sys/lib/python2.7/ctypes/test/test_pointers.pyttest_change_pointers%s   csittttƒƒ}gˆ_‡fd†}||ƒ}ttjƒ}|j}||ƒ||ƒdS(Ncs/x(tdƒD]}ˆjj||ƒq WdS(Ni i(trangetresulttappend(targR(R (s//sys/lib/python2.7/ctypes/test/test_pointers.pyRAs(t CFUNCTYPERRR!R R R t_testfunc_callback_with_pointer(R t PROTOTYPERtcallbackRtdoit((R s//sys/lib/python2.7/ctypes/test/test_pointers.pyttest_callbacks_with_pointers;s    cCs~ddlm}xgtttƒD]V\}}|dƒ}t|ƒ}|jt|jƒ|kƒ|j t ||dƒq WdS(Niÿÿÿÿ(tdelitemi*i( toperatorR*tzipt ctype_typest python_typesRt assertTruettypeRRR(R R*tcttptRtp((s//sys/lib/python2.7/ctypes/test/test_pointers.pyt test_basicsXs   cCsTddlm}|ddddddgƒ}|jƒd }tttƒƒ}dS( Niÿÿÿÿ(tarrayRidiÈi,iiôi(R5t buffer_infoRR(R R5tataddrR3((s//sys/lib/python2.7/ctypes/test/test_pointers.pyttest_from_addressfscCs—dtfd„ƒY}t|dddƒƒ}|j|jjdƒ|j|jjdƒ|j|jjdƒd|j_ddlm}||=dS( NtTablecBs)eZdefdefdefgZRS(R7tbtc(RRRt_fields_(((s//sys/lib/python2.7/ctypes/test/test_pointers.pyR:qs  iiii!iÿÿÿÿ(t_pointer_type_cache( t StructureRRRR7R;R<tctypesR>(R R:R2R>((s//sys/lib/python2.7/ctypes/test/test_pointers.pyt test_otherps cCsSttdƒƒ}|jtt|ƒ|j|ddƒ|j|jjdƒdS(Ni*i(RRRRtlenRRR(R R3((s//sys/lib/python2.7/ctypes/test/test_pointers.pyt test_basicscCsgttjƒ}|j}t|_tdƒ}tdƒ}d|ds  ´