]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: Convert tests to the new support test-driver
authorWainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com>
Tue, 21 Feb 2017 13:16:49 +0000 (10:16 -0300)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Tue, 21 Feb 2017 17:00:00 +0000 (14:00 -0300)
Change the powerpc tests to use <support/test-driver.c>.
Also replace some of pthread calls to its xpthread equivalent.

Tested on ppc64le.

* sysdeps/powerpc/test-get_hwcap.c: Use <support/test-driver.c>
instead of test-skeleton.c.
(do_test): Replaced pthread_create and pthread_join with
xpthread_create and xpthread_join.  Use TEST_VERIFY_EXIT macro.
Removed unneeded status variable.
* sysdeps/powerpc/test-gettimebase.c: Use <support/test-driver.c>
instead of test-skeleton.c.
* sysdeps/powerpc/tst-tlsopt-powerpc.c: Likewise.

ChangeLog
sysdeps/powerpc/test-get_hwcap.c
sysdeps/powerpc/test-gettimebase.c
sysdeps/powerpc/tst-tlsopt-powerpc.c

index cfc9ff48ee8a84909db81295066a08b0e04d341d..be4291b4e5a25c79e90c45e9f401a985fb988670 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-02-21  Wainer dos Santos Moschetta  <wainersm@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/test-get_hwcap.c: Use <support/test-driver.c>
+       instead of test-skeleton.c.
+       (do_test): Replaced pthread_create and pthread_join with
+       xpthread_create and xpthread_join.  Use TEST_VERIFY_EXIT macro.
+       Removed unneeded status variable.
+       * sysdeps/powerpc/test-gettimebase.c: Use <support/test-driver.c>
+       instead of test-skeleton.c.
+       * sysdeps/powerpc/tst-tlsopt-powerpc.c: Likewise.
+
 2017-02-20  Mike FABIAN  <mfabian@redhat.com>
 
        [BZ #20313]
index f32ad639e60389cd3c13e6504c5bbbac307dbace..d77631073421f89de1c44fc97a07d46be98cf36d 100644 (file)
@@ -23,6 +23,9 @@
 #include <stdint.h>
 #include <pthread.h>
 
+#include <support/check.h>
+#include <support/xthread.h>
+
 #include <sys/auxv.h>
 
 #include <dl-procinfo.h>
@@ -148,7 +151,6 @@ do_test (void)
   pthread_attr_t attr;
   pthread_attr_init (&attr);
   pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE);
-  void *status;
 
   long i = 0;
 
@@ -160,22 +162,10 @@ do_test (void)
 
   /* Check for other thread.  */
   i++;
-  if (pthread_create (&threads[i], &attr, t1, (void *)i))
-    {
-      printf ("FAIL: error creating thread %ld.\n", i);
-      return 1;
-    }
+  threads[i] = xpthread_create (&attr, t1, (void *)i);
 
   pthread_attr_destroy (&attr);
-  if (pthread_join (threads[i], &status))
-    {
-      printf ("FAIL: error joining thread %ld.\n", i);
-      return 1;
-    }
-  if (status)
-    {
-      return 1;
-    }
+  TEST_VERIFY_EXIT (xpthread_join (threads[i]) == NULL);
 
   printf("PASS: HWCAP, HWCAP2 and AT_PLATFORM are correctly set in the TCB for"
         " all threads.\n");
@@ -184,5 +174,4 @@ do_test (void)
 
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
index 555f146a54b538681167d6e04d3e4923c48a2091..0e8e2f00fce04f83d1a3319e2c4e8573e8c8c627 100644 (file)
@@ -43,5 +43,4 @@ do_test (void)
   return 1;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>
index c9a14cbfdc79476b673a3411435970ad779d98c6..8ae928a3f4c70c597c1adcd750cbee34573b5ece 100644 (file)
@@ -8,7 +8,6 @@
 COMMON_INT_DEF(foo);
 
 
-#define TEST_FUNCTION do_test ()
 static int
 do_test (void)
 {
@@ -49,4 +48,4 @@ do_test (void)
   return result;
 }
 
-#include "../../test-skeleton.c"
+#include <support/test-driver.c>