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.10/test/__pycache__/test_bigaddrspace.cpython-310.pyc
o

�iR�@s�dZddlmZddlmZmZddlZddlZddlZGdd�dej	�Z
Gdd�dej	�Zed	krGe
ej�d
krAe�ejd
�e��dSdS)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)�	BytesTestcCs0zdtd}|�ttj|d�Wd}dSd}w�N�x�s�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r�assertRaises�
OverflowError�operator�add��self�x�r�3/usr/local/lib/python3.10/test/test_bigaddrspace.py�test_concatszBytesTest.test_concatcCs�zBdtd}|�t��}|d}Wd�n1swY|�t��}|d7}Wd�n
1s4wYWd}dSWd}dSd}wr)rr	r
�rr�cmrrr�test_optimized_concat s
�
��zBytesTest.test_optimized_concatcCs0zdtd}|�ttj|d�Wd}dSd}w)Nrr)rr	r
r�mulr
rrr�test_repeat/szBytesTest.test_repeatN)�__name__�
__module__�__qualname__rrrrrrrrrs


rc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�StrTest�cCs:zdttd|j�}|�ttj||�Wd}dSd}w�Nr皙�����?)�intr�unicodesizer	�MemoryErrorrrr
rrrr<szStrTest.test_concatcCs�zGdttd|j�}|�t��}||}Wd�n1s wY|�t��}||7}Wd�n
1s9wYWd}dSWd}dSd}wr)rrr r	r!rrrrrGs
�
��zStrTest.test_optimized_concatcCs:zdttd|j�}|�ttj|d�Wd}dSd}w)Nrr�)rrr r	r!rrr
rrrrVszStrTest.test_repeatN)rrrr rrrrrrrrr8s


r�__main__�)�__doc__�testrZtest.supportrrZunittestr�sysZTestCaserrr�len�argvZset_memlimit�mainrrrr�<module>s
%'�