def test_array_set_initialized_container(): import pint,ptype b = ptype.clone(parray.type,_object_=pint.uint8_t,length=4) a = parray.type(_object_=pint.uint8_t,length=4).a a.set((b,)*4) if sum(x.size() for x in a) == 16: raise Success
def test_array_set_initialized_instance(): import pint,ptype b = ptype.clone(parray.type,_object_=pint.uint8_t,length=4) a = parray.type(_object_=pint.uint8_t,length=4).a a.set(tuple(pint.uint32_t().set(0x40) for x in range(4))) if sum(x.int() for x in a) == 256: raise Success
def test_array_set_initialized_instance(): import pint, ptype b = ptype.clone(parray.type, _object_=pint.uint8_t, length=4) a = parray.type(_object_=pint.uint8_t, length=4).a a.set(tuple(pint.uint32_t().set(0x40) for x in range(4))) if sum(x.int() for x in a) == 256: raise Success
def test_array_set_initialized_container(): import pint, ptype b = ptype.clone(parray.type, _object_=pint.uint8_t, length=4) a = parray.type(_object_=pint.uint8_t, length=4).a a.set((b, ) * 4) if sum(x.size() for x in a) == 16: raise Success
def __b(self): return ptype.clone(pint.int_t, length=self['a'].li.int())
def _object_(self): length = 0 if len(self.value) == 0 else (self.value[-1].length+1)%4 return ptype.clone(pint.uint_t,length=length)
def _object_(self): length = 0 if len( self.value) == 0 else (self.value[-1].length + 1) % 4 return ptype.clone(pint.uint_t, length=length)
class st1(pstruct.type): _fields_ = [ (pint.int8_t, 'a'), (lambda s: ptype.clone(pint.int_t, length=s['a'].li.int()), 'b') ]