drd/tests: Add a test that verifies whether the pthread_cancel() intercept works
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12908 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/tests/pth_cancel_locked.c b/drd/tests/pth_cancel_locked.c
index 86c15b8..6e877e3 100644
--- a/drd/tests/pth_cancel_locked.c
+++ b/drd/tests/pth_cancel_locked.c
@@ -45,6 +45,9 @@
/* 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;
diff --git a/drd/tests/pth_cancel_locked.stderr.exp b/drd/tests/pth_cancel_locked.stderr.exp
index e00753e..74c2eb0 100644
--- a/drd/tests/pth_cancel_locked.stderr.exp
+++ b/drd/tests/pth_cancel_locked.stderr.exp
@@ -6,6 +6,10 @@
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)