diff mbox series

[v1,3/4] validation: scheduler: print debug diagnostics on test_wait failure

Message ID 1536091206-7970-4-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/4] validation: time: fix c&p error | expand

Commit Message

Github ODP bot Sept. 4, 2018, 8 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 694 (lumag:timer)
 ** https://github.com/Linaro/odp/pull/694
 ** Patch: https://github.com/Linaro/odp/pull/694.patch
 ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0
 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4
 **/
 test/validation/api/scheduler/scheduler.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c
index 2e44d3248..069220393 100644
--- a/test/validation/api/scheduler/scheduler.c
+++ b/test/validation/api/scheduler/scheduler.c
@@ -185,8 +185,19 @@  static void scheduler_test_wait_time(void)
 	upper_limit = odp_time_local_from_ns(5 * ODP_TIME_SEC_IN_NS +
 							ODP_WAIT_TOLERANCE);
 
-	CU_ASSERT(odp_time_cmp(diff, lower_limit) >= 0);
-	CU_ASSERT(odp_time_cmp(diff, upper_limit) <= 0);
+	if (odp_time_cmp(diff, lower_limit) <= 0) {
+		fprintf(stderr, "Exceed lower limit: "
+			"diff is %" PRIu64 ", lower_limit %" PRIu64 "\n",
+			odp_time_to_ns(diff), odp_time_to_ns(lower_limit));
+		CU_FAIL("Exceed lower limit\n");
+	}
+
+	if (odp_time_cmp(diff, upper_limit) >= 0) {
+		fprintf(stderr, "Exceed upper limit: "
+			"diff is %" PRIu64 ", upper_limit %" PRIu64 "\n",
+			odp_time_to_ns(diff), odp_time_to_ns(upper_limit));
+		CU_FAIL("Exceed upper limit\n");
+	}
 
 	CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0);
 }