[exim-cvs] Testsuite: compiler quietening

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: compiler quietening
Gitweb: http://git.exim.org/exim.git/commitdiff/a719fce4b1d9f9f03a8f1f083375625728199786
Commit:     a719fce4b1d9f9f03a8f1f083375625728199786
Parent:     41fdef91b0872ea275e5ff41af06d61ca4649ea7
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Oct 28 14:42:10 2014 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Oct 28 16:24:13 2014 +0000


    Testsuite: compiler quietening
---
 test/src/client.c |   16 ++++++++--------
 test/src/server.c |   26 +++++++++++++++-----------
 2 files changed, 23 insertions(+), 19 deletions(-)


diff --git a/test/src/client.c b/test/src/client.c
index a983896..7b7d9de 100644
--- a/test/src/client.c
+++ b/test/src/client.c
@@ -818,15 +818,15 @@ if (tls_on_connect)
}
#endif

-while (fgets(outbuffer, sizeof(outbuffer), stdin) != NULL)
+while (fgets(CS outbuffer, sizeof(outbuffer), stdin) != NULL)
{
- int n = (int)strlen(outbuffer);
+ int n = (int)strlen(CS outbuffer);
while (n > 0 && isspace(outbuffer[n-1])) n--;
outbuffer[n] = 0;

/* Expect incoming */

-  if (strncmp(outbuffer, "??? ", 4) == 0)
+  if (strncmp(CS outbuffer, "??? ", 4) == 0)
     {
     unsigned char *lineptr;
     printf("%s\n", outbuffer);
@@ -876,7 +876,7 @@ while (fgets(outbuffer, sizeof(outbuffer), stdin) != NULL)
       }


     printf("<<< %s\n", lineptr);
-    if (strncmp(lineptr, outbuffer + 4, (int)strlen(outbuffer) - 4) != 0)
+    if (strncmp(CS lineptr, CS outbuffer + 4, (int)strlen(CS outbuffer) - 4) != 0)
       {
       printf("\n******** Input mismatch ********\n");
       exit(79);
@@ -958,10 +958,10 @@ int rc;


/* Wait for a bit before proceeding */

-  else if (strncmp(outbuffer, "+++ ", 4) == 0)
+  else if (strncmp(CS outbuffer, "+++ ", 4) == 0)
     {
     printf("%s\n", outbuffer);
-    sleep(atoi(outbuffer + 4));
+    sleep(atoi(CS outbuffer + 4));
     }


   /* Send outgoing, but barf if unconsumed incoming */
@@ -1024,11 +1024,11 @@ int rc;
     #endif


     printf(">>> %s\n", outbuffer);
-    strcpy(outbuffer + n, "\r\n");
+    strcpy(CS outbuffer + n, "\r\n");


     /* Turn "\n" and "\r" into the relevant characters. This is a hack. */


-    while ((escape = strstr(outbuffer, "\\r")) != NULL)
+    while ((escape = US strstr(CS outbuffer, "\\r")) != NULL)
       {
       *escape = '\r';
       memmove(escape + 1, escape + 2,  (n + 2) - (escape - outbuffer) - 2);
diff --git a/test/src/server.c b/test/src/server.c
index a7e1d2b..0d6e5fe 100644
--- a/test/src/server.c
+++ b/test/src/server.c
@@ -43,11 +43,15 @@ on all interfaces, unless the option -noipv6 is given. */
 #include <utime.h>


#ifdef AF_INET6
-#define HAVE_IPV6 1
+# define HAVE_IPV6 1
#endif

#ifndef S_ADDR_TYPE
-#define S_ADDR_TYPE u_long
+# define S_ADDR_TYPE u_long
+#endif
+
+#ifndef CS
+# define CS (char *)
#endif


@@ -379,16 +383,16 @@ because that would cause it to wait for this process, which it doesn't yet want
to do. The driving script adds the "++++" automatically - it doesn't actually
appear in the test script. */

-while (fgets(buffer, sizeof(buffer), stdin) != NULL)
+while (fgets(CS buffer, sizeof(buffer), stdin) != NULL)
   {
   line *next;
-  int n = (int)strlen(buffer);
+  int n = (int)strlen(CS buffer);
   while (n > 0 && isspace(buffer[n-1])) n--;
   buffer[n] = 0;
-  if (strcmp(buffer, "++++") == 0) break;
+  if (strcmp(CS buffer, "++++") == 0) break;
   next = malloc(sizeof(line) + n);
   next->next = NULL;
-  strcpy(next->line, buffer);
+  strcpy(next->line, CS buffer);
   if (last == NULL) script = last = next;
     else last->next = next;
   last = next;
@@ -464,7 +468,7 @@ for (count = 0; count < connection_count; count++)
   dup_accept_socket = dup(accept_socket);


   if (port > 0)
-    printf("\nConnection request from [%s]\n", host_ntoa(&accepted, buffer));
+    printf("\nConnection request from [%s]\n", host_ntoa(&accepted, CS buffer));
   else
     {
     printf("\nConnection request\n");
@@ -572,7 +576,7 @@ for (count = 0; count < connection_count; count++)
         {
         int n;
         alarm(timeout);
-        if (fgets(buffer+offset, sizeof(buffer)-offset, in) == NULL)
+        if (fgets(CS buffer+offset, sizeof(buffer)-offset, in) == NULL)
           {
           printf("%sxpected EOF read from client\n",
             (strncmp(ss, "*eof", 4) == 0)? "E" : "Une");
@@ -580,14 +584,14 @@ for (count = 0; count < connection_count; count++)
           goto END_OFF;
           }
         alarm(0);
-        n = (int)strlen(buffer);
+        n = (int)strlen(CS buffer);
         while (n > 0 && isspace(buffer[n-1])) n--;
         buffer[n] = 0;
         printf("%s\n", buffer);
-        if (!data || strcmp(buffer, ".") == 0) break;
+        if (!data || strcmp(CS buffer, ".") == 0) break;
         }


-      if (strncmp(ss, buffer, (int)strlen(ss)) != 0)
+      if (strncmp(ss, CS buffer, (int)strlen(ss)) != 0)
         {
         printf("Comparison failed - bailing out\n");
         printf("Expected: %s\n", ss);