HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/test/__pycache__/test_bigaddrspace.cpython-36.pyc
3


 \��@s�dZddlmZddlmZmZddlZddlZddlZGdd�dej	�Z
Gdd�dej	�Zd	d
�Ze
dkr�eej�dkr�ejejd�e�dS)
aS
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 GB 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)�	BytesTestcCs2z&dtd}|jttj|dd�Wdd}XdS)N�x�)r�assertRaises�
OverflowError�operator�add)�self�x�r�)/usr/lib64/python3.6/test_bigaddrspace.py�test_concatszBytesTest.test_concatcCs`zTdtd}|jt��}|dd}WdQRX|jt��}|dd7}WdQRXWdd}XdS)Nrr)rrr	)rr
�cmrrr�test_optimized_concat szBytesTest.test_optimized_concatcCs.z"dtd}|jttj|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�}|jttj||�Wdd}XdS)Nr
g�������?)�intr�unicodesizer�MemoryErrorr
r)rr
rrrr<szStrTest.test_concatcCsbzVdttd|j�}|jt��}||}WdQRX|jt��}||7}WdQRXWdd}XdS)Nr
g�������?)rrrrr)rr
rrrrrGszStrTest.test_optimized_concatcCs8z,dttd|j�}|jttj|d�Wdd}XdS)Nr
g�������?r)rrrrrr
r)rr
rrrrVszStrTest.test_repeatN)
rrr�sys�
maxunicoderrrrrrrrrr8srcCstjtt�dS)N)rZrun_unittestrrrrrr�	test_main_sr �__main__�)�__doc__ZtestrZtest.supportrrZunittestr
rZTestCaserrr r�len�argvZset_memlimitrrrr�<module>	s%'