HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_bigaddrspace.cpython-37.pyc
B

��g��@s�dZddlmZddlmZmZddlZddlZddlZGdd�dej	�Z
Gdd�dej	�Zd	d
�Ze
dkr�eej�dkr�e�ejd�e�dS)
aT
These tests are meant to exercise that requests to create objects bigger
than what the address space allows are properly met with an OverflowError
(rather than crash weirdly).

Primarily, this means 32-bit builds with at least 2 GiB of available memory.
You need to pass the -M option to regrtest (e.g. "-M 2.1G") for tests to
be enabled.
�)�support)�bigaddrspacetest�MAX_Py_ssize_tNc@s0eZdZedd��Zedd��Zedd��ZdS)�	BytesTestcCs.z"dtd}|�ttj|d�Wdd}XdS)N�x�s�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r�assertRaises�
OverflowError�operator�add)�self�x�r�2/usr/local/lib/python3.7/test/test_bigaddrspace.py�test_concatszBytesTest.test_concatc	CsXzLdtd}|�t��}|d}WdQRX|�t��}|d7}WdQRXWdd}XdS)Nrrs�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)rrr	)rr
�cmrrr�test_optimized_concat szBytesTest.test_optimized_concatcCs.z"dtd}|�ttj|d�Wdd}XdS)Nrr)rrr	r
�mul)rr
rrr�test_repeat/szBytesTest.test_repeatN)�__name__�
__module__�__qualname__rrrrrrrrrsrc@sBeZdZejdkrdndZedd��Zedd��Zedd	��Z	d
S)�StrTesti��cCs8z,dttd|j�}|�ttj||�Wdd}XdS)Nr
g�������?)�intr�unicodesizer�MemoryErrorr
r)rr
rrrr<szStrTest.test_concatc	CsbzVdttd|j�}|�t��}||}WdQRX|�t��}||7}WdQRXWdd}XdS)Nr
g�������?)rrrrr)rr
rrrrrGszStrTest.test_optimized_concatcCs8z,dttd|j�}|�ttj|d�Wdd}XdS)Nr
g�������?r)rrrrrr
r)rr
rrrrVszStrTest.test_repeatN)
rrr�sys�
maxunicoderrrrrrrrrr8srcCst�tt�dS)N)rZrun_unittestrrrrrr�	test_main_sr �__main__�)�__doc__ZtestrZtest.supportrrZunittestr
rZTestCaserrr r�len�argvZset_memlimitrrrr�<module>	s%'