def preprocess(self, arch): libinstructions = Pinguino.get_regobject_libinstructions(arch) for line, expected, include, define, regex in libinstructions: got = Pinguino.replace_word(line, libinstructions) if got != expected: got = Pinguino.replace_word(line, libinstructions) self.assertEqual(got, expected, "Preprocess: Failure\ngot: '%s'\nexpected: '%s'"%(got, expected))
def preprocess(self, arch): libinstructions = Pinguino.get_regobject_libinstructions(arch) for line, expected, include, define, regex in libinstructions: got = Pinguino.replace_word(line, libinstructions) if got != expected: got = Pinguino.replace_word(line, libinstructions) self.assertEqual( got, expected, "Preprocess: Failure\ngot: '%s'\nexpected: '%s'" % (got, expected))
def test_preprocess(self): regobject, libinstructions = Pinguino.get_regobject_libinstructions(8) for line, expected, include, define in libinstructions: got = Pinguino.replace_word(line+"()", regobject, libinstructions) self.assertEqual(got, expected+"()", "Preprocess: Failure\ngot: '%s'\nexpected: '%s'"%(got, expected)) #Test extra words cases = ( ("pinMode", "pinmode"), ("CDC.read", "CDCgets"), ("GLCD.init", "Init"), ) for line, expected, in cases: got = Pinguino.replace_word(line+"()", regobject, libinstructions) expected += "()" self.assertEqual(got, expected, "Preprocess: Failure\ngot: '%s'\nexpected: '%s'"%(got, expected))