From: Dmitry V. Levin Date: Thu, 22 Sep 2016 23:58:25 +0000 (+0000) Subject: tests: use VERBOSE macro in execve and execve-v tests X-Git-Tag: v4.14~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68beed808a8abfcba3b7a5aeb59a194d3f916fd3;p=strace tests: use VERBOSE macro in execve and execve-v tests * tests/execve-v.c (VERBOSE_EXECVE): Remove. (VERBOSE): Define to 1. * tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE. --- diff --git a/tests/execve-v.c b/tests/execve-v.c index 26bc9d61..4506c635 100644 --- a/tests/execve-v.c +++ b/tests/execve-v.c @@ -1,3 +1,3 @@ /* This file is part of execve-v strace test. */ -#define VERBOSE_EXECVE +#define VERBOSE 1 #include "execve.c" diff --git a/tests/execve.c b/tests/execve.c index 852eebfa..74749e73 100644 --- a/tests/execve.c +++ b/tests/execve.c @@ -59,7 +59,7 @@ main(void) execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\"" ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" -#ifdef VERBOSE_EXECVE +#if VERBOSE ", [\"%s\", \"%s\", %p, %p, %p, ???]" #else ", [/* 5 vars, unterminated */]" @@ -67,7 +67,7 @@ main(void) ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], argv[3], argv[4], argv[5] -#ifdef VERBOSE_EXECVE +#if VERBOSE , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] #endif ); @@ -77,28 +77,28 @@ main(void) execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" -#ifdef VERBOSE_EXECVE +#if VERBOSE ", [\"%s\", \"%s\"]" #else ", [/* 2 vars */]" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] -#ifdef VERBOSE_EXECVE +#if VERBOSE , q_envp[0], q_envp[1] #endif ); execve(FILENAME, tail_argv + 2, tail_envp + 1); printf("execve(\"%s\", [\"%s\"]" -#ifdef VERBOSE_EXECVE +#if VERBOSE ", [\"%s\"]" #else ", [/* 1 var */]" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[2] -#ifdef VERBOSE_EXECVE +#if VERBOSE , q_envp[1] #endif ); @@ -109,7 +109,7 @@ main(void) execve(FILENAME, empty, empty); printf("execve(\"%s\", []" -#ifdef VERBOSE_EXECVE +#if VERBOSE ", []" #else ", [/* 0 vars */]" @@ -132,12 +132,12 @@ main(void) printf("execve(\"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); for (i = 1; i < DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#ifdef VERBOSE_EXECVE +#if VERBOSE printf(", \"%s\"", a[i]); #else printf(", ..."); #endif -#ifdef VERBOSE_EXECVE +#if VERBOSE printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); @@ -150,7 +150,7 @@ main(void) printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#ifdef VERBOSE_EXECVE +#if VERBOSE printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]);