From 085a865dd7ca24d5fcc0c1bb9242590ee5aec2c5 Mon Sep 17 00:00:00 2001 From: Nicolas Morey-Chaisemartin Date: Wed, 26 Aug 2015 16:06:05 +0200 Subject: validation: synchronizers: support a single worker no_barrier and no_lock tests are expected to fail but when running a single worker, they do work Signed-off-by: Nicolas Morey-Chaisemartin Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- test/validation/synchronizers/synchronizers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 0a31a40ef..6cb36990a 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -253,9 +253,10 @@ static void *no_barrier_functional_test(void *arg UNUSED) * Note that the following CU_ASSERT MAY appear incorrect, but for the * no_barrier test it should see barrier_errs or else there is something * wrong with the test methodology or the ODP thread implementation. - * So this test PASSES only if it sees barrier_errs! + * So this test PASSES only if it sees barrier_errs or a single + * worker was used. */ - CU_ASSERT(barrier_errs != 0); + CU_ASSERT(barrier_errs != 0 || global_mem->g_num_threads == 1); thread_finalize(per_thread_mem); return NULL; @@ -447,9 +448,10 @@ static void *no_lock_functional_test(void *arg UNUSED) /* Note that the following CU_ASSERT MAY appear incorrect, but for the * no_lock test it should see sync_failures or else there is something * wrong with the test methodology or the ODP thread implementation. - * So this test PASSES only if it sees sync_failures + * So this test PASSES only if it sees sync_failures or a single + * worker was used. */ - CU_ASSERT(sync_failures != 0); + CU_ASSERT(sync_failures != 0 || global_mem->g_num_threads == 1); thread_finalize(per_thread_mem); -- cgit v1.2.3