Beispiel #1
0
 def test_use_array_after_free_error(self):
     s = FloatArray()
     s.free()
     with self.assertRaises(GaugedUseAfterFreeError):
         len(s)
     with self.assertRaises(GaugedUseAfterFreeError):
         s.values()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.values()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.append(1)
     with self.assertRaises(GaugedUseAfterFreeError):
         s.byte_length()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.buffer()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.clear()
Beispiel #2
0
 def test_use_array_after_free_error(self):
     s = FloatArray()
     s.free()
     with self.assertRaises(GaugedUseAfterFreeError):
         len(s)
     with self.assertRaises(GaugedUseAfterFreeError):
         s.values()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.values()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.append(1)
     with self.assertRaises(GaugedUseAfterFreeError):
         s.byte_length()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.buffer()
     with self.assertRaises(GaugedUseAfterFreeError):
         s.clear()
Beispiel #3
0
 def test_array_clear(self):
     s = FloatArray([1, 2, 3])
     self.assertEqual(s.byte_length(), 12)
     s.clear()
     self.assertEqual(s.byte_length(), 0)
     s.free()
Beispiel #4
0
 def test_array_clear(self):
     s = FloatArray([1, 2, 3])
     self.assertEqual(s.byte_length(), 12)
     s.clear()
     self.assertEqual(s.byte_length(), 0)
     s.free()