From: Bart Van Assche Date: Tue, 28 Aug 2012 18:17:27 +0000 (+0000) Subject: drd/tests: Add a test that verifies whether the pthread_cancel() intercept works X-Git-Tag: svn/VALGRIND_3_9_0~732 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7ff000e27bed744017e906c28df3de6a24953d4;p=thirdparty%2Fvalgrind.git drd/tests: Add a test that verifies whether the pthread_cancel() intercept works git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12908 --- diff --git a/drd/tests/pth_cancel_locked.c b/drd/tests/pth_cancel_locked.c index 86c15b8cbf..6e877e3254 100644 --- a/drd/tests/pth_cancel_locked.c +++ b/drd/tests/pth_cancel_locked.c @@ -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; diff --git a/drd/tests/pth_cancel_locked.stderr.exp b/drd/tests/pth_cancel_locked.stderr.exp index e00753e3ad..74c2eb04d6 100644 --- a/drd/tests/pth_cancel_locked.stderr.exp +++ b/drd/tests/pth_cancel_locked.stderr.exp @@ -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)