Ejemplo n.º 1
0
    def run_test(self, test_inputs, test_outputs):
        if not self._test_setup(): return

        if isinstance(test_inputs, basestring):
            test_inputs = [test_inputs] * len(test_outputs)

        for ins, outs in zip(test_inputs, test_outputs):
            self.m.advance_state(string_to_bools(ins))
            if not self._check_state(self.m.get_output(), outs):
                self.failed_test = self.num_tests
                return
Ejemplo n.º 2
0
    def run_test(self, test_inputs, test_outputs):
        if not self._test_setup(): return

        if isinstance(test_inputs, basestring):
            test_inputs = [test_inputs] * len(test_outputs)

        for ins, outs in zip(test_inputs, test_outputs):
            self.m.advance_state(string_to_bools(ins))
            if not self._check_state(self.m.get_output(), outs):
                self.failed_test = self.num_tests
                return
Ejemplo n.º 3
0
 def do_advance(self, args):
     if len(args) != 6:
         print "You must provide 6 input bits."
         return
     self.m.advance_state(tools.string_to_bools(args))
     self.do_cur_state(None)