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