From patchwork Tue Oct 17 13:00:27 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: 116102 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4886965qgn; Tue, 17 Oct 2017 06:20:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAOZrPV6VlCeS3x0MrJX7th+9voWWxo655GYSqT5Ho+51kFFZRwcoL28wkryZTbWBHL1BOQ X-Received: by 10.107.114.5 with SMTP id n5mr17978584ioc.291.1508246442689; Tue, 17 Oct 2017 06:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508246442; cv=none; d=google.com; s=arc-20160816; b=hYE+2w+pJ82WjnljOBZI4Nb05qOFz+z4jvxIQyXSuH3GBK8VtGp1XV+cb6Zi1MlOSg zY2DLHUQ/323ZvWszN97KAGWzLXmkkNMI3kggomI+hxqvykpIq5DfPo7nX0eLKvQupEr rhBYIY/ywOpZV1pbyHoM7vqNKB7wSyTB/blIKaPyf0abSX/p/dDRW/lrPGEbIi6pILcs fDWDTZU41/cZfqk5OroyIr0b8Frld1Kvk6YArmU2Xgc+4jLLgcsj1q169wdMMjPQI2vS H7MaN8CwtNtbgiZ7BRx+8/Ar19EwqwirQYK9Xqm/2OM/9/nN8vmBjotxZgUso1pnTmtk nqPA== 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=zIPzoridABEtlBTEk+GCgdMzC08w7VfpLo7vTB6k/TNz7YQbDGGE3QnKPxmdm/Z/Sl ONJ7M5PuIQ85+EJi/axKRVmqhdFJkjjjto5qUsUPJTa1Oiu2NLwSP5NVfKKagzlbgptN UtpT7ImABLvsUiVquZ7xvA6YgNL9SrdDBXD/GYYV/RcmpcGhYH4o5b4iERDhWf+HHfNy CdMs5EpDAZgPfmwrYc2Y/hCVp+zEHiU/vAGXJxnc9TIJKvChxhsUD2DIVyS2psIWVD8m G9RCHC7sQ6h+Yi5yIcwriMxbDo2utOTIphbNe4g6s9jfEtFh1BSIW62higC81uSPEtIF vhzw== 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 e10si7102288itf.116.2017.10.17.06.20.42; Tue, 17 Oct 2017 06:20:42 -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 3E97162923; Tue, 17 Oct 2017 13:20:42 +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 57F616295F; Tue, 17 Oct 2017 13:04: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 3689E6295B; Tue, 17 Oct 2017 13:04:06 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id AD07B61203 for ; Tue, 17 Oct 2017 13:00:38 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 9818F44588 for ; Tue, 17 Oct 2017 16:00:37 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tEnut6NzYG-0bNmZcVO; Tue, 17 Oct 2017 16:00:37 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lxH8Glq2Gn-0b4WFJn1; Tue, 17 Oct 2017 16:00:37 +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 16:00:27 +0300 Message-Id: <1508245228-16824-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508245228-16824-1-git-send-email-odpbot@yandex.ru> References: <1508245228-16824-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[];