Beispiel #1
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()
Beispiel #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()
Beispiel #3
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())
Beispiel #4
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)