Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: sandbox/linux/seccomp-bpf/syscall_unittest.cc

Issue 11434088: Linux Sandbox: add test for one argument system calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/syscall_unittest.cc
diff --git a/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/sandbox/linux/seccomp-bpf/syscall_unittest.cc
index 374a0fbddd53371a17abdff02a3add9a43eec35f..b00177d2ad5a3801298f33e4883ccffbb79473a3 100644
--- a/sandbox/linux/seccomp-bpf/syscall_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/syscall_unittest.cc
@@ -54,6 +54,14 @@ TEST(Syscall, TrivialSyscallNoArgs) {
EXPECT_EQ(SandboxSyscall(__NR_getpid), syscall(__NR_getpid));
}
+TEST(Syscall, TrivialSyscallOneArg) {
+ int new_fd;
+ // Duplicate standard error and close it.
+ ASSERT_GE(new_fd = SandboxSyscall(__NR_dup, 2), 0);
+ int close_return_value = HANDLE_EINTR(SandboxSyscall(__NR_close, new_fd));
+ ASSERT_EQ(close_return_value, 0);
+}
+
TEST(Syscall, ComplexSyscallSixArgs) {
int fd;
ASSERT_LE(0, fd = SandboxSyscall(__NR_open, "/dev/null", O_RDWR, 0L));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698