|
From: Tom H. <th...@cy...> - 2005-02-13 16:43:21
|
CVS commit by thughes:
Fix the scalar test to allow munlockall to fail with EPERM and
set_tid_address to fail with ENOSYS which they do on some systems.
M +2 -2 scalar.c 1.53
M +12 -0 scalar.h 1.5
--- valgrind/memcheck/tests/scalar.c #1.52:1.53
@@ -669,5 +669,5 @@ int main(void)
// __NR_munlockall 153
GO(__NR_munlockall, "0s 0m");
- SY(__NR_munlockall); SUCC;
+ SY(__NR_munlockall); SUCC_OR_FAILx(EPERM);
// __NR_sched_setparam 154
@@ -1118,5 +1118,5 @@ int main(void)
// __NR_set_tid_address 258
GO(__NR_set_tid_address, "1s 0m");
- SY(__NR_set_tid_address, x0); SUCC;
+ SY(__NR_set_tid_address, x0); SUCC_OR_FAILx(ENOSYS);
// __NR_timer_create 259
--- valgrind/memcheck/tests/scalar.h #1.4:1.5
@@ -48,2 +48,14 @@ extern long int syscall (long int __sysn
} while (0);
+#define SUCC_OR_FAILx(E) \
+ do { \
+ int myerrno = errno; \
+ if (-1 == res) { \
+ if (E == myerrno) { \
+ /* as expected */ \
+ } else { \
+ fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
+ exit(1); \
+ } \
+ } \
+ } while (0);
|