Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.12.76.151
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_struct.pyo
�
@��cc
@sOddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlZejdkZ
ejdkZdddd	d
ddd
ddf
Zejje�ddZyejdd�Wnejk
r�eZnXeZd�Zd�Zdejfd��YZd�ZedkrKe�ndS(i����N(ttest_support(tcheck_warningstcheck_py3k_warningstbigi���tbtBthtHtitItltLtqtQis.pyicCsdjt|��S(Nt(tjointreversed(ts((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pytstring_reversescCstr
|St|�SdS(N(tISBIGENDIANR(tvalue((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pytbigendian_to_nativest
StructTestcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zed
�Z
eed�Zd�Zd
�Zd�Zd�Zd�Zd�Zejed�d��Zd�Zd�Zejd��Zd�ZRS(cCs�tdtf��}tj||�}WdQXtj�jd}|j|jt	�|j|j
|�|jt|j�d�tj|t
|��}|j||�dS(Ns&.*integer argument expected, got floati(RtDeprecationWarningtstructtpacktinspecttcurrentframetf_linenotassertEqualtfilenamettestmod_filenametlinenotlentwarningstint(tselftformattnumbertwtgotR texpected((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pytcheck_float_coerce$scCs0|jtjdd�dtd�kt�dS(Ns=iii(RRRtchrR(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_isbigendian1scCsr|jtjtjd�tjd�}|j|dtjd��d}d}tj|�}tj|�}|j|d|�|jtjtjdd�|jtjtjdddd�|jttjftjdd�|jttjftjdd�|jtjtjd	d
�tjddd
�}|jtjtjd|�|jtjtjd|�dS(NtZRitiiiscbxxxxxxhhhhiillffd?s3c3b18x12h6i6l6f3d3?tfootPtdtflaptiiii(tassertRaisesRterrortcalcsizeRRt	TypeErrortunpack(R$tsztfmttfmt3tsz3R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_consistence4s """cCsYd}d}d}d}d}d}d}t}x"dD]}	xdD]	}
|	|
}
tj|
||||||||�	}tj|
|�\}}
}}}}}}|j||�|j|
|�|j||�|j||�|j||�|jtd|�td|��|jtd|�td|��|j||�qDWq7WdS(Ntaii�i��igo���!	@Rt@t<t>t=t!s	xcbhilfd?s	xcBHILfd?id(RR?R@RARBRC(s	xcbhilfd?s	xcBHILfd?(tTrueRRR8RR#(R$tcRRRR
tfR1tttprefixR%Rtcptbpthptiptlptfptdpttp((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_transitivenessIs*


'*$$c'Cs�dEdFdGdHdIdJdKdLdMdd
d
dNd
dOdfdPdQdRdSdTdUdVd$dWd"d#dfdXdYdZd-d[d+d,dfd\d]d^d1d_d+d,dfd`dadbdcddded>td@d@dfd>gdddfd>dfd@d@dfg#}x�|D]�\}}}}}x�dA||fdB||fdC||fdD|tr9|p<|fgD]\}}tj||�}	|j|	|�|jtj|�t|	��tj||	�d}
|
|krC|j|�qCqCWq�WdS(gNRER>itxcsatcxsaRt0st
helloworldRit1sRt9st	helloworlt10st11sshelloworldt20si
sRisi����s�Ri�i�s�s�iD���s�DsD�RiRi�,s,�s�,i���s���s���R	l�XlR
RRFg@s@s@R1s@s@g�s�s�s�s�t?isRARCR@RB(RER>R>R>i(RRR>sasai(RSR>sasai(RR>R>R>i(RTRURRi(RVRURRi(RWRURXRXi(RYRURURUi(RZRUshelloworldshelloworldis
s
(Rissi(Ri����s�s�i(Rissi(Ri�s�s�i(Ri�s�s�i(RiD���s�DsD�i(Ri�s�s�iiD�(Ri�,s,�s�,i(Ri���s���s���i(R	l�Xs,�s�,il�b�w(R
i�,s,�s�,i(R
i���s���s���i(Rl�Xs,�s�,il�b�w(RFg@s@s@i(R1g@s@s@i(RFg�s�s�i(R1g�s�s�i(R\issi(R\issi(i(	RDRRRRR6R!R8t
assertTrue(R$ttestsR:targRtliltasytxfmttexptrestrev((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_new_featuresas\*)c	Cs�i
dd6dd6dd6dd6dd6dd	6dd
6dd6dd
6dd6}xLtD]D}x;dD]3}||}tj|�}|j|||�q`WqSWxcdD][}xRddgD]D}tj||d�}tj||d�}|j||�q�Wq�W|jtjd�d�|jdtjd��|jdtjd
��|jtjd�tjd��|jtjd�tjd
��tr�|jtjd
�tjd��|jdtjd
��|jtjd
�tjd
��ndS(NiRRiRRiRR	R
RiRR
RBR@RARCtbBthHtiItlLRR?i(RBR@RARC(RgRhRiRj(t
integer_codesRR6RtassertLessEqualtHAVE_LONG_LONG(	R$t
expected_sizetcodet	byteorderR%tsizetformat_pairtsigned_sizet
unsigned_size((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt
test_calcsize�s2



"""cs�ddl�dtjf���fd��Y�d}xdtD]\}xS|D]K}|d
krv|dkrvtrvqKn||����}|j�qKWq>WdS(Ni����t	IntTestercsAeZ�fd�Zejej�jd�Z�fd�ZRS(cs&t�|�jdd�||_|d|_|d |_|jdkratd
|j��ntj|�|_|jd|_	|jt
d�kr�t|_d
|j	d|_
d
|j	dd|_nQ|jt
d�krt|_d|_
d
|j	d|_ntd|j��dS(Nt
methodNamettest_onei����RR?RBR@RARCs"unrecognized packing direction: %sitbhilqlitBHILQisunrecognized format code: %s(RR?RBR@RARC(tsupert__init__R%Rot	directiont
ValueErrorRR6tbytesizetbitsizettupleRDtsignedt	min_valuet	max_valuetFalse(R$R%(Rv(s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR|�s&	

			c	Ss�|j}|j|ko&|jknrst|�}|jr`|dkr`|d|j>7}n|j|d�d|}t|�d@r�d|}n||�}d|jt|�|}|j	dks�|j	dkr�t
r�t|�}n|jt|�|j�|||�}|j||�|||�d}|j||�|j
tjtf||d|�n"|j
tttjf|||�dS(
Nils%xit0sR@RR?RBs(RR?RB(R%R�R�tlongR�R�tassertGreaterEqualR!RR}RRRR4RR5R7t
OverflowErrorR~(	R$txRR8t	unhexlifyR%R)R(t	retrieved((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyRx�s0	"

cs�ddlm}g}x,t|jd�D]}|jd|>�q*WxXt|j�D]G}d}x+t|j�D]}|d>|d�B}qqW|j|�qUW|jdd	tjd
g�xg|D]_}xV||fD]G}x>d"D]6}||}	|j	t
|	��|j	t|	��q�Wq�Wq�Wd
tfd��Y}
dd#d��Y}dtfd��Y}dtfd��Y}
|j
ttjftj|jd�|j
ttjftj|j|�tdtf��7|j
ttjf��tj|jd$�WdQXWdQXx�|
�|�|
�fD]�}tdtf��}tj|j|�}WdQXtj�jd}|j|jt�|j|j|�|jt|j�d�tj|jt
|��}|j||�q*Wxo|d�|d�|d�|d�|d�|d�fD]1}ytj�|�Wq|jd�qXqWxp|d�|d �|d�|idd6�|dd!dg�fD]+}|j
ttjftj|j|�q�WdS(%Ni����(t	randrangeilliii,i`�
iiit
NotAnIntNScBseZd�Zd�ZRS(cSsdS(Ni*((R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt__int__scSsdS(Nl�((R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt__long__s(t__name__t
__module__R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�s	t
NotAnIntOScBseZd�Zd�ZRS(cSsdS(NiU((R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR� scSsdS(Nl�����((R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�#s(R�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�s	t	IndexablecBseZd�Zd�ZRS(cSs
||_dS(N(t_value(R$R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR|*scSs|jS(N(R�(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt	__index__-s(R�R�R|R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�)s	tBadIndexcBseZd�Zd�ZRS(cSs
t�dS(N(R7(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�3scSsdS(Ni*((R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�6s(R�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�2s	sa strings*integer argument expected, got non-integeryE@s,.*integer argument expected, got non-integeri
ii*idis:integer code pack failed on object with '__index__' methodR>ubi(i����ii(y@E@( trandomR�trangeR�tappendRtextendtsystmaxintRxR#R�tobjectR4R7RR5RR%RRRRRRRRR R!R"tfailtNone(R$R�tvaluesRcRtvaltjtbasetincrR�R�R�R�R�tnonintR'R(R R)tobj(R%(s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pytrun�sf



	
%,(	R�R�R|RRR8R�RxR�((RvtbinasciiR%(s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyRv�s
#RR?RBR@RARCRR
(RR?RBR@RARC(RR?(RR
(R�tunittesttTestCaseRkRmR�(R$t
byteordersRoRpRG((RvR�R%s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt
test_integers�s%�


cCs�x�dddddddddddddddfgD]Y\}}}}tj||�}|j||�tj||�\}|j||�q;WdS(NtptabcsRt1pt2psaR>t3psabtabt4psabct5psabct6psabct1000pR�i�s�i�i�(R�R�sR(R�R�sR(R�R�saR>(R�R�sabR�(R�R�sabcR�(R�R�sabcR�(R�R�sabcR�(RRRR8(R$RotinputR)texpectedbackR(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_p_codels5c	Csfddl}x�tdd�D]�}d}x"||d|krL|d:}q+W||}tjd|�}tjd|�d}|j||�tjd|�}|j|t|��tjd|�d}|j||�qWd}|j|d�}tjd|�}tjd|�d}|j||�d}|j|d�}|jt	tjd|�dS(Ni����ii!g�?g@s<fis>fiiiiii���ihii���ig(
tmathR�RRR8RRtldexpR4R�(	R$R�R�tdeltatsmallertpackedtunpackedt	bigpackedR((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_705836|s*
cCsNxGdD]?}x6tD].}|j||d�|j||d�qWqWdS(NRRAR@g�?g�?(RRAR@(RkR*(R$tendianR:((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_1530559�s

cCs'|d�}d}tj|�}|j|j|�d�|jtj||�d�xktd�D]]}|j|j||�|||d!f�|jtj|||�|||d!f�qcWx\tdt|�d�D]A}|jtj|j||�|jtjtj|||�q�WdS(	Nt	abcd01234t4stabcdiii(R�(R�(RtStructRtunpack_fromtxrangeR!R4R5(R$tclstdataR:RR((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_unpack_from�s*1 c
Cs.d}|dd�}d}tj|�}|j|d|�||�t|� }|j||�|j|d|�||�t|�d }|j||d |�|d	�}|jttjf|j|d|�|jttjf|j|d|�|}	|jttjftjd|	d�dS(
NsReykjavik rocks, eow!t idt21sii
iRs
          (
RR�t	pack_intoR!RR4R~R5R7R�(
R$R�ttobytesttest_stringtwritable_bufR:Rtfrom_buft	small_buftsb((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_pack_into�s$cCs#|jdd�dtjj�dS(NR�cSstjd|�S(NRE(tarray(R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt<lambda>�RR�(R�R�ttostring(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_pack_into_array�scCs |jdd�dtj�dS(NR�cSstt|��S(N(t
memoryviewt	bytearray(R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR��RR�(R�R�R�(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_pack_into_memoryview�scsd}tjddd�}d��fd�}||d|�|j�t|� }|j||�||d|�|j�t|�d }|j||d |�tjdd
�}|jttjf||d|�|jttjf||d	|�dS(NsReykjavik rocks, eow!RER�idR�cstj�|�S(N(RR�(targs(R:(s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR��Rii
is
          (R�R�R!RR4R~RR5(R$R�R�R�R�R�((R:s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_pack_into_fn�scCs�tdtf��utjdd�}tddd�}x9||gD]+}tjd|�\}|j|d�qDW|jd	t�WdQXdS(
Nsbuffer.. not supported in 3.xRs4Vxs......4Vx......iis>IixV4R�(RRR�tbufferRR8RR�(R$tdata1tdata2R�R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_unpack_with_buffer�s
cCsYtd�}x6|gD]+}tjd|�\}|j|d�qW|jdt�dS(Ns4Vxs>IixV4R�(R�RR8RR�(R$R�R�R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_unpack_with_memoryview�s
cCsdtfd��Y}x�td�dD]�}dggddf}dgddd	ddf}|d
t|�}tj||�}tj||�}|d
t|�}tj||�}	tj||	�}
|jt|�t|
��|jt|�t|��x|D]}|j|�qWx|
D]}|j|�q*Wtj|d
d�}|jt|�tj	|d
��t|�dkr�|j|dd|�n|j
ttj|d
|��q'Wx:dddddgD]#}
|jtjd|
�d�q�WdS(Nt
ExplodingBoolcBseZd�ZRS(cSs
t�dS(N(tIOError(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt__nonzero__s(R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR�ss<>!=Riittestii����l��I����iR\tmsgs encoded bool is not one byte: %rsss�ss�s>?(R(li���(R�R�R!RRR8RtassertFalseR]R6R4R�(R$R�RHtfalsettruetfalseFormattpackedFalset
unpackedFalset
trueFormatt
packedTruetunpackedTrueRGR�RE((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt	test_bools2

#sSpecific to 32bit machinescCs|jttjdd�dS(Nt
357913941cR>(R4tMemoryErrorRR(R$((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_crasher*scCsldjtjd�}|jtjtj|�djtjdtjd�}|jtjtj|�dS(Ns{}bis{}b{}Hi(R%R�tmaxsizeR4RR5R6(R$t	hugecountt
hugecount2((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_count_overflow.s cCsJtjd�}|tjd�|d7}tj|tj|�|�dS(Nt5Pt3Pi(tsupporttcalcobjsizeRR6tcheck_sizeofR�(R$t
format_strtnumber_of_codest	totalsize((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR5scCs�xtD]}|j|d�qW|jdd�|jddd�|jdd�|jdd	�|jd
d�|jdd�|jd
d�|jdd�|jdd	�dS(Nit	BHILfdspPi	Ri�tfditxxxxxxxxxxxxxxit100Hidt187st20pRTt0c(RkR(R$Ro((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest__sizeof__<s
cCs�ytWntk
r(|jd�nXtjttd���}|j|jd�|j	t
|j�t�|jt
tjtd��dS(Nsno unicode supportR	i�(tunicodet	NameErrortskipTestRR�tunichrtordRR%tassertIsttypetstrR4R~(R$R((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyttest_unicode_formatJs
( R�R�R*R,R=RQRfRuR�R�R�R�RR�R�R�R�R�R�R�R�R�R�t
skipUnlesstIS32BITR�R�RR�tcpython_onlyRR(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyR"s.	
				5	$	�		#							&		cCstjt�dS(N(R�trun_unittestR(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt	test_mainVst__main__( tosR�R�RRR�RR�ttest.test_supportRRR�RpRR�RRktpathtsplitextt__file__RRR5R�RmRDRRR�RRR�(((s7/usr/local/python-2.7/lib/python2.7/test/test_struct.pyt<module>s0$
		��6	
© 2025 GrazzMean