def test_func_which(self): res = gdb_test_python_method("which('gdb')") lines = res.splitlines() self.assertIn("/gdb", lines[-1]) res = gdb_test_python_method("which('__IDontExist__')") self.assertIn("Missing file `__IDontExist__`", res) return
def test_function_which(self): res = gdb_test_python_method("which('gdb')") lines = res.splitlines() self.assertTrue(b"/gdb" in lines[-1]) res = gdb_test_python_method("which('__IDontExist__')") self.assertTrue(b"Missing file `__IDontExist__`" in res) return
def test_func_get_filepath(self): res = gdb_test_python_method("get_filepath()", target="/bin/ls") self.assertNoException(res) subprocess.call(["cp", "/bin/ls", "/tmp/foo bar"]) res = gdb_test_python_method("get_filepath()", target="/tmp/foo bar") self.assertNoException(res) subprocess.call(["rm", "/tmp/foo bar"]) return
def test_func_get_pid(self): res = gdb_test_python_method("get_pid()", target="/bin/ls") self.assertNoException(res) self.assertTrue(int(res.splitlines()[-1])) return
def test_func_set_arch(self): res = gdb_test_python_method("current_arch.arch, current_arch.mode", before="set_arch()") res = (res.splitlines()[-1]) self.assertIn("X86", res) return
def test_func_get_memory_alignment(self): res = gdb_test_python_method("get_memory_alignment(in_bits=False)") self.assertIn(res.splitlines()[-1], ("4", "8")) return
def test_function_get_memory_alignment(self): res = gdb_test_python_method("get_memory_alignment(in_bits=False)") self.assertTrue(res.splitlines()[-1] in (b"4", b"8")) return