Ejemplo n.º 1
0
 def test_bit_field_conversions(self):
     ibl = []
     cv = ConvertValue()
     for i in range(0, 32):
         ib = rand.randrange(0, 2)
         cv.convert_bits(ib)
         ibl.append(ib)
     cr = ConvertBitField(_buffer(cv.collapsed_buffer()))
     for i in range(0, 32):
         j = cr.status(i)
         if ibl[i] != j:
             raise 'BIT conversion failed'
Ejemplo n.º 2
0
 def test_bit_field_conversions(self):
     ibl = []
     cv = ConvertValue()
     for i in range(0,32):
         ib = rand.randrange(0, 2)
         cv.convert_bits(ib)
         ibl.append(ib)
     cr = ConvertBitField(_buffer(cv.collapsed_buffer()))
     for i in range(0,32):
         j = cr.status(i)
         if ibl[i] != j:
             raise 'BIT conversion failed'
Ejemplo n.º 3
0
 def __init__(self, buffer=None):
     if buffer is None:
         buffer = _buffer()
     self.buffer = buffer
     return