2016-11-07 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
+ * nptl/tst-basic1.c (tf, do_test): Use write_message.
+ * nptl/tst-cleanup1.c (do_test): Likewise.
+ * nptl/tst-cleanup3.c (do_test): Likewise.
+ * nptl/tst-key1.c (do_test): Likewise.
+ * nptl/tst-key2.c (tf, do_test): Likewise.
+ * nptl/tst-key3.c (tf, do_test): Likewise.
+ * nptl/tst-stdio1.c (do_test): Likewise.
+ * nptl/tst-stdio2.c (do_test): Likewise.
+
* nptl/tst-kill3.c (handler): Use write_message in place of write.
* nptl/tst-kill6.c (handler): Likewise.
* nptl/tst-tls2.c (CB): Likewise.
#include <sys/types.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static pid_t pid;
static void *
{
if (getpid () != pid)
{
- write (2, "pid mismatch\n", 13);
+ write_message ("pid mismatch\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_create (&t[i], NULL, tf, (void *) (long int) (i + 1)) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
else
}
else if (r != (void *) (long int) (i + 1))
{
- write (2, "result wrong\n", 13);
+ write_message ("result wrong\n");
_exit (1);
}
else
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int global;
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int global;
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
int
do_test (void)
{
for (i = 0; i < max; ++i)
if (pthread_key_create (&keys[i], NULL) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
else
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
#define N 2
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int cnt0;
static void
f0 (void *p)
if (pthread_setspecific (*key, (void *) -1l) != 0)
{
- write (2, "setspecific failed\n", 19);
+ write_message ("setspecific failed\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_create (&keys[i], fcts[i]) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
pthread_t th;
if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
if (pthread_join (th, NULL) != 0)
{
- write (2, "join failed\n", 12);
+ write_message ("join failed\n");
_exit (1);
}
if (cnt0 != 0)
{
- write (2, "cnt0 != 0\n", 10);
+ write_message ("cnt0 != 0\n");
_exit (1);
}
if (cnt1 != 1)
{
- write (2, "cnt1 != 1\n", 10);
+ write_message ("cnt1 != 1\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_delete (keys[i]) != 0)
{
- write (2, "key_delete failed\n", 18);
+ write_message ("key_delete failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
#define N 2
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static int cnt0;
static void
f0 (void *p)
if (pthread_setspecific (*key, (void *) -1l) != 0)
{
- write (2, "setspecific failed\n", 19);
+ write_message ("setspecific failed\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_create (&keys[i], fcts[i]) != 0)
{
- write (2, "key_create failed\n", 18);
+ write_message ("key_create failed\n");
_exit (1);
}
if (pthread_barrier_init (&b, NULL, 2) != 0)
{
- write (2, "barrier_init failed\n", 20);
+ write_message ("barrier_init failed\n");
_exit (1);
}
pthread_t th;
if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
if (pthread_cancel (th) != 0)
{
- write (2, "cancel failed\n", 14);
+ write_message ("cancel failed\n");
_exit (1);
}
void *status;
if (pthread_join (th, &status) != 0)
{
- write (2, "join failed\n", 12);
+ write_message ("join failed\n");
_exit (1);
}
if (status != PTHREAD_CANCELED)
{
- write (2, "thread not canceled\n", 20);
+ write_message ("thread not canceled\n");
_exit (1);
}
have run and therefore these tests succeed. */
if (cnt0 != 0)
{
- write (2, "cnt0 != 0\n", 10);
+ write_message ("cnt0 != 0\n");
_exit (1);
}
if (cnt1 != 1)
{
- write (2, "cnt1 != 1\n", 10);
+ write_message ("cnt1 != 1\n");
_exit (1);
}
for (i = 0; i < N; ++i)
if (pthread_key_delete (keys[i]) != 0)
{
- write (2, "key_delete failed\n", 18);
+ write_message ("key_delete failed\n");
_exit (1);
}
if (pthread_barrier_destroy (&b) != 0)
{
- write (2, "barrier_destroy failed\n", 23);
+ write_message ("barrier_destroy failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
#include <unistd.h>
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
static void *tf (void *a)
{
puts ("start tf");
if (pthread_create (&th, NULL, tf, NULL) != 0)
{
- write (2, "create failed\n", 14);
+ write_message ("create failed\n");
_exit (1);
}
return 0;
}
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"