Exemplo n.º 1
0
 def test_sizeof_without_buffer(self):
     a = array.array(self.typecode)
     basesize = support.calcvobjsize('Pn2Pi')
     support.check_sizeof(self, a, basesize)
Exemplo n.º 2
0
 def test_sizeof_with_buffer(self):
     a = array.array(self.typecode, self.example)
     basesize = support.calcvobjsize('Pn2Pi')
     buffer_size = a.buffer_info()[1] * a.itemsize
     support.check_sizeof(self, a, basesize + buffer_size)
Exemplo n.º 3
0
 def check_sizeof(self, format_str, number_of_codes):
     # The size of 'PyStructObject'
     totalsize = support.calcobjsize('2n3P')
     # The size taken up by the 'formatcode' dynamic array
     totalsize += struct.calcsize('P3n0P') * (number_of_codes + 1)
     support.check_sizeof(self, struct.Struct(format_str), totalsize)
Exemplo n.º 4
0
 def check_sizeof(self, format_str, number_of_codes):
     # The size of 'PyStructObject'
     totalsize = support.calcobjsize('2n3P')
     # The size taken up by the 'formatcode' dynamic array
     totalsize += struct.calcsize('P3n0P') * (number_of_codes + 1)
     support.check_sizeof(self, struct.Struct(format_str), totalsize)
Exemplo n.º 5
0
 def check_sizeof(self, format_str, number_of_codes):
     totalsize = support.calcobjsize('2n3P')
     totalsize += struct.calcsize('P3n0P') * (number_of_codes + 1)
     support.check_sizeof(self, struct.Struct(format_str), totalsize)