Author: florian
Date: Wed Jul 16 08:18:17 2014
New Revision: 14168
Log:
Add testcase from BZ #324149 which was forgotten in r13641.
Added:
trunk/helgrind/tests/cond_timedwait_test.c
trunk/helgrind/tests/cond_timedwait_test.stderr.exp
trunk/helgrind/tests/cond_timedwait_test.stdout.exp
trunk/helgrind/tests/cond_timedwait_test.vgtest
Modified:
trunk/helgrind/tests/ (props changed)
trunk/helgrind/tests/Makefile.am
Modified: trunk/helgrind/tests/Makefile.am
==============================================================================
--- trunk/helgrind/tests/Makefile.am (original)
+++ trunk/helgrind/tests/Makefile.am Wed Jul 16 08:18:17 2014
@@ -15,6 +15,8 @@
cond_init_destroy.vgtest cond_init_destroy.stderr.exp \
cond_timedwait_invalid.vgtest cond_timedwait_invalid.stdout.exp \
cond_timedwait_invalid.stderr.exp \
+ cond_timedwait_test.vgtest cond_timedwait_test.stdout.exp \
+ cond_timedwait_test.stderr.exp \
bar_bad.vgtest bar_bad.stdout.exp bar_bad.stderr.exp \
bar_trivial.vgtest bar_trivial.stdout.exp bar_trivial.stderr.exp \
free_is_write.vgtest free_is_write.stdout.exp \
@@ -108,6 +110,7 @@
annotate_hbefore \
cond_init_destroy \
cond_timedwait_invalid \
+ cond_timedwait_test \
free_is_write \
hg01_all_ok \
hg02_deadlock \
Added: trunk/helgrind/tests/cond_timedwait_test.c
==============================================================================
--- trunk/helgrind/tests/cond_timedwait_test.c (added)
+++ trunk/helgrind/tests/cond_timedwait_test.c Wed Jul 16 08:18:17 2014
@@ -0,0 +1,20 @@
+#include <pthread.h>
+#include <string.h>
+
+int main() {
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+
+ // This time has most definitely passed already. (Epoch)
+ struct timespec now;
+ memset(&now, 0, sizeof(now));
+
+ pthread_mutex_lock(&mutex);
+ pthread_cond_timedwait(&cond, &mutex, &now);
+ pthread_mutex_unlock(&mutex);
+
+ pthread_mutex_destroy(&mutex);
+ pthread_cond_destroy(&cond);
+
+ return 0;
+}
Added: trunk/helgrind/tests/cond_timedwait_test.stderr.exp
==============================================================================
--- trunk/helgrind/tests/cond_timedwait_test.stderr.exp (added)
+++ trunk/helgrind/tests/cond_timedwait_test.stderr.exp Wed Jul 16 08:18:17 2014
@@ -0,0 +1,3 @@
+
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Added: trunk/helgrind/tests/cond_timedwait_test.stdout.exp
==============================================================================
(empty)
Added: trunk/helgrind/tests/cond_timedwait_test.vgtest
==============================================================================
--- trunk/helgrind/tests/cond_timedwait_test.vgtest (added)
+++ trunk/helgrind/tests/cond_timedwait_test.vgtest Wed Jul 16 08:18:17 2014
@@ -0,0 +1 @@
+prog: cond_timedwait_test
|