MCPcopy Create free account
hub / github.com/qilingframework/qiling / test_syscall_truncate

Method test_syscall_truncate

tests/test_elf.py:337–351  ·  view source on GitHub ↗
(ql: Qiling, path: int, length: int)

Source from the content-addressed store, hash-verified

335 return retval
336
337 def test_syscall_truncate(ql: Qiling, path: int, length: int):
338 retval = syscall.ql_syscall_truncate(ql, path, length)
339
340 vpath = ql.os.utils.read_cstring(path)
341
342 if vpath == "test_syscall_truncate.txt":
343 hpath = ql.os.path.virtual_to_host_path(vpath)
344
345 self.assertEqual(length, os.stat(hpath).st_size)
346 checklist.append('truncate')
347
348 if ql.host.os is not QL_OS.WINDOWS:
349 os.remove(hpath)
350
351 return retval
352
353 def test_syscall_ftruncate(ql: Qiling, fd: int, length: int):
354 retval = syscall.ql_syscall_ftruncate(ql, fd, length)

Callers

nothing calls this directly

Calls 4

read_cstringMethod · 0.80
virtual_to_host_pathMethod · 0.80
appendMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected