diff mbox series

[v3,1/1] test:queue:update order queue test for locks.

Message ID 1498806049-2253-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/1] test:queue:update order queue test for locks. | expand

Commit Message

Github ODP bot June 30, 2017, 7 a.m. UTC
From: Nikhil Agarwal <nikhil.agarwal@linaro.org>


Order queue test should reserve ordered locks only if
ordered locks count is more than 1.

Signed-off-by: Nikhil Agarwal <nikhil.agarwal@linaro.org>

---
/** Email created from pull request 62 (NikhilA-Linaro:master_queue_cunit)
 ** https://github.com/Linaro/odp/pull/62
 ** Patch: https://github.com/Linaro/odp/pull/62.patch
 ** Base sha: 9b78da8e2373ab0530cfbbd72b2229059b57ddf1
 ** Merge commit sha: 3e797d63f91109bdb3c4749ecf96b6b1363bde68
 **/
 test/common_plat/validation/api/queue/queue.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/common_plat/validation/api/queue/queue.c b/test/common_plat/validation/api/queue/queue.c
index 6a13c006..f08d811f 100644
--- a/test/common_plat/validation/api/queue/queue.c
+++ b/test/common_plat/validation/api/queue/queue.c
@@ -262,6 +262,7 @@  void queue_test_info(void)
 	const char *const nq_order = "test_q_order";
 	odp_queue_info_t info;
 	odp_queue_param_t param;
+	odp_queue_capability_t capability;
 	char q_plain_ctx[] = "test_q_plain context data";
 	char q_order_ctx[] = "test_q_order context data";
 	unsigned lock_count;
@@ -274,13 +275,18 @@  void queue_test_info(void)
 	CU_ASSERT(odp_queue_context_set(q_plain, q_plain_ctx,
 					sizeof(q_plain_ctx)) == 0);
 
+	memset(&capability, 0, sizeof(odp_queue_capability_t));
+	CU_ASSERT(odp_queue_capability(&capability) == 0);
 	/* Create a scheduled ordered queue with explicitly set params */
 	odp_queue_param_init(&param);
 	param.type       = ODP_QUEUE_TYPE_SCHED;
 	param.sched.prio = ODP_SCHED_PRIO_NORMAL;
 	param.sched.sync = ODP_SCHED_SYNC_ORDERED;
 	param.sched.group = ODP_SCHED_GROUP_ALL;
-	param.sched.lock_count = 1;
+	if (capability.max_ordered_locks)
+		param.sched.lock_count = 1;
+	else
+		param.sched.lock_count = 0;
 	param.context = q_order_ctx;
 	q_order = odp_queue_create(nq_order, &param);
 	CU_ASSERT(ODP_QUEUE_INVALID != q_order);