Skip to content

[SUBISSUE #1] Increase Coverage for FileSyscalls and SyscallHelpers #258

Done

Description

@marcobuschini

Parent issue: #257

Baseline

  • kernel/syscalls/FileSyscalls.cpp: 2.3% lines (24/1,054), 1.0% branches
  • kernel/syscalls/SyscallHelpers.cpp: 25.7% lines (59/230), 11.1% branches

Scope

Add host snitch unit tests (e.g. tests/host/file_syscalls_test.cpp and tests/host/syscall_helpers_test.cpp) exercising:

  • sys_openat, sys_close, sys_read, sys_write, sys_readv, sys_writev, sys_lseek
  • sys_fstat, sys_newfstatat, sys_getdents64, sys_getcwd, sys_chdir
  • sys_mkdirat, sys_unlinkat, sys_renameat2, sys_faccessat, sys_readlinkat
  • sys_pipe2, sys_dup, sys_dup3, sys_fcntl, sys_ioctl, sys_ppoll
  • User-pointer validation, EBADF/EFAULT/EINVAL/ENOENT/EROFS/ENOTDIR/EEXIST error branches in SyscallHelpers.cpp

Acceptance Criteria

  • Line and branch coverage for FileSyscalls.cpp and SyscallHelpers.cpp raised to >= 85% lines / >= 75% branches.
  • make clean-tests && make -j"$(nproc)" quality passes with zero warnings or ASan/UBSan errors.

Metadata

Metadata

Assignees

Labels

subissue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions