From 5a5ff851788e1b9ae7638619bb2db301edaabff7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 8 May 2008 01:44:46 +0000 Subject: [PATCH] * Be more lenient when checking the timeout. In my tests Haiku was up to 5ms off. Not really good... * The test on non-shared unnamed semaphores doesn't request a shared semaphore anymore. It passes under Haiku, now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25363 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/system/libroot/posix/realtime_sem_test1.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/system/libroot/posix/realtime_sem_test1.cpp b/src/tests/system/libroot/posix/realtime_sem_test1.cpp index 2b015ae09a..f1606594cd 100644 --- a/src/tests/system/libroot/posix/realtime_sem_test1.cpp +++ b/src/tests/system/libroot/posix/realtime_sem_test1.cpp @@ -82,9 +82,9 @@ static void _assert_time_equals(const char* test, bigtime_t expected, bigtime_t actual, int lineNumber) { - // allow 2% deviation + // allow 5% deviation bigtime_t diff = actual > expected ? actual - expected : expected - actual; - if (diff <= expected / 50) + if (diff <= expected / 20) return; fprintf(stderr, "%s FAILED in line %d: expected time: %lld, actual: %lld\n", @@ -948,7 +948,7 @@ test_post_wait_unnamed_fork() // init TEST("sem_init()"); sem_t _sem; - assert_posix_success(sem_init(&_sem, 1, 1)); + assert_posix_success(sem_init(&_sem, 0, 1)); sem_t* sem = &_sem; TEST("sem_getvalue()");