|
From: <sv...@va...> - 2011-10-28 00:16:28
|
Author: florian
Date: 2011-10-28 01:11:44 +0100 (Fri, 28 Oct 2011)
New Revision: 12246
Log:
Rewrite test to not use function clock_gettime. The purpose
of this is to not have to link against -lrt because that causes
a different back-trace on certain x86 and s390x environments.
See the thread with subject
"helgrind/tests/cond_timedwait_invalid failing on x86"
on valgrind-developers for more details.
Modified:
trunk/helgrind/tests/Makefile.am
trunk/helgrind/tests/cond_timedwait_invalid.c
Modified: trunk/helgrind/tests/Makefile.am
===================================================================
--- trunk/helgrind/tests/Makefile.am 2011-10-27 11:08:44 UTC (rev 12245)
+++ trunk/helgrind/tests/Makefile.am 2011-10-28 00:11:44 UTC (rev 12246)
@@ -185,8 +185,3 @@
else
annotate_hbefore_CFLAGS = $(AM_CFLAGS)
endif
-
-if VGCONF_OS_IS_LINUX
-cond_timedwait_invalid_LDADD = -lrt
-endif
-
Modified: trunk/helgrind/tests/cond_timedwait_invalid.c
===================================================================
--- trunk/helgrind/tests/cond_timedwait_invalid.c 2011-10-27 11:08:44 UTC (rev 12245)
+++ trunk/helgrind/tests/cond_timedwait_invalid.c 2011-10-28 00:11:44 UTC (rev 12246)
@@ -1,4 +1,4 @@
-#include "config.h"
+
#include <time.h>
#include <pthread.h>
#include <assert.h>
@@ -10,12 +10,12 @@
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-#ifdef HAVE_CLOCK_GETTIME
- assert(clock_gettime(CLOCK_REALTIME, &abstime)==0);
-#else
+
+
+
abstime.tv_sec = time(NULL) + 2;
abstime.tv_nsec = 0;
-#endif
+
abstime.tv_nsec += 1000000000;
assert(pthread_mutex_lock(&mutex)==0);
|