Exemplo n.º 1
0
    def test_inferior(self):
        inferior_factory = TestInferiorFactory()
        inferior = inferior_factory.create_inferior(self._cpu, 0)

        self.assertEqual(0, inferior.id())
        self.assertEqual(inferior.cpu().architecture(),
                         self._cpu.architecture())
Exemplo n.º 2
0
 def setUp(self):
     cpu_factory = TestCpuFactory()
     cpu = cpu_factory.create_cpu(TestCpu.architecture())
     inferior_factory = TestInferiorFactory()
     inferior = inferior_factory.create_inferior(cpu, 0)
     self._inferior_repository = InferiorRepository()
     self._inferior_repository.add_inferior(inferior)
     thread_factory = TestThreadFactory()
     thread_factory.create_thread(inferior, 0)
     self._platform_factory = TestPlatformFactory()
Exemplo n.º 3
0
 def setUp(self):
     cpu_factory = TestCpuFactory()
     cpu = cpu_factory.create_cpu(TestCpu.architecture())
     inferior_factory = TestInferiorFactory()
     inferior = inferior_factory.create_inferior(cpu, 0)
     self._inferior_repository = InferiorRepository()
     self._inferior_repository.add_inferior(inferior)
     thread_factory = TestThreadFactory()
     thread_factory.create_thread(inferior, 0)
     self._platform_factory = TestPlatformFactory()
Exemplo n.º 4
0
    def test_thread(self):
        inferior_factory = TestInferiorFactory()
        inferior = inferior_factory.create_inferior(self._cpu, 0)
        thread_factory = TestThreadFactory()
        thread = thread_factory.create_thread(inferior, 0)
        inferior.add_thread(thread)

        self.assertTrue(inferior.has_thread(0))
        thread = inferior.thread(0)
        self.assertEqual(0, thread.id())
Exemplo n.º 5
0
    def test_command(self):
        inferior_factory = TestInferiorFactory()
        thread_factory = TestThreadFactory()
        inferior_repository = InferiorRepository()
        bldr = CommandBuilder(TestCommandFactory(), inferior_repository,
                              TestPlatformFactory(), inferior_factory,
                              thread_factory, Configuration(), self._terminal)

        self.assertIn(TestCommand.name(), bldr.commands)
        self.assertIn(TestDataCommand.name(), bldr.commands)