| 239 | checklist = [] |
| 240 | |
| 241 | def test_syscall_read(ql: Qiling, fd: int, buf: int, count: int): |
| 242 | retval = syscall.ql_syscall_read(ql, fd, buf, count) |
| 243 | |
| 244 | hpath = ql.os.fd[fd].name |
| 245 | |
| 246 | if os.path.basename(hpath) == "test_syscall_read.txt": |
| 247 | mcontent = ql.mem.read(buf, count) |
| 248 | |
| 249 | with open(hpath, 'rb') as infile: |
| 250 | fcontent = infile.read() |
| 251 | |
| 252 | if ql.host.os is not QL_OS.WINDOWS: |
| 253 | os.remove(hpath) |
| 254 | |
| 255 | self.assertEqual(mcontent, fcontent) |
| 256 | checklist.append('read') |
| 257 | |
| 258 | return retval |
| 259 | |
| 260 | def test_syscall_write(ql: Qiling, fd: int, buf: int, count: int): |
| 261 | retval = syscall.ql_syscall_write(ql, fd, buf, count) |