コード例 #1
0
ファイル: test.py プロジェクト: Darriall/pinguino-ide
    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))
コード例 #2
0
    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))
コード例 #3
0
ファイル: tests.py プロジェクト: sherckuith/pinguino-ide
    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))