ó o®¸Qc@s³ddlZddlTddlmZddlZdejfd„ƒYZdejfd„ƒYZdejfd „ƒYZd ejfd „ƒYZ e d kr¯ej ƒndS( iÿÿÿÿN(t*(tcalcsizetSubclassesTestcBseZd„Zd„ZRS(cCsòdtfd„ƒY}d|fd„ƒY}d|fd„ƒY}|jt|ƒttƒƒ|jt|ƒttƒdƒ|jt|ƒttƒƒ|j|jdtfgƒ|j|jd tfgƒ|j|jdtfgƒdS( NtXcBseZdefgZRS(ta(t__name__t __module__tc_intt_fields_(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRstYcBseZdefgZRS(tb(RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR stZcBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR siRR (t Structuret assertEqualtsizeofRR(tselfRR R ((s1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_subclasss cCsHdtfd„ƒY}|jt|ƒdƒdtfg|_d|fd„ƒY}|jt|ƒt|ƒƒdtfg|_d|fd „ƒY}|jt|ƒttƒƒ|jt|ƒttƒd ƒ|jt|ƒttƒƒ|j|jdtfgƒ|j|jdtfgƒ|j|jdtfgƒdS( NRcBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRsiRR cBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR sR R cBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR #si(R R RRR(RRR R ((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_subclass_delayeds (RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRs tStructureTestCasecBseZi ed6ed6ed6ed6ed6ed6ed6e d6e d6e d 6e d 6e d 6ed 6Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#RS(!tcR tBthtHtitItltLtqtQtftdcsrxk|jjƒD]Z\}‰dtf‡fd†ƒY}|jt|ƒ|ftd||fƒ|fƒqWdS(NRcs eZdefdˆfgZRS(txty(RRtc_charR((ttp(s1/sys/lib/python2.7/ctypes/test/test_structures.pyR?s sc%c0%c(tformatstitemsR R RR(RtcodeR((R"s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_simple_structs=scslxe|jjƒD]T\}‰dtf‡fd†ƒY}|jt|ƒ|ftd|ƒ|fƒqWdS(NRcs eZdefdˆfgZRS(RR (RRR!R((R"(s1/sys/lib/python2.7/ctypes/test/test_structures.pyRGs s%c(R#R$tUnionR RR(RR%R((R"s1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_unionsEscsÀdtfd„ƒY‰|jtˆƒtdƒƒ|jtˆƒtdƒƒdtfd„ƒY‰|jtˆƒtdƒƒ|jtˆƒtdƒƒd tf‡‡fd †ƒY}|jt|ƒttˆƒtˆƒƒƒ|jt|ƒtd ƒƒd tf‡‡fd †ƒY}|jt|ƒttˆƒtˆƒƒƒ|jt|ƒtdƒƒdtf‡fd†ƒY}|jt|ƒtˆƒƒ|jt|ƒtdƒƒdS(NRcBseZdedfgZRS(Ri(RRR!R(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRNstst3sR cBs$eZdedfdefgZRS(RiR (RRR!RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR Ss Rt3sitSIcs eZdˆfdˆfgZRS(RR (RRR((RR (s1/sys/lib/python2.7/ctypes/test/test_structures.pyR,Ys s 3s0i 3si 0itIScs eZdˆfdˆfgZRS(R R(RRR((RR (s1/sys/lib/python2.7/ctypes/test/test_structures.pyR-_s s 3si 3s 0itXXcs eZdˆfdˆfgZRS(RR (RRR((R(s1/sys/lib/python2.7/ctypes/test/test_structures.pyR.fs s3s 3s 0s(R R t alignmentRRtmax(RR,R-R.((RR s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_struct_alignmentMs++csÖdtfd„ƒY‰dtfd„ƒY}|jtˆƒt|ƒkoUdknƒ|jtˆƒt|ƒko„dknƒdtf‡fd†ƒY}|jt|ƒdƒ|jt|ƒdƒdS( NRcBseZgZRS((RRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRpsR cBseZgZRS((RRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR ssiiR.cs eZdˆfdˆfgZRS(RR (RRR((R(s1/sys/lib/python2.7/ctypes/test/test_structures.pyR.zs (R R't assertTrueR/RR (RR R.((Rs1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_emtpyls//cCs†dtfd„ƒY}|j|jjdƒ|j|jjttƒƒ|j|jjttƒƒ|j|jjttƒƒ|j t t ft |jddƒ|j t t ft |jddƒdt fd„ƒY}|j|jjdƒ|j|jjttƒƒ|j|jjdƒ|j|jjttƒƒ|j t t ft |jddƒ|j t t ft |jddƒdS(NRcBs eZdefdefgZRS(RR (RRRR!R(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRƒs itoffseti\tsizecBs eZdefdefgZRS(RR (RRRR!R(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR‘s (R R RR4R5RRR R!t assertRaisest TypeErrortAttributeErrortsetattrR'(RR((s1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_fieldss"""cCsdtfd„ƒY}|jt|ƒdƒ|j|jjdƒdtfd„ƒY}|jt|ƒdƒ|j|jjdƒdtfd„ƒY}|jt|ƒd ƒ|j|jjd ƒd dl}|jd ƒ}|jd ƒ|}dtfd„ƒY}|jt|ƒ||ƒ|j|jjtd|ƒƒiddgd6d d6}|jt t tƒdtf|ƒidt fgd6t j dd6}|jt t tƒdtf|ƒidt fgd6t jdd6}|jt t tƒdtf|ƒdS(NRcBs&eZdefdefgZdZRS(RR i(RRtc_bytet c_longlongRt_pack_(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR£s i icBs&eZdefdefgZdZRS(RR i(RRR;R<RR=(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR«s i icBs&eZdefdefgZdZRS(RR i(RRR;R<RR=(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR²s i iiÿÿÿÿRtbqcBs&eZdefdefgZdZRS(RR i(RRR;R<RR=(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR½s iRR RR=(RR (R R(R R RR R4tstructRtminR6t ValueErrorttypeR;t _testcapitINT_MAXtUINT_MAX(RRR?t longlong_sizetlonglong_alignR((s1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_packed¢s2   ""cCs¤dtfd„ƒY}|jt|dƒ|jt|dƒ|jt|ddƒ|j|ddƒjdƒ|j|d dƒjd ƒ|jt|d dƒdS( NtPersoncBs$eZdedfdefgZRS(tnameitage(RRR!RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRIÔs i*tasldkjaslkdjaslkdjtNametHIt12345it123456t1234567(R R6R7RAR RJ(RRI((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_initializersÓscCskdtfd„ƒY}|jt|ddddƒ|jt|ddddƒ|jt|dddƒdS(NtPOINTcBs eZdefdefgZRS(RR (RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRSäsiiRiR (R R6R7(RRS((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_conflicting_initializersãscCsvdtfd„ƒY}|ddƒ}|j|j|jfdƒ|ddddƒ}|j|j|jfdƒdS( NRScBs eZdefdefgZRS(RR (RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRSîsiiR R(ii(ii(R R RR (RRStpt((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_keyword_initializersís cCs9dtfd„ƒY}|jtt|ddd gƒdS( NRScBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRS÷sRRiR i(Ri(R i(R R6R7R9(RRS((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_invalid_field_typesöscCs d„}|jt|dƒdS(Ncs dtf‡fd†ƒY}dS(NtScseZˆefgZRS((RRRR((RJ(s1/sys/lib/python2.7/ctypes/test/test_structures.pyRXþs(R (RJRX((RJs1/sys/lib/python2.7/ctypes/test/test_structures.pytdeclare_with_nameýsuxé(R6R7(RRY((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_invalid_nameûs cCsŠdtfd„ƒY}|j|d ƒjddddgƒ|j|d ƒjddd…ddddgƒ|j|d ƒjddd…ddddgƒ|j|dƒjddd…ddgƒ|j|dƒjddd…dgƒ|j|dƒjdd d…gƒ|j|dƒjddd d gƒ|j|dƒjddd…ddd d gƒ|jt|dƒdS(NtSomeIntscBseZdedfgZRS(Ri(RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR[siiiiÿÿÿÿiiii(ii(ii(ii(ii(ii(ii(iiii(iiii(iiiii(R R RtNoneR6t RuntimeError(RR[((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_intarray_fieldss&22,)&&2csšdtfd„ƒY‰dtf‡fd†ƒY}|dd dƒ}|j|jdƒ|j|jjdƒ|j|jjdƒ|j|jdƒdS( NtPhonecBs(eZdedfdedfgZRS(tareacodeitnumberi (RRR!R(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR_s RIcs-eZdedfdˆfdefgZRS(RJi tphoneRK(RRR!RR((R_(s1/sys/lib/python2.7/ctypes/test/test_structures.pyRIs  tSomeonet1234t5678i(RdRe(R R RJRbR`RaRK(RRItp((R_s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_nested_initializersscCs´ytWntk rdSXdtfd„ƒY}|dƒ}|j|jdƒ|j|dƒjdƒ|j|dƒjdƒ|j|dƒjdƒ|jt|dƒdS( NtPersonWcBs$eZdedfdefgZRS(RJi RK(RRtc_wcharRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRh,s uSomeoneRcu 1234567890u 12345678901u 123456789012u 1234567890123(Rit NameErrorR R RJR6RA(RRhRf((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_structures_with_wchar&s  csðdtfd„ƒY‰dtf‡fd†ƒY}|j|ddƒ\}}|j|tƒtttƒr|j|dƒn|j|d ƒ|j|ddƒ\}}|j|tƒtttƒrÜ|j|d ƒn|j|dƒdS(NR_cBs(eZdedfdedfgZRS(R`iRai (RRR!R(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR_;s RIcs-eZdedfdˆfdefgZRS(RJi RbRK(RRR!RR((R_(s1/sys/lib/python2.7/ctypes/test/test_structures.pyRI?s  RciisS(Phone) : expected string or Unicode object, int foundsJ(Phone) exceptions.TypeError: expected string or Unicode object, int foundRR Rs<(Phone) : too many initializerss3(Phone) exceptions.TypeError: too many initializers(ii(RR R(R t get_exceptR R]t issubclasst Exceptiontobject(RRItclstmsg((R_s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_init_errors:s     cCs`d„}xPgtddƒD]}d|^qD](}y||ƒWq0tk rWq0Xq0WdS(Ncs dtf‡fd†ƒY}dS(NRXcseZdˆefgZRS(R(RRRR((tlength(s1/sys/lib/python2.7/ctypes/test/test_structures.pyRX[s(R (RsRX((Rss1/sys/lib/python2.7/ctypes/test/test_structures.pyt create_classZsiii (tranget MemoryError(RRtRRs((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_huge_field_nameXs  - cGs8y||ŒWn#tk r3}|jt|ƒfSXdS(N(Rnt __class__tstr(Rtfunctargstdetail((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRlescCsTdtfd„ƒY}|jtdtƒƒ\}}|j||ftdfƒdS(NRcBseZdZRS(t something(RRt _abstract_(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyRussX()sabstract class(R RltevaltlocalsR R7(RRRpRq((s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_abstract_classtscCsa|jdtttƒƒkƒ|jdtttƒƒkƒ|jdtttƒƒkƒdS(Ntin_dllt from_address(R2tdirRBR (R((s1/sys/lib/python2.7/ctypes/test/test_structures.pyt test_methods{scsdtfd„ƒY}d|fd„ƒY}d|fd„ƒY}d|fd„ƒY‰ˆd d d d d dƒ}|j|j|j|j|j|j|jfdƒˆd ƒ}|j|j|j|j|j|j|jfdƒ|jt ‡fd†ƒdS(NtWcBs eZdefdefgZRS(RR (RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR†…sRcBseZdefgZRS(R(RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR‡sR cBseZRS((RR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR ‰sR cBs)eZdefdefdefgZRS(RteR(RRRR(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR ‹siiiiiiicsˆdddddddƒS(Niiiiiii(((R (s1/sys/lib/python2.7/ctypes/test/test_structures.pyt”s(iiiiii(iiiiii( R R RR RRR‡RR6R7(RR†RR tz((R s1/sys/lib/python2.7/ctypes/test/test_structures.pyttest_positional_argsƒs- -($RRR!R;tc_ubytetc_shorttc_ushortRtc_uinttc_longtc_ulongR<t c_ulonglongtc_floattc_doubleR#R&R(R1R3R:RHRRRTRVRWRZR^RgRkRrRwRlRR…RŠ(((s1/sys/lib/python2.7/ctypes/test/test_structures.pyR-sB       ! 1          tPointerMemberTestCasecBseZd„Zd„ZRS(cCsdtfd„ƒY}|ƒ}tddddƒ|_gtdƒD]}|j|^qE}|j|dddgƒd|jds   'ÿj)