From: Dmitry V. Levin Date: Fri, 23 Sep 2016 00:11:54 +0000 (+0000) Subject: tests: use VERBOSE macro in execveat and execveat-v tests X-Git-Tag: v4.14~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0400e2ca7dcc67b875f9138acedb0bc3544a72b3;p=strace tests: use VERBOSE macro in execveat and execveat-v tests * tests/execveat-v.c (VERBOSE_EXECVEAT): Remove. (VERBOSE): Define to 1. * tests/execveat.c (main): Check VERBOSE instead of VERBOSE_EXECVEAT. --- diff --git a/tests/execveat-v.c b/tests/execveat-v.c index 530ddfc9..ff4de2e8 100644 --- a/tests/execveat-v.c +++ b/tests/execveat-v.c @@ -1,3 +1,3 @@ /* This file is part of execveat-v strace test. */ -#define VERBOSE_EXECVEAT +#define VERBOSE 1 #include "execveat.c" diff --git a/tests/execveat.c b/tests/execveat.c index bc2a9512..4e444a2c 100644 --- a/tests/execveat.c +++ b/tests/execveat.c @@ -62,7 +62,7 @@ main(void) syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\"" ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" -#ifdef VERBOSE_EXECVEAT +#if VERBOSE ", [\"%s\", \"%s\", %p, %p, %p, ???]" #else ", [/* 5 vars, unterminated */]" @@ -70,7 +70,7 @@ main(void) ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], argv[3], argv[4], argv[5], -#ifdef VERBOSE_EXECVEAT +#if VERBOSE q_envp[0], q_envp[1], envp[2], envp[3], envp[4], #endif errno2name()); @@ -80,28 +80,28 @@ main(void) syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" -#ifdef VERBOSE_EXECVEAT +#if VERBOSE ", [\"%s\", \"%s\"]" #else ", [/* 2 vars */]" #endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], -#ifdef VERBOSE_EXECVEAT +#if VERBOSE q_envp[0], q_envp[1], #endif errno2name()); syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" -#ifdef VERBOSE_EXECVEAT +#if VERBOSE ", [\"%s\"]" #else ", [/* 1 var */]" #endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[2], -#ifdef VERBOSE_EXECVEAT +#if VERBOSE q_envp[1], #endif errno2name()); @@ -112,7 +112,7 @@ main(void) syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); printf("execveat(AT_FDCWD, \"%s\", []" -#ifdef VERBOSE_EXECVEAT +#if VERBOSE ", []" #else ", [/* 0 vars */]" @@ -136,12 +136,12 @@ main(void) printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); for (i = 1; i < DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#ifdef VERBOSE_EXECVEAT +#if VERBOSE printf(", \"%s\"", a[i]); #else printf(", ..."); #endif -#ifdef VERBOSE_EXECVEAT +#if VERBOSE printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); @@ -155,7 +155,7 @@ main(void) printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#ifdef VERBOSE_EXECVEAT +#if VERBOSE printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]);