]> granicus.if.org Git - strace/commitdiff
tests: use VERBOSE macro in execve and execve-v tests
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 22 Sep 2016 23:58:25 +0000 (23:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 26 Sep 2016 15:23:25 +0000 (15:23 +0000)
* tests/execve-v.c (VERBOSE_EXECVE): Remove.
(VERBOSE): Define to 1.
* tests/execve.c (main): Check VERBOSE instead of VERBOSE_EXECVE.

tests/execve-v.c
tests/execve.c

index 26bc9d6104fbe4dc1afd7982e7cf896a181de368..4506c6359e6f72b12d3dc329058b534935c736b1 100644 (file)
@@ -1,3 +1,3 @@
 /* This file is part of execve-v strace test. */
-#define VERBOSE_EXECVE
+#define VERBOSE 1
 #include "execve.c"
index 852eebfaabe624b21971908fd8101095af064ec0..74749e73e62053624dab175bfdb2740ff3dc9b66 100644 (file)
@@ -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]);