From patchwork Mon Oct 16 13:00:05 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: 115913 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3664163qgn; Mon, 16 Oct 2017 06:07:56 -0700 (PDT) X-Google-Smtp-Source: ABhQp+R6DkMDskwZAOlNQrDNYcKK4vFQFJWkMf1R6QLTnRhInlzy+lrcVw6elFNTZCsTGGvGRRYW X-Received: by 10.107.150.199 with SMTP id y190mr12648253iod.132.1508159276403; Mon, 16 Oct 2017 06:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508159276; cv=none; d=google.com; s=arc-20160816; b=mmjRQwY+s8F0h5IAsSSCXryWMxs60Vr4BEbp0t1WHrFt+2cGMx29h+bXBCr7oOqG4J QGWfflCaof+jCj7C3fod917aFd2FltDm1DEELkB+UbfvBpNL1l5VZET8RDOb7qPRao4G az/Jv7KH+VwAJwpsN2yE00gupiutxZdv+1Yln+LTvlFWduw2NlsIbP3rTIxCgIfPQ6XG 1wCzg+Px9FofyhbWIIoPq5LriJl2QVeYNd7I5aBlTinZU5f/aseFwKjHdA+Wki6+ZhCw 3H9d0Pg8UYuivI+4w+pX6CZz/m/ga8Cxt03xGZrSyqPah7fCkGrp4oN74aXvYuzlOzZw e+WQ== 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=O1pz5WoHX1zU9hsksjHABxzfj6yZSOFby8hrnToRHNk=; b=zQ2Zurfve2wP5XNK9Kua3LUTfQXFEKkPeyYWfVRQ5xWRY7KAbfJsWHwcWeUI5tkqSY qMpxe2t32reddLBUt6Ujo8higyJqiw1QF3XbsbhOJUBBDNe8Mi32r36J+ADBcODCh0Dg u3BZMWFrAXicIyVWa0Eefn8LlX/mT7G6TuWhzuBe0ZVjzuc3cYaVOxl1sg5rk+jmOzcB m2hC0OQf4WwA5vrkmeb/qH5ri6pxokgCJoCYMgvevxRdcJX2mO85T8irhCToZ9FOmFn9 dGHi9CGabjGqfOowsEPqBAczGVrrdtbvsEwvxhhi1DscqagsRiA+oMUcs6obEKO23KVh 8NvA== 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 y86si5167932ita.142.2017.10.16.06.07.56; Mon, 16 Oct 2017 06:07:56 -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 E3C0761002; Mon, 16 Oct 2017 13:07:55 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 F0E0A60845; Mon, 16 Oct 2017 13:01:21 +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 D183D60B5A; Mon, 16 Oct 2017 13:01:16 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id B96D9608E8 for ; Mon, 16 Oct 2017 13:00:19 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward106j.mail.yandex.net (Yandex) with ESMTP id B84981802B60 for ; Mon, 16 Oct 2017 16:00:18 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 4PybCRHn0D-0IoulL6x; Mon, 16 Oct 2017 16:00:18 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id AktaPQxe42-0IQSKovo; Mon, 16 Oct 2017 16:00:18 +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: Mon, 16 Oct 2017 16:00:05 +0300 Message-Id: <1508158805-5932-9-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508158805-5932-1-git-send-email-odpbot@yandex.ru> References: <1508158805-5932-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v1 8/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: 54f5fc670a7c125b6b0098e34e68fe3b45875069 **/ 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 b4c2917b1..2be4f80a1 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[];