Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_bigaddrspace.StrTest Class Reference

List of all members.

Public Member Functions

def test_concat
def test_optimized_concat
def test_repeat

Static Public Attributes

int unicodesize = 2

Detailed Description

Definition at line 56 of file test_bigaddrspace.py.


Member Function Documentation

Definition at line 61 of file test_bigaddrspace.py.

00061 
00062     def test_concat(self):
00063         try:
00064             # Create a string that would fill almost the address space
00065             x = "x" * int(MAX_Py_ssize_t // (1.1 * self.unicodesize))
00066             # Unicode objects trigger MemoryError in case an operation that's
00067             # going to cause a size overflow is executed
00068             self.assertRaises(MemoryError, operator.add, x, x)
00069         finally:
00070             x = None

Here is the call graph for this function:

Definition at line 72 of file test_bigaddrspace.py.

00072 
00073     def test_optimized_concat(self):
00074         try:
00075             x = "x" * int(MAX_Py_ssize_t // (1.1 * self.unicodesize))
00076 
00077             with self.assertRaises(MemoryError) as cm:
00078                 # this statement uses a fast path in ceval.c
00079                 x = x + x
00080 
00081             with self.assertRaises(MemoryError) as cm:
00082                 # this statement uses a fast path in ceval.c
00083                 x +=  x
00084         finally:
00085             x = None

Here is the call graph for this function:

Definition at line 87 of file test_bigaddrspace.py.

00087 
00088     def test_repeat(self):
00089         try:
00090             x = "x" * int(MAX_Py_ssize_t // (1.1 * self.unicodesize))
00091             self.assertRaises(MemoryError, operator.mul, x, 2)
00092         finally:
00093             x = None
00094 

Here is the call graph for this function:


Member Data Documentation

Definition at line 58 of file test_bigaddrspace.py.


The documentation for this class was generated from the following file: