diff mbox series

[v2,2/5] validation: scheduler: print debug diagnostics on test_wait failure

Message ID 1536145206-9205-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v2,1/5] validation: time: fix c&p error | expand

Commit Message

Github ODP bot Sept. 5, 2018, 11 a.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: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b
 **/
 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);
 }