]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd/tests: Add a test that verifies whether the pthread_cancel() intercept works
authorBart Van Assche <bvanassche@acm.org>
Tue, 28 Aug 2012 18:17:27 +0000 (18:17 +0000)
committerBart Van Assche <bvanassche@acm.org>
Tue, 28 Aug 2012 18:17:27 +0000 (18:17 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12908

drd/tests/pth_cancel_locked.c
drd/tests/pth_cancel_locked.stderr.exp

index 86c15b8cbf561207e47d959bfa7364aa39f04b9a..6e877e32547a06733f27ab0a048b28622d4a81ba 100644 (file)
@@ -45,6 +45,9 @@ int main(int argc, char** argv)
   /* Join the created thread. */
   pthread_join(tid, 0);
 
+  /* Invoke pthread_cancel() with an invalid thread ID. */
+  pthread_cancel(tid);
+
   fprintf(stderr, "Test finished.\n");
 
   return 0;
index e00753e3ad80a47f8fab01de8a7e56c86966e46a..74c2eb04d684abc064838040d06843be1595e7d0 100644 (file)
@@ -6,6 +6,10 @@ mutex 0x........ was first observed at:
    at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
    by 0x........: main (pth_cancel_locked.c:?)
 
+pthread_cancel(): invalid thread ID 0x........
+   at 0x........: pthread_cancel (drd_pthread_intercepts.c:?)
+   by 0x........: main (pth_cancel_locked.c:?)
+
 Test finished.
 
-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)