From: Cyril H. <su...@li...> - 2013-03-27 16:21:46
|
The branch, master, has been updated via bd3edab243b5ee19f89d394ac90172cff82073e1 (commit) via 94055f29017b372f4f2b6852a70a1c505d169499 (commit) via 5f3786942119704d17da876239c71a125985becc (commit) via 2eccda5924f367d9ab10cb4c8b69658f86c3a81e (commit) via f77d273a40edb49e7cfb0d74a608bcc2c5598b11 (commit) via 614a8c67d7cab771c43aab5215da727cc6fe3297 (commit) via e7a2d0f2d669b92332d0f40fdf02407f84ca2233 (commit) via c3c012e6c4bbcb3d2d08c25cc9a61a2f57aa7435 (commit) via fb3e72b1b9e104f39cbdf13009a6bd09665fc7ad (commit) via 4894882aae545e1c16c263cc58ae8ccfcf287391 (commit) via 7b06e6c668b109655662588d36af9ca656affcbe (commit) via 5127614eb3ee4903d3e0388fcfdadb952111ac8b (commit) via 218e5b627562c197f49e5191f5aaa75208c2e154 (commit) via 064fe1a1dc44414f15056f1004c829df8a877285 (commit) via 4ba1c46742f4b272d14b042a8e286a1a518f539f (commit) via 75d9d65295cf559f9ba38aae5c16acf426e397f9 (commit) from d743731a0789e2ab740caafffa37de8383a3b141 (commit) - Log ----------------------------------------------------------------- commit bd3edab243b5ee19f89d394ac90172cff82073e1 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:48:28 2013 +0100 conformance/interfaces/sigaction/19-*.c: Regenerate. Signed-off-by: Cyril Hrubis <ch...@su...> commit 94055f29017b372f4f2b6852a70a1c505d169499 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:47:54 2013 +0100 conformance/interfaces/sigaction/templates/19-1.in * Fix template 19-x testcases template. Signed-off-by: Cyril Hrubis <ch...@su...> commit 5f3786942119704d17da876239c71a125985becc Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:26:32 2013 +0100 conformance/interfaces/sigaction/18-*.c: Regenerate. Signed-off-by: Cyril Hrubis <ch...@su...> commit 2eccda5924f367d9ab10cb4c8b69658f86c3a81e Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:23:13 2013 +0100 conformance/interfaces/sigaction/templates/18-1.in * Fix template 18-x testcases template. Signed-off-by: Cyril Hrubis <ch...@su...> commit f77d273a40edb49e7cfb0d74a608bcc2c5598b11 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:04:46 2013 +0100 open_posix_testsuite/scripts/generate-makefiles.sh: Fix. Fix the test build failure detection and also enable warnings for testcases that failed to compile. Signed-off-by: Cyril Hrubis <ch...@su...> commit 614a8c67d7cab771c43aab5215da727cc6fe3297 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 16:00:01 2013 +0100 conformance/interfaces/sigaction/28-*.c: Regenerate. Signed-off-by: Cyril Hrubis <ch...@su...> commit e7a2d0f2d669b92332d0f40fdf02407f84ca2233 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:59:10 2013 +0100 conformance/interfaces/sigaction/templates/28-1.in * Fix template 28-x testcases template. Signed-off-by: Cyril Hrubis <ch...@su...> commit c3c012e6c4bbcb3d2d08c25cc9a61a2f57aa7435 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:35:52 2013 +0100 open_posix_testsuite/.../pthread_spin_unlock: Fix. * Fix ordering 'volatile static' vs 'static volatile' * Silence unused warnings Signed-off-by: Cyril Hrubis <ch...@su...> commit fb3e72b1b9e104f39cbdf13009a6bd09665fc7ad Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:33:50 2013 +0100 open_posix_testsuite/.../pthread_spin_lock: Fix. * Fix ordering 'volatile static' vs 'static volatile' * Silence unused warnings Signed-off-by: Cyril Hrubis <ch...@su...> commit 4894882aae545e1c16c263cc58ae8ccfcf287391 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:20:38 2013 +0100 open_posix_testsuite/.../testfrmw/threads_scenarii: Fix. * Fix types in order not to generate warnings. Signed-off-by: Cyril Hrubis <ch...@su...> commit 7b06e6c668b109655662588d36af9ca656affcbe Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:16:02 2013 +0100 open_posix_testsuite/.../pthread_cond_timedwait: Cleanup. * Remove useless comments. Signed-off-by: Cyril Hrubis <ch...@su...> commit 5127614eb3ee4903d3e0388fcfdadb952111ac8b Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 15:12:08 2013 +0100 open_posix_testsuite/.../pthread_cond_timedwait: Fix. * Fix types and casts not to generate warnings. * Silence unused warnings for signal handlers and thread functions. Signed-off-by: Cyril Hrubis <ch...@su...> commit 218e5b627562c197f49e5191f5aaa75208c2e154 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 14:56:31 2013 +0100 open_posix_testsuite/.../nanosleep/10000-1: Fix. * Fix printf() format string Signed-off-by: Cyril Hrubis <ch...@su...> commit 064fe1a1dc44414f15056f1004c829df8a877285 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 13:53:52 2013 +0100 open_posix_testsuite/.../mq_open: Fix. * Change exit() to plain return * Add cast to void to silence unused warnings Signed-off-by: Cyril Hrubis <ch...@su...> commit 4ba1c46742f4b272d14b042a8e286a1a518f539f Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 13:48:43 2013 +0100 open_posix_testsuite/include/noatime: Fix. * Remove unused variable. * Add parenthesis Signed-off-by: Cyril Hrubis <ch...@su...> commit 75d9d65295cf559f9ba38aae5c16acf426e397f9 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 27 13:38:29 2013 +0100 open_posix_testsuite/.../mmap: Fix. * Include time.h for time() * Change size_t to ssize_t to fix warning. * Check for right signal delivered Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/mmap/1-1.c | 2 +- .../conformance/interfaces/mmap/11-2.c | 8 +- .../conformance/interfaces/mmap/11-3.c | 8 +- .../conformance/interfaces/mmap/11-5.c | 2 +- .../conformance/interfaces/mmap/11-6.c | 2 +- .../conformance/interfaces/mmap/12-1.c | 2 +- .../conformance/interfaces/mmap/13-1.c | 3 +- .../conformance/interfaces/mmap/14-1.c | 3 +- .../conformance/interfaces/mmap/5-1.c | 3 +- .../conformance/interfaces/mmap/6-2.c | 2 +- .../conformance/interfaces/mmap/7-1.c | 2 +- .../conformance/interfaces/mmap/7-2.c | 2 +- .../conformance/interfaces/mq_open/16-1.c | 4 +- .../conformance/interfaces/mq_open/2-1.c | 1 + .../conformance/interfaces/mq_open/20-1.c | 1 + .../conformance/interfaces/mq_open/7-2.c | 1 + .../conformance/interfaces/mq_open/8-2.c | 1 + .../conformance/interfaces/mq_open/9-2.c | 1 + .../conformance/interfaces/nanosleep/10000-1.c | 4 +- .../interfaces/pthread_cond_timedwait/1-1.c | 2 + .../interfaces/pthread_cond_timedwait/2-1.c | 2 + .../interfaces/pthread_cond_timedwait/2-2.c | 4 +- .../interfaces/pthread_cond_timedwait/2-3.c | 4 +- .../interfaces/pthread_cond_timedwait/2-4.c | 34 +--- .../interfaces/pthread_cond_timedwait/2-5.c | 3 +- .../interfaces/pthread_cond_timedwait/2-6.c | 46 ++--- .../interfaces/pthread_cond_timedwait/2-7.c | 35 +--- .../interfaces/pthread_cond_timedwait/3-1.c | 2 + .../interfaces/pthread_cond_timedwait/4-1.c | 2 + .../interfaces/pthread_cond_timedwait/4-2.c | 35 +--- .../interfaces/pthread_cond_timedwait/4-3.c | 39 +--- .../conformance/interfaces/pthread_spin_lock/1-1.c | 4 +- .../conformance/interfaces/pthread_spin_lock/1-2.c | 4 +- .../interfaces/pthread_spin_unlock/1-1.c | 4 +- .../interfaces/pthread_spin_unlock/1-2.c | 4 +- .../interfaces/pthread_spin_unlock/3-1.c | 4 +- .../conformance/interfaces/sigaction/18-1.c | 94 +++------ .../conformance/interfaces/sigaction/18-10.c | 94 +++------ .../conformance/interfaces/sigaction/18-11.c | 94 +++------ .../conformance/interfaces/sigaction/18-12.c | 94 +++------ .../conformance/interfaces/sigaction/18-13.c | 94 +++------ .../conformance/interfaces/sigaction/18-14.c | 94 +++------ .../conformance/interfaces/sigaction/18-15.c | 94 +++------ .../conformance/interfaces/sigaction/18-16.c | 94 +++------ .../conformance/interfaces/sigaction/18-17.c | 94 +++------ .../conformance/interfaces/sigaction/18-18.c | 94 +++------ .../conformance/interfaces/sigaction/18-19.c | 97 +++------ .../conformance/interfaces/sigaction/18-2.c | 94 +++------ .../conformance/interfaces/sigaction/18-20.c | 94 +++------ .../conformance/interfaces/sigaction/18-21.c | 94 +++------ .../conformance/interfaces/sigaction/18-22.c | 94 +++------ .../conformance/interfaces/sigaction/18-23.c | 94 +++------ .../conformance/interfaces/sigaction/18-24.c | 94 +++------ .../conformance/interfaces/sigaction/18-25.c | 94 +++------ .../conformance/interfaces/sigaction/18-26.c | 94 +++------ .../conformance/interfaces/sigaction/18-3.c | 94 +++------ .../conformance/interfaces/sigaction/18-4.c | 94 +++------ .../conformance/interfaces/sigaction/18-5.c | 94 +++------ .../conformance/interfaces/sigaction/18-6.c | 94 +++------ .../conformance/interfaces/sigaction/18-7.c | 94 +++------ .../conformance/interfaces/sigaction/18-8.c | 94 +++------ .../conformance/interfaces/sigaction/18-9.c | 94 +++------ .../conformance/interfaces/sigaction/19-1.c | 105 +++------- .../conformance/interfaces/sigaction/19-10.c | 105 +++------- .../conformance/interfaces/sigaction/19-11.c | 105 +++------- .../conformance/interfaces/sigaction/19-12.c | 105 +++------- .../conformance/interfaces/sigaction/19-13.c | 105 +++------- .../conformance/interfaces/sigaction/19-14.c | 105 +++------- .../conformance/interfaces/sigaction/19-15.c | 105 +++------- .../conformance/interfaces/sigaction/19-16.c | 105 +++------- .../conformance/interfaces/sigaction/19-17.c | 105 +++------- .../conformance/interfaces/sigaction/19-18.c | 105 +++------- .../conformance/interfaces/sigaction/19-19.c | 108 ++++------ .../conformance/interfaces/sigaction/19-2.c | 105 +++------- .../conformance/interfaces/sigaction/19-20.c | 105 +++------- .../conformance/interfaces/sigaction/19-21.c | 105 +++------- .../conformance/interfaces/sigaction/19-22.c | 105 +++------- .../conformance/interfaces/sigaction/19-23.c | 105 +++------- .../conformance/interfaces/sigaction/19-24.c | 105 +++------- .../conformance/interfaces/sigaction/19-25.c | 105 +++------- .../conformance/interfaces/sigaction/19-26.c | 105 +++------- .../conformance/interfaces/sigaction/19-3.c | 105 +++------- .../conformance/interfaces/sigaction/19-4.c | 105 +++------- .../conformance/interfaces/sigaction/19-5.c | 105 +++------- .../conformance/interfaces/sigaction/19-6.c | 105 +++------- .../conformance/interfaces/sigaction/19-7.c | 105 +++------- .../conformance/interfaces/sigaction/19-8.c | 105 +++------- .../conformance/interfaces/sigaction/19-9.c | 105 +++------- .../conformance/interfaces/sigaction/28-1.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-10.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-11.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-12.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-13.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-14.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-15.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-16.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-17.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-18.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-19.c | 204 ++++--------------- .../conformance/interfaces/sigaction/28-2.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-20.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-21.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-22.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-23.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-24.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-25.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-26.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-3.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-4.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-5.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-6.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-7.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-8.c | 199 +++--------------- .../conformance/interfaces/sigaction/28-9.c | 199 +++--------------- .../sigaction/templates/template_18-1.in | 114 +++------- .../sigaction/templates/template_19-1.in | 131 ++++-------- .../sigaction/templates/template_28-1.in | 222 ++++---------------- .../interfaces/testfrmw/threads_scenarii.c | 7 +- testcases/open_posix_testsuite/include/noatime.h | 4 +- .../scripts/generate-makefiles.sh | 4 +- 120 files changed, 2681 insertions(+), 8440 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c index 6ff4db4..a9f5596 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c @@ -32,7 +32,7 @@ int main(void) char tmpfname[256]; char *data; void *pa; - size_t len = 1024; + ssize_t len = 1024; int fd; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_1_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c index bc679bd..cdb6b70 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c @@ -36,9 +36,11 @@ void sigbus_handler(int signum) { - WRITE("SIGBUS triggered\n"); - WRITE("Test PASSED\n"); - _exit(PTS_PASS); + if (signum == SIGBUS) { + WRITE("SIGBUS triggered\n"); + WRITE("Test PASSED\n"); + _exit(PTS_PASS); + } } int main(void) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c index 538019b..3a5bb8a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c @@ -36,9 +36,11 @@ void sigbus_handler(int signum) { - WRITE("SIGBUS triggered\n"); - WRITE("Test PASSED\n"); - _exit(PTS_PASS); + if (signum == SIGBUS) { + WRITE("SIGBUS triggered\n"); + WRITE("Test PASSED\n"); + _exit(PTS_PASS); + } } int main(void) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c index 448e5a2..41e9662 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c @@ -47,7 +47,7 @@ int main(void) long page_size; char *pa, ch; - size_t len; + ssize_t len; int fd; pid_t child; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c index 632bd81..15aab50 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c @@ -47,7 +47,7 @@ int main(void) long page_size; char *pa, ch; - size_t len; + ssize_t len; int fd; pid_t child; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c index 5b89cf1..dee97ae 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c @@ -37,7 +37,7 @@ int main(void) { char tmpfname[256]; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd, i; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_12_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c index fbc2d7e..5976bdb 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c @@ -30,6 +30,7 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <time.h> #include "noatime.h" #include "posixtest.h" @@ -39,7 +40,7 @@ int main(void) char *data; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd; struct stat stat_buff, stat_buff2; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c index b1b061e..8fc8e5d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c @@ -29,6 +29,7 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <time.h> #include "posixtest.h" int main(void) @@ -37,7 +38,7 @@ int main(void) char *data; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd; struct stat stat_buff; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c index d938885..544406b 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c @@ -91,7 +91,8 @@ int main(void) char tmpfname[256]; void *pa; size_t size = 1024; - int fd, i, fail = 0; + int fd, fail = 0; + unsigned int i; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_5_1_%d", getpid()); unlink(tmpfname); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c index 8697aba..c9237d7 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c @@ -46,7 +46,7 @@ int main(void) char tmpfname[256]; char *data; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd; pid_t child; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c index 0236eeb..e501e24 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c @@ -43,7 +43,7 @@ int main(void) char tmpfname[256]; char *data; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_7_1_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c index 4570b39..b52e383 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c @@ -43,7 +43,7 @@ int main(void) char tmpfname[256]; char *data; void *pa; - size_t size = 1024; + ssize_t size = 1024; int fd; snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_7_2_%d", getpid()); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c index 59f1bb6..b7d064b 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/16-1.c @@ -58,7 +58,7 @@ int main(void) fd = open(fname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); if (fd == -1) { printf(TNAME " Error at open(): %s\n", strerror(errno)); - exit(PTS_UNRESOLVED); + return PTS_UNRESOLVED; } /* file is empty now, will cause "Bus error" */ write(fd, fname, sizeof(int)); @@ -68,7 +68,7 @@ int main(void) if (pa == MAP_FAILED) { printf(TNAME " Error at mmap: %s\n", strerror(errno)); close(fd); - exit(PTS_FAIL); + return PTS_FAIL; } *(int *)pa = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c index c5ef666..57f88dd 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/2-1.c @@ -39,6 +39,7 @@ void handler(int signo) { + (void) signo; return; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c index 84dbae5..09966ec 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/20-1.c @@ -28,6 +28,7 @@ void handler(int signo) { + (void) signo; #ifdef DEBUG printf("in handler\n"); #endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c index ccbd1e9..db1e7c4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/7-2.c @@ -36,6 +36,7 @@ void handler(int signo) { + (void) signo; return; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c index 15405d3..35d1683 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/8-2.c @@ -36,6 +36,7 @@ void handler(int signo) { + (void) signo; return; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c index 53eaa7d..35459b0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/9-2.c @@ -36,6 +36,7 @@ void handler(int signo) { + (void) signo; return; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c b/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c index 98f5bc9..883885d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/nanosleep/10000-1.c @@ -77,12 +77,12 @@ int main(void) } if ((slepts - tssleepfor.tv_sec) > OKSECERR) { - printf("FAIL - slept %lds%ldns >> %lds%ldns\n", + printf("FAIL - slept %ds%dns >> %lds%ldns\n", slepts, sleptns, tssleepfor.tv_sec, tssleepfor.tv_nsec); failure = 1; } else { - printf("PASS - slept %lds%ldns ~= %lds%ldns\n", + printf("PASS - slept %ds%dns ~= %lds%ldns\n", slepts, sleptns, tssleepfor.tv_sec, tssleepfor.tv_nsec); } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c index 17640aa..5f075b2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c @@ -36,6 +36,8 @@ void *t1_func(void *arg) struct timespec timeout; struct timeval curtime; + (void) arg; + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr, "Thread1: Fail to acquire mutex\n"); exit(PTS_UNRESOLVED); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c index 6e482e0..8237051 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c @@ -43,6 +43,8 @@ void *t1_func(void *arg) struct timespec timeout; struct timeval curtime; + (void) arg; + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr, "Thread1 failed to acquire the mutex\n"); exit(PTS_UNRESOLVED); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c index d9b5b8a..4006a66 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c @@ -38,6 +38,8 @@ void *t1_func(void *arg) struct timeval curtime; struct timespec timeout; + (void) arg; + fprintf(stderr, "Thread1 started\n"); /* Lock the mutex */ @@ -115,7 +117,7 @@ int main(void) return PTS_UNRESOLVED; } - if ((int)th_ret == PTS_PASS) { + if ((long)th_ret == PTS_PASS) { printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c index 257b6f8..050f5e4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c @@ -37,6 +37,8 @@ void *t1_func(void *arg) struct timeval curtime; struct timespec timeout; + (void) arg; + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr, "Thread1 failed to acquire the mutex\n"); exit(PTS_UNRESOLVED); @@ -108,7 +110,7 @@ int main(void) return PTS_UNRESOLVED; } - switch ((int)th_ret) { + switch ((long)th_ret) { case PTS_PASS: printf("Test PASSED\n"); return PTS_PASS; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c index 6783b37..7e317d2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c @@ -41,9 +41,6 @@ #ifndef WITHOUT_XOPEN #define _XOPEN_SOURCE 600 #endif - /********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -56,32 +53,9 @@ #include <string.h> #include <time.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif @@ -90,9 +64,6 @@ #define USE_ALTCLK /* make tests with MONOTONIC CLOCK if supported */ #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ #ifndef WITHOUT_XOPEN typedef struct { @@ -274,7 +245,8 @@ void *tf(void *arg) int main(void) { - int ret, i; + int ret; + unsigned int i; pthread_mutexattr_t ma; pthread_condattr_t ca; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c index 3956290..4dbb17a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c @@ -169,7 +169,8 @@ void *threaded(void *arg) int main(void) { - int ret, i, j; + int ret, j; + unsigned int i; pthread_mutexattr_t ma; pthread_condattr_t ca; pthread_t th[NTHREADS]; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c index 6d77ce6..892dc54 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c @@ -34,9 +34,7 @@ #ifndef WITHOUT_XOPEN #define _XOPEN_SOURCE 600 #endif - /********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ + #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -47,32 +45,9 @@ #include <time.h> #include <semaphore.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif @@ -81,10 +56,6 @@ #define USE_ALTCLK /* make tests with MONOTONIC CLOCK if supported */ #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ - struct { pthread_mutex_t mtx; pthread_cond_t cnd; @@ -101,6 +72,9 @@ struct { void clnp1(void *arg) { int ret; + + (void) arg; + if (data.type == PTHREAD_MUTEX_RECURSIVE) { ret = pthread_mutex_trylock(&(data.mtx)); if (ret != 0) { @@ -122,6 +96,9 @@ void clnp1(void *arg) void clnp2(void *arg) { int ret; + + (void) arg; + do { ret = sem_post(&(data.semA)); } while ((ret != 0) && (errno == EINTR)); @@ -146,6 +123,8 @@ void clnp3(void *arg) { int ret; + (void) arg; + ret = pthread_mutex_unlock(&(data.mtx)); if (ret != 0) { UNRESOLVED(ret, "Unable to unlock mutex in clean-up handler 3"); @@ -171,6 +150,8 @@ void *threaded(void *arg) { int ret; + (void) arg; + struct timespec ts; ret = clock_gettime(data.cid, &ts); @@ -217,7 +198,8 @@ void *threaded(void *arg) int main(void) { - int ret, i; + int ret; + unsigned int i; void *rc; pthread_mutexattr_t ma; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c index 21e6df5..83e18ae 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c @@ -40,9 +40,7 @@ #ifndef WITHOUT_XOPEN #define _XOPEN_SOURCE 600 #endif - /********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ + #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -55,32 +53,9 @@ #include <string.h> #include <time.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif @@ -91,9 +66,6 @@ #define USE_ALTCLK /* make tests with MONOTONIC CLOCK if supported */ #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ #ifndef WITHOUT_XOPEN typedef struct { @@ -280,7 +252,8 @@ void *tf(void *arg) int main(void) { - int ret, i; + int ret; + unsigned int i; pthread_mutexattr_t ma; pthread_condattr_t ca; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c index d3f5944..d03e399 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c @@ -36,6 +36,8 @@ void *t1_func(void *arg) struct timespec timeout; struct timeval curtime; + (void) arg; + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr, "Thread1 failed to acquire the mutex\n"); exit(PTS_UNRESOLVED); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c index 83d8e27..43cdf3f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c @@ -33,6 +33,8 @@ void *t1_func(void *arg) struct timespec timeout; struct timeval curtime; + (void) arg; + if (pthread_mutex_lock(&td.mutex) != 0) { fprintf(stderr, "Thread1 failed to acquire the mutex\n"); exit(PTS_UNRESOLVED); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c index 54c895a..0b29ea0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c @@ -41,9 +41,7 @@ #ifndef WITHOUT_XOPEN #define _XOPEN_SOURCE 600 #endif - /********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ + #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -56,32 +54,9 @@ #include <string.h> #include <time.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif @@ -92,9 +67,6 @@ #define USE_ALTCLK /* make tests with MONOTONIC CLOCK if supported */ #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ #ifndef WITHOUT_XOPEN typedef struct { @@ -226,7 +198,8 @@ void *tf(void *arg) int main(void) { - int ret, i, j, k; + int ret, k; + unsigned int i, j; pthread_mutexattr_t ma; pthread_condattr_t ca; pthread_cond_t cnd; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c index 6a3e868..25c033c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c @@ -30,9 +30,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L - /********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -44,32 +41,9 @@ #include <signal.h> #include <time.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #define WITH_SYNCHRO #ifndef VERBOSE #define VERBOSE 2 @@ -78,10 +52,6 @@ #define TIMEOUT (1000) /* ns, timeout parameter for pthread_cond_timedwait */ #define INTERVAL (700) /* ns, frequency (actually, period) for the condition signaling */ -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ - char do_it = 1; unsigned long count_cnd_sig = 0, count_cnd_wup = 0; #ifdef WITH_SYNCHRO @@ -142,6 +112,7 @@ void *sendsig(void *arg) /* This one is registered for signal SIGUSR1 */ void sighdl1(int sig) { + (void) sig; #ifdef WITH_SYNCHRO if (sem_post(&semsig1)) { UNRESOLVED(errno, "Sem_post in signal handler 1"); @@ -152,6 +123,7 @@ void sighdl1(int sig) /* This one is registered for signal SIGUSR2 */ void sighdl2(int sig) { + (void) sig; #ifdef WITH_SYNCHRO if (sem_post(&semsig2)) { UNRESOLVED(errno, "Sem_post in signal handler 2"); @@ -166,6 +138,8 @@ void *waiter(void *arg) int ret; struct timespec ts; + (void) arg; + /* We don't block the signals SIGUSR1 and SIGUSR2 for this THREAD */ ret = pthread_sigmask(SIG_UNBLOCK, &usersigs, NULL); if (ret != 0) { @@ -219,9 +193,10 @@ void *waiter(void *arg) void *worker(void *arg) { int ret = 0; - struct timespec ts, tsrem; + (void) arg; + /* We block the signals SIGUSR1 and SIGUSR2 for this THREAD */ ret = pthread_sigmask(SIG_BLOCK, &usersigs, NULL); if (ret != 0) { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c index c6117ba..b85ad26 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c @@ -29,7 +29,7 @@ #include "posixtest.h" static pthread_spinlock_t spinlock; -volatile static int thread_state; +static volatile int thread_state; #define NOT_CREATED_THREAD 1 #define ENTERED_THREAD 2 @@ -52,6 +52,8 @@ static void *fn_chld(void *arg) thread_state = ENTERED_THREAD; int cnt = 0; + (void) arg; + /* Unblock the SIGALRM signal for the thread */ sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c index b19202e..d91806f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c @@ -29,7 +29,7 @@ #include "posixtest.h" static pthread_spinlock_t spinlock; -volatile static int thread_state; +static volatile int thread_state; #define NOT_CREATED_THREAD 1 #define ENTERED_THREAD 2 @@ -40,6 +40,8 @@ static void *fn_chld(void *arg) int rc = 0; thread_state = ENTERED_THREAD; + (void) arg; + /* Lock the spinlock */ printf("thread: attempt spin lock\n"); rc = pthread_spin_lock(&spinlock); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c index 58cf33e..d1739bf 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c @@ -31,7 +31,7 @@ #include "posixtest.h" static pthread_spinlock_t spinlock; -volatile static int thread_state; +static volatile int thread_state; #define NOT_CREATED_THREAD 1 #define ENTERED_THREAD 2 @@ -42,6 +42,8 @@ static void *fn_chld(void *arg) int rc = 0; thread_state = ENTERED_THREAD; + (void) arg; + printf("thread: attempt trylock\n"); rc = pthread_spin_trylock(&spinlock); if (rc != 0) { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c index 98482c8..f3c0a6c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c @@ -33,7 +33,7 @@ #include "posixtest.h" static pthread_spinlock_t spinlock; -volatile static int thread_state; +static volatile int thread_state; #define NOT_CREATED_THREAD 1 #define ENTERED_THREAD 2 @@ -44,6 +44,8 @@ static void *fn_chld(void *arg) int rc = 0; thread_state = ENTERED_THREAD; + (void) arg; + printf("thread: attempt spin lock\n"); rc = pthread_spin_lock(&spinlock); if (rc != 0) { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c index fce841c..4b0a5e6 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c @@ -31,7 +31,7 @@ #include "posixtest.h" static pthread_spinlock_t spinlock; -volatile static int sem; +static volatile int sem; #define INTHREAD 0 #define INMAIN 1 @@ -40,6 +40,8 @@ static void *fn_chld(void *arg) { int rc = 0; + (void) arg; + /* Initialize spin lock */ if (pthread_spin_init(&spinlock, PTHREAD_PROCESS_PRIVATE) != 0) { printf("main: Error at pthread_spin_init()\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c index f0bec0e..41bd3d0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c @@ -1,7 +1,8 @@ /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis - +* Copyright (c) 2013 Cyril Hrubis <ch...@su...> +* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. @@ -13,26 +14,23 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - +* * This sample test aims to check the following assertions: * * If SA_SIGINFO is not set in sa_flags, sa_handler is used as the signal * handling function. - +* * The steps are: * -> register a handler for SIGABRT without SA_SIGINFO, and a known function -* as saèhandler +* as sa_handler * -> raise SIGABRT, and check the function has been called. - +* * The test fails if the function is not called */ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/******************************************************************************/ -/*************************** standard includes ********************************/ -/******************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -43,97 +41,57 @@ #include <signal.h> #include <errno.h> -/******************************************************************************/ -/*************************** Test framework *******************************/ -/******************************************************************************/ -#include "../testfrmw/testfrmw.h" -#include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int - * (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/******************************************************************************/ -/**************************** Configuration ***********************************/ -/******************************************************************************/ -#ifndef VERBOSE -#define VERBOSE 1 -#endif - -#define SIGNAL SIGABRT - -/******************************************************************************/ -/*************************** Test case ***********************************/ -/******************************************************************************/ - -int called = 0; -void handler(int sig) +#include "posixtest.h" + +static sig_atomic_t called = 0; + +static void handler() { called = 1; } -/* main function */ int main(void) { int ret; - struct sigaction sa; - /* Initialize output */ - output_init(); - /* Set the signal handler */ sa.sa_flags = 0; sa.sa_handler = handler; ret = sigemptyset(&sa.sa_mask); if (ret != 0) { - UNRESOLVED(ret, "Failed to empty signal set"); + perror("Failed to empty signal set"); + return PTS_UNRESOLVED; } /* Install the signal handler for SIGABRT */ - ret = sigaction(SIGNAL, &sa, 0); + ret = sigaction(SIGABRT, &sa, 0); if (ret != 0) { - UNRESOLVED(ret, "Failed to set signal handler"); + perror("Failed to set signal handler"); + return PTS_UNRESOLVED; } if (called) { - FAILED - ("The signal handler has been called when no signal was raised"); + fprintf(stderr, + "The signal handler has been called before signal was raised"); + return PTS_FAIL; } - ret = raise(SIGNAL); + ret = raise(SIGABRT); if (ret != 0) { - UNRESOLVED(ret, "Failed to raise SIGABRT"); + perror("Failed to raise SIGABRT"); + return PTS_UNRESOLVED; } if (!called) { - FAILED - ("the sa_handler was not called whereas SA_SIGINFO was not set"); + fprintf(stderr, "The sa_handler was not called\n"); + return PTS_FAIL; } - /* Test passed */ -#if VERBOSE > 0 - - output("Test passed\n"); - -#endif + printf("Test PASSED\n"); - PASSED; + return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c index f13a319..e595b6d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c @@ -1,7 +1,8 @@ /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis - +* Copyright (c) 2013 Cyril Hrubis <ch...@su...> +* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. @@ -13,26 +14,23 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - +* * This sample test aims to check the following assertions: * * If SA_SIGINFO is not set in sa_flags, sa_handler is used as the signal * handling function. - +* * The steps are: * -> register a handler for SIGPIPE without SA_SIGINFO, and a known function -* as saèhandler +* as sa_handler * -> raise SIGPIPE, and check the function has been called. - +* * The test fails if the function is not called */ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/******************************************************************************/ -/*************************** standard includes ********************************/ -/******************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -43,97 +41,57 @@ #include <signal.h> #include <errno.h> -/******************************************************************************/ -/*************************** Test framework *******************************/ -/******************************************************************************/ -#include "../testfrmw/testfrmw.h" -#include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int - * (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/******************************************************************************/ -/**************************** Configuration ***********************************/ -/******************************************************************************/ -#ifndef VERBOSE -#define VERBOSE 1 -#endif - -#define SIGNAL SIGPIPE - -/******************************************************************************/ -/*************************** Test case ***********************************/ -/******************************************************************************/ - -int called = 0; -void handler(int sig) +#include "posixtest.h" + +static sig_atomic_t called = 0; + +static void handler() { called = 1; } -/* main function */ int main(void) { int ret; - struct sigaction sa; - /* Initialize output */ - output_init(); - /* Set the signal handler */ sa.sa_flags = 0; sa.sa_handler = handler; ret = sigemptyset(&sa.sa_mask); if (ret != 0) { - UNRESOLVED(ret, "Failed to empty signal set"); + perror("Failed to empty signal set"); + return PTS_UNRESOLVED; } /* Install the signal handler for SIGPIPE */ - ret = sigaction(SIGNAL, &sa, 0); + ret = sigaction(SIGPIPE, &sa, 0); if (ret != 0) { - UNRESOLVED(ret, "Failed to set signal handler"); + perror("Failed to set signal handler"); + return PTS_UNRESOLVED; } if (called) { - FAILED - ("The signal handler has been called when no signal was raised"); + fprintf(stderr, + "The signal handler has been called before signal was raised"); + return PTS_FAIL; } - ret = raise(SIGNAL); + ret = raise(SIGPIPE); if (ret != 0) { - UNRESOLVED(ret, "Failed to raise SIGPIPE"); + perror("Failed to raise SIGPIPE"); + return PTS_UNRESOLVED; } if (!called) { - FAILED - ("the sa_handler was not called whereas SA_SIGINFO was not set"); + fprintf(stderr, "The sa_handler was not called\n"); + return PTS_FAIL; } - /* Test passed */ -#if VERBOSE > 0 - - output("Test passed\n"); - -#endif + printf("Test PASSED\n"); - PASSED; + return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c index b5889e1..7906c98 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c @@ -1,7 +1,8 @@ /* * Copyright (c) 2005, Bull S.A.. All rights reserved. * Created by: Sebastien Decugis - +* Copyright (c) 2013 Cyril Hrubis <ch...@su...> +* * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. @@ -13,26 +14,23 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - +* * This sample test aims to check the following assertions: * * If SA_SIGINFO is not set in sa_flags, sa_handler is used as the signal * handling function. - +* * The steps are: * -> register a handler for SIGQUIT without SA_SIGINFO, and a known function -* as saèhandler +* as sa_handler * -> raise SIGQUIT, and check the function has been called. - +* * The test fails if the function is not called */ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/******************************************************************************/ -/*************************** standard includes ********************************/ -/******************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -43,97 +41,57 @@ #include <signal.h> #include <errno.h> -/******************************************************************************/ -/*************************** Test framework *******************************/ -/******************************************************************************/ -#include "../testfrmw/testfrmw.h" -#include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * ... [truncated message content] |