def test_sys_meth(self): sys = addrxlat.System() newdesc = addrxlat.LinearMethod(0) for i in xrange(addrxlat.SYS_MAP_NUM): map = sys.get_map(i) self.assertIs(map, None) for methidx in xrange(addrxlat.SYS_METH_NUM): sys.set_meth(methidx, newdesc) for i in xrange(methidx): meth = sys.get_meth(i) self.assertEqual(meth, newdesc) for i in xrange(methidx + 1, addrxlat.SYS_METH_NUM): meth = sys.get_meth(i) self.assertEquals(meth.kind, addrxlat.NOMETH)
def test_sys_defaults(self): sys = addrxlat.System() for i in xrange(addrxlat.SYS_MAP_NUM): map = sys.get_map(i) self.assertIs(map, None) for i in xrange(addrxlat.SYS_METH_NUM): meth = sys.get_meth(i) self.assertEquals(meth.kind, addrxlat.NOMETH)
def test_sys_map(self): sys = addrxlat.System() newmap = addrxlat.Map() for mapidx in xrange(addrxlat.SYS_MAP_NUM): sys.set_map(mapidx, newmap) for i in xrange(mapidx + 1): map = sys.get_map(i) self.assertEqual(map, newmap) for i in xrange(mapidx + 1, addrxlat.SYS_MAP_NUM): map = sys.get_map(i) self.assertIs(map, None) for i in xrange(addrxlat.SYS_METH_NUM): meth = sys.get_meth(i) self.assertEquals(meth.kind, addrxlat.NOMETH)