Blame SOURCES/ltrace-0.7.91-testsuite-includes.patch

71a0ac
From 694d19ff14017926454771cbb63a22355b72f1bf Mon Sep 17 00:00:00 2001
71a0ac
From: Faraz Shahbazker <faraz.shahbazker@imgtec.com>
71a0ac
Date: Tue, 3 Feb 2015 13:07:55 -0800
71a0ac
Subject: [PATCH] Fix missing includes and return statements in test sources
71a0ac
71a0ac
Fix warnings while compiling test cases by adding missing #includes and
71a0ac
return statements. Missing arguments provided for functions wait()/wcswidth()
71a0ac
---
71a0ac
 testsuite/ltrace.main/filters.exp            | 1 +
71a0ac
 testsuite/ltrace.main/main-internal.exp      | 4 +++-
71a0ac
 testsuite/ltrace.main/main-threaded.c        | 1 +
71a0ac
 testsuite/ltrace.main/parameters.c           | 1 +
71a0ac
 testsuite/ltrace.main/parameters2.exp        | 2 +-
71a0ac
 testsuite/ltrace.main/parameters3.exp        | 2 ++
71a0ac
 testsuite/ltrace.main/system_call_params.exp | 4 ++++
71a0ac
 testsuite/ltrace.minor/attach-process.exp    | 1 +
71a0ac
 testsuite/ltrace.minor/libdl-simple.c        | 2 ++
71a0ac
 testsuite/ltrace.minor/time-record.c         | 1 +
71a0ac
 testsuite/ltrace.minor/trace-clone.c         | 2 ++
71a0ac
 testsuite/ltrace.minor/trace-fork.c          | 4 +++-
71a0ac
 testsuite/ltrace.minor/wchar.exp             | 3 ++-
71a0ac
 testsuite/ltrace.torture/vfork-thread.c      | 1 +
71a0ac
 14 files changed, 25 insertions(+), 4 deletions(-)
71a0ac
71a0ac
diff --git a/testsuite/ltrace.main/filters.exp b/testsuite/ltrace.main/filters.exp
71a0ac
index 988346f..f7f4140 100644
71a0ac
--- a/testsuite/ltrace.main/filters.exp
71a0ac
+++ b/testsuite/ltrace.main/filters.exp
71a0ac
@@ -22,6 +22,7 @@ set libfilt1 [ltraceCompile libfilt1.so [ltraceSource c {
71a0ac
 }]]
71a0ac
 
71a0ac
 set libfilt2 [ltraceCompile libfilt2.so [ltraceSource c {
71a0ac
+    #include <stdio.h>
71a0ac
     void func2(void) { puts("func2"); }
71a0ac
 }]]
71a0ac
 
71a0ac
diff --git a/testsuite/ltrace.main/main-internal.exp b/testsuite/ltrace.main/main-internal.exp
71a0ac
index 0ca5e14..112c69b 100644
71a0ac
--- a/testsuite/ltrace.main/main-internal.exp
71a0ac
+++ b/testsuite/ltrace.main/main-internal.exp
71a0ac
@@ -19,11 +19,13 @@
71a0ac
 set bin [ltraceCompile {} [ltraceSource c {
71a0ac
     __attribute__((noinline)) void this(void) {}
71a0ac
     __attribute__((noinline)) void that(void) {}
71a0ac
-    int main(int i) {
71a0ac
+    int main() {
71a0ac
+	int i;
71a0ac
 	for (i = 0; i < 12; ++i) {
71a0ac
 	    this();
71a0ac
 	    that();
71a0ac
 	}
71a0ac
+	return 0;
71a0ac
     }
71a0ac
 }]]
71a0ac
 
71a0ac
diff --git a/testsuite/ltrace.main/parameters.c b/testsuite/ltrace.main/parameters.c
71a0ac
index a3d8bb5..aa862b9 100644
71a0ac
--- a/testsuite/ltrace.main/parameters.c
71a0ac
+++ b/testsuite/ltrace.main/parameters.c
71a0ac
@@ -17,6 +17,7 @@ void func_intptr_ret(int *i);
71a0ac
 int func_strlen(char*);
71a0ac
 void func_strfixed(char*);
71a0ac
 void func_ppp(int***);
71a0ac
+void func_string(char*);
71a0ac
 void func_stringp(char**);
71a0ac
 void func_short(short, short);
71a0ac
 void func_ushort(unsigned short, unsigned short);
71a0ac
diff --git a/testsuite/ltrace.main/parameters2.exp b/testsuite/ltrace.main/parameters2.exp
71a0ac
index 9850079..1c7b3b4 100644
71a0ac
--- a/testsuite/ltrace.main/parameters2.exp
71a0ac
+++ b/testsuite/ltrace.main/parameters2.exp
71a0ac
@@ -17,7 +17,7 @@
71a0ac
 # 02110-1301 USA
71a0ac
 
71a0ac
 set trivial [ltraceCompile {} [ltraceSource c {
71a0ac
-    int main(void) {}
71a0ac
+    int main(void) {return 0;}
71a0ac
 }]]
71a0ac
 
71a0ac
 ltraceMatch1 [ltraceRun -L -F [ltraceSource conf {
71a0ac
diff --git a/testsuite/ltrace.main/parameters3.exp b/testsuite/ltrace.main/parameters3.exp
71a0ac
index 693c219..f6d9116 100644
71a0ac
--- a/testsuite/ltrace.main/parameters3.exp
71a0ac
+++ b/testsuite/ltrace.main/parameters3.exp
71a0ac
@@ -29,8 +29,10 @@ set liba [ltraceCompile liba.so [ltraceSource c {
71a0ac
 }]]
71a0ac
 
71a0ac
 set bin [ltraceCompile {} $liba [ltraceSource c {
71a0ac
+    extern void fun(void);
71a0ac
     int main(void) {
71a0ac
 	fun();
71a0ac
+	return 0;
71a0ac
     }
71a0ac
 }]]
71a0ac
 
71a0ac
diff --git a/testsuite/ltrace.main/system_call_params.exp b/testsuite/ltrace.main/system_call_params.exp
71a0ac
index 2ccf840..f3a55d2 100644
71a0ac
--- a/testsuite/ltrace.main/system_call_params.exp
71a0ac
+++ b/testsuite/ltrace.main/system_call_params.exp
71a0ac
@@ -17,12 +17,15 @@
71a0ac
 # 02110-1301 USA
71a0ac
 
71a0ac
 set bin [ltraceCompile {} [ltraceSource c {
71a0ac
+    #ifndef _GNU_SOURCE
71a0ac
     #define _GNU_SOURCE
71a0ac
+    #endif
71a0ac
     #include <sys/types.h>
71a0ac
     #include <sys/stat.h>
71a0ac
     #include <fcntl.h>
71a0ac
     #include <unistd.h>
71a0ac
     #include <sys/syscall.h>   /* For SYS_xxx definitions */
71a0ac
+    #include <sys/mount.h>
71a0ac
 
71a0ac
     #ifndef SYS_open
71a0ac
     # if defined(__aarch64__)
71a0ac
@@ -38,6 +41,7 @@ set bin [ltraceCompile {} [ltraceSource c {
71a0ac
 	syscall(SYS_open, "/some/path", O_RDONLY);
71a0ac
 	write(1, "something", 10);
71a0ac
 	mount("source", "target", "filesystemtype", 0, 0);
71a0ac
+	return 0;
71a0ac
     }
71a0ac
 }]]
71a0ac
 
71a0ac
diff --git a/testsuite/ltrace.minor/attach-process.exp b/testsuite/ltrace.minor/attach-process.exp
71a0ac
index 2c7d20c..c050f21 100644
71a0ac
--- a/testsuite/ltrace.minor/attach-process.exp
71a0ac
+++ b/testsuite/ltrace.minor/attach-process.exp
71a0ac
@@ -21,6 +21,7 @@ set bin [ltraceCompile {} [ltraceSource c {
71a0ac
     int main(void) {
71a0ac
 	sleep(5);
71a0ac
 	sleep(1);
71a0ac
+	return 0;
71a0ac
     }
71a0ac
 }]]
71a0ac
 
71a0ac
diff --git a/testsuite/ltrace.minor/libdl-simple.c b/testsuite/ltrace.minor/libdl-simple.c
71a0ac
index 0bef5cf..b1be002 100644
71a0ac
--- a/testsuite/ltrace.minor/libdl-simple.c
71a0ac
+++ b/testsuite/ltrace.minor/libdl-simple.c
71a0ac
@@ -1,6 +1,7 @@
71a0ac
 #include <stdlib.h>
71a0ac
 #include <stdio.h>
71a0ac
 #include <dlfcn.h>
71a0ac
+#include <string.h>
71a0ac
 
71a0ac
 int main(int argc, char **argv) {
71a0ac
 	void *handle;
71a0ac
@@ -21,4 +22,5 @@ int main(int argc, char **argv) {
71a0ac
 
71a0ac
 	printf("%d\n", test(5));
71a0ac
 	dlclose(handle);
71a0ac
+	return 0;
71a0ac
 }
71a0ac
diff --git a/testsuite/ltrace.minor/time-record.c b/testsuite/ltrace.minor/time-record.c
71a0ac
index a66b838..7d5e5e3 100644
71a0ac
--- a/testsuite/ltrace.minor/time-record.c
71a0ac
+++ b/testsuite/ltrace.minor/time-record.c
71a0ac
@@ -5,6 +5,7 @@
71a0ac
    This file was written by Yao Qi <qiyao@cn.ibm.com>.  */
71a0ac
 #include <stdio.h>
71a0ac
 #include <time.h>
71a0ac
+#include <unistd.h>
71a0ac
 
71a0ac
 #define SLEEP_COUNT 2
71a0ac
 #define NANOSLEEP_COUNT 50
71a0ac
diff --git a/testsuite/ltrace.minor/trace-clone.c b/testsuite/ltrace.minor/trace-clone.c
71a0ac
index ded930c..6aab235 100644
71a0ac
--- a/testsuite/ltrace.minor/trace-clone.c
71a0ac
+++ b/testsuite/ltrace.minor/trace-clone.c
71a0ac
@@ -3,7 +3,9 @@
71a0ac
    clone called.
71a0ac
 
71a0ac
    This file was written by Yao Qi <qiyao@cn.ibm.com>.  */
71a0ac
+#ifndef _GNU_SOURCE
71a0ac
 #define _GNU_SOURCE
71a0ac
+#endif
71a0ac
 #include <stdio.h>
71a0ac
 #include <sys/types.h>
71a0ac
 #include <stdlib.h>
71a0ac
diff --git a/testsuite/ltrace.minor/trace-fork.c b/testsuite/ltrace.minor/trace-fork.c
71a0ac
index c5f0c71..9611184 100644
71a0ac
--- a/testsuite/ltrace.minor/trace-fork.c
71a0ac
+++ b/testsuite/ltrace.minor/trace-fork.c
71a0ac
@@ -6,6 +6,8 @@
71a0ac
 
71a0ac
 #include <stdio.h>
71a0ac
 #include <sys/types.h>
71a0ac
+#include <unistd.h>
71a0ac
+#include <sys/wait.h>
71a0ac
 
71a0ac
 void 
71a0ac
 child ()
71a0ac
@@ -27,7 +29,7 @@ main ()
71a0ac
   else
71a0ac
     {
71a0ac
       printf("My child pid is %d\n",pid);
71a0ac
-      wait(); 
71a0ac
+      wait(NULL);
71a0ac
     }
71a0ac
   return 0;
71a0ac
 }
71a0ac
diff --git a/testsuite/ltrace.torture/vfork-thread.c b/testsuite/ltrace.torture/vfork-thread.c
71a0ac
index f909bd3..4c118a6 100644
71a0ac
--- a/testsuite/ltrace.torture/vfork-thread.c
71a0ac
+++ b/testsuite/ltrace.torture/vfork-thread.c
71a0ac
@@ -13,6 +13,7 @@ routine (void *data)
71a0ac
       puts ("bleble");
71a0ac
       sleep (1);
71a0ac
     }
71a0ac
+  return NULL;
71a0ac
 }
71a0ac
 
71a0ac
 
71a0ac
-- 
71a0ac
2.1.0
71a0ac