From: Daniel Kurtz <[email protected]>

This test strives to avoid false passes, but misses an important one:
If either thread cannot create a second display it will return PIGLIT_SKIP.

However, piglit_merge_result(PASS, SKIP) or piglit_merge_result(SKIP, PASS)
throws away the SKIP and returns PASS.  For this test, we really want to
return SKIP if either thread returns SKIP.

Signed-off-by: Daniel Kurtz <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
---
 tests/egl/spec/egl_khr_fence_sync/egl_khr_fence_sync.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/egl/spec/egl_khr_fence_sync/egl_khr_fence_sync.c 
b/tests/egl/spec/egl_khr_fence_sync/egl_khr_fence_sync.c
index 4fb1ccd..e6447bc 100644
--- a/tests/egl/spec/egl_khr_fence_sync/egl_khr_fence_sync.c
+++ b/tests/egl/spec/egl_khr_fence_sync/egl_khr_fence_sync.c
@@ -1199,7 +1199,7 @@ cleanup:
 static enum piglit_result
 test_eglCreateSyncKHR_with_display_bound_in_other_thread(void *test_data)
 {
-       enum piglit_result result = PIGLIT_PASS;
+       enum piglit_result result;
        enum piglit_result *t2_result = NULL;
        bool orig_print_tid;
        pthread_t thread2;
@@ -1236,7 +1236,15 @@ 
test_eglCreateSyncKHR_with_display_bound_in_other_thread(void *test_data)
        }
 
        if (t2_result) {
-               piglit_merge_result(&result, *t2_result);
+               /*
+                * If either thread SKIPs, then SKIP the test.
+                * Otherwise do a merge to return possible ERROR/WARN.
+                */
+               if ((result == PIGLIT_PASS && *t2_result == PIGLIT_SKIP) ||
+                   (result == PIGLIT_SKIP && *t2_result == PIGLIT_PASS))
+                       result = PIGLIT_SKIP;
+               else
+                       piglit_merge_result(&result, *t2_result);
        } else {
                piglit_loge("thread %"PRIuMAX" returned no piglit_result",
                            (uintmax_t) thread2);
-- 
2.1.0

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to