From patchwork Tue Oct 17 14:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 116119 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4941230qgn; Tue, 17 Oct 2017 07:07:04 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RC6Dmc9XrWzkX8i3OQQgiHQIu3v1gMQj/Br8K0HietK4qfJB0JhA9AmmFo2B4b4IiiJgao X-Received: by 10.36.89.69 with SMTP id p66mr5520455itb.109.1508249224817; Tue, 17 Oct 2017 07:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508249224; cv=none; d=google.com; s=arc-20160816; b=TCbm3u3z8Zexmi4jYC1KHLqGH4iDAd2eerhEQs2Vxv/Jdc/9icAHiVRn8OIVAxdIS4 FyDas0Ely/i6cCuHeGSZxquzX87VFaW+yl9Tifz37KQQd0zZQalh/42glYIurTSqMZxp I8dd8eMwZYSR7uwMyJteRTpGHEPQHFxPTViWcp43u61KjnDbjWmxy9yvaOpmwWShsqxX W+gtLP4p+P4rmDcBaH//7LOXs1dk56qlgRoN4Kr9cSARcwT2Lsj627918pYjqUF9JTct VyWFnC4zPJu5Pq0eLNTLJCoAsvIGjDBQagY1oRFTHPgHAuwLj0uXaSDelHBi6qIUcB+1 gykg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=/6cXRvVxERbM2ES2jlamEC0e9Zeb/XkgXv43JDi3tvU=; b=oV64Z+5pRXsQfXKC7dFUKD3TWwDw6j4xA8it53tRevtxIYtOKL0+umzyCIXc+LsoRr 1i+8t2mWJS0bkT7hbcYgesXS4MJXcw5X1MtFlCMHCJ7aK7v1mzILcGjYQBXcPY3vqcug nkZV5i7uPwU8o+3xCFogo/ds7UKBpXAZvKJOLeuDvDEpxGXQQPgSGTCL/5Au8pXWveDQ nHNDxFc5LrPq6cpdnZC/4OIS1lXIq7rLGv4b3wFUztXqbuwGNLcczwc53l6TaR1CnUzO jhUgq7eoC9ShMqoymJT3B9E5Qx8WRaSkg9uRx0odQls8Pbo4RT8NpJ7qtBXfWBWmYF+z j3ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id u65si7191866iou.238.2017.10.17.07.07.04; Tue, 17 Oct 2017 07:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 4B75C62A85; Tue, 17 Oct 2017 14:07:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 546F462933; Tue, 17 Oct 2017 14:01:16 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5C29C628C3; Tue, 17 Oct 2017 14:00:31 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 3BE63628B4 for ; Tue, 17 Oct 2017 14:00:19 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 46CA85103AF3 for ; Tue, 17 Oct 2017 17:00:18 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Im3qRkWifG-0InuTed8; Tue, 17 Oct 2017 17:00:18 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tTs7mS0qFy-0H4OcbVO; Tue, 17 Oct 2017 17:00:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 17 Oct 2017 17:00:08 +0300 Message-Id: <1508248809-4850-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508248809-4850-1-git-send-email-odpbot@yandex.ru> References: <1508248809-4850-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v2 7/8] validation: pool: add packet info test X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Added odp_pool_info() test for packet pools. Signed-off-by: Petri Savolainen --- /** Email created from pull request 234 (psavol:next-pool-param) ** https://github.com/Linaro/odp/pull/234 ** Patch: https://github.com/Linaro/odp/pull/234.patch ** Base sha: afeda4d14bb6f449cb269680cdbd56b26726eedf ** Merge commit sha: cc4142b7bb4d97ad57cb925e9fc4165f1ab3f663 **/ test/common_plat/validation/api/pool/pool.c | 28 ++++++++++++++++++++++++++++ test/common_plat/validation/api/pool/pool.h | 1 + 2 files changed, 29 insertions(+) diff --git a/test/common_plat/validation/api/pool/pool.c b/test/common_plat/validation/api/pool/pool.c index 461715cc9..84c17720d 100644 --- a/test/common_plat/validation/api/pool/pool.c +++ b/test/common_plat/validation/api/pool/pool.c @@ -191,12 +191,40 @@ void pool_test_alloc_packet_subparam(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +void pool_test_info_packet(void) +{ + odp_pool_t pool; + odp_pool_info_t info; + odp_pool_param_t param; + const char pool_name[] = "test_pool_name"; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET; + param.pkt.num = PKT_NUM; + param.pkt.len = PKT_LEN; + + pool = odp_pool_create(pool_name, ¶m); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); + + CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); + CU_ASSERT(info.params.type == ODP_POOL_PACKET); + CU_ASSERT(info.params.pkt.num == param.pkt.num); + CU_ASSERT(info.params.pkt.len == param.pkt.len); + CU_ASSERT(info.pkt.max_num >= param.pkt.num); + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + odp_testinfo_t pool_suite[] = { ODP_TEST_INFO(pool_test_create_destroy_buffer), ODP_TEST_INFO(pool_test_create_destroy_packet), ODP_TEST_INFO(pool_test_create_destroy_timeout), ODP_TEST_INFO(pool_test_alloc_packet), ODP_TEST_INFO(pool_test_alloc_packet_subparam), + ODP_TEST_INFO(pool_test_info_packet), ODP_TEST_INFO(pool_test_lookup_info_print), ODP_TEST_INFO_NULL, }; diff --git a/test/common_plat/validation/api/pool/pool.h b/test/common_plat/validation/api/pool/pool.h index 3f8f5ebce..b284524e4 100644 --- a/test/common_plat/validation/api/pool/pool.h +++ b/test/common_plat/validation/api/pool/pool.h @@ -16,6 +16,7 @@ void pool_test_create_destroy_timeout(void); void pool_test_lookup_info_print(void); void pool_test_alloc_packet(void); void pool_test_alloc_packet_subparam(void); +void pool_test_info_packet(void); /* test arrays: */ extern odp_testinfo_t pool_suite[];