From fe7d3f3635e66fe8ec1fde91f886857b0dea7d22 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 31 Jan 2019 23:18:25 +0100 Subject: tests: Remove assert (errno == 0) from tests. When a function fails it might set errno. But it isn't a guarantee that if a function succeeds that it sets errno to zero. Signed-off-by: Mark Wielaard --- tests/backtrace.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'tests/backtrace.c') diff --git a/tests/backtrace.c b/tests/backtrace.c index 24ab68dd..05e8ef82 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -281,16 +281,13 @@ prepare_thread (pid_t pid2 __attribute__ ((unused)), struct user_regs_struct user_regs; errno = 0; l = ptrace (PTRACE_GETREGS, pid2, 0, (intptr_t) &user_regs); - assert (errno == 0); assert (l == 0); user_regs.rip = (intptr_t) jmp; l = ptrace (PTRACE_SETREGS, pid2, 0, (intptr_t) &user_regs); - assert (errno == 0); assert (l == 0); l = ptrace (PTRACE_CONT, pid2, NULL, (void *) (intptr_t) SIGUSR2); int status; pid_t got = waitpid (pid2, &status, __WALL); - assert (errno == 0); assert (got == pid2); assert (WIFSTOPPED (status)); assert (WSTOPSIG (status) == SIGUSR1); @@ -358,7 +355,6 @@ exec_dump (const char *exec) errno = 0; int status; pid_t got = waitpid (pid, &status, 0); - assert (errno == 0); assert (got == pid); assert (WIFSTOPPED (status)); // Main thread will signal SIGUSR2. Other thread will signal SIGUSR1. @@ -368,7 +364,6 @@ exec_dump (const char *exec) __WCLONE, probably despite pthread_create already had to be called the new task is not yet alive enough for waitpid. */ pid_t pid2 = waitpid (-1, &status, __WALL); - assert (errno == 0); assert (pid2 > 0); assert (pid2 != pid); assert (WIFSTOPPED (status)); -- cgit v1.2.3