From patchwork Fri Oct 27 08:00:11 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: 117301 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp477523qgn; Fri, 27 Oct 2017 01:05:42 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TKIeTqpL/9q6hh1YbqY+cvIkHRgyml5pCTrOJVo5cnfaBmqVJrXOmzahADknL2GZFlCFsM X-Received: by 10.107.147.86 with SMTP id v83mr35400934iod.82.1509091542846; Fri, 27 Oct 2017 01:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091542; cv=none; d=google.com; s=arc-20160816; b=nn2Hi+ipX4WQgU49WC6afL+jRS+Fq0isQeqEyrGH9Dqk5uRw9LTKZ9UuN2WJpCC1i9 7g+myc6Pcm0gIUXB3aU3nQ2ivBz3H3/PZjsW+QXFQLbo9h/9UmrCGtnrEqFfkYDwNzfw x08ailG1JedpVozU8O54XldIZf0UmtC6D3nV7unEfwDo9r9QCqcVxe1e7TJiwNIMvmuX ahyfhAAWkcJtqsCXtemnEoD86znNcvvg4+lvtRHoLxxFfdZYctuMQsoCNBDsV+dU0RV/ kTtl7vi8X/kolrHjmzU7wsmEYV3N6Qp7wyvR8+S5DQbPXpJ+LCyxBUApL2rV4cmcP9mV Vohw== 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=A9Hl4dJshFqjgMggFaNdgMBt/0ixPJvraz6Coa99aVE=; b=mZDz08e7qBZTIbDpDZCOCVBsKHyulRCw4Ka+hJ6ybEg68+3KmrCaNiPyV/QClzvqOL Qpfy1OW7jPb3cCeo6142dlXYPNtt3NllhpyvyoUR3JgqkCLk1SbIL04VgVUtQeMw+pfX yF1wpFWOBDdJHRMgEIZ/RbSr12Wdi92+wRPV8S2wF92NQnP8GzPeM85cjWzTC90BpOis w46753hNAm2cJSF0LYQYl0FO5hZWYeIN2jZ6biDs/4V3/iwMO3fusHFop4Vo3A2sGOcu nsJKbP7GJIqtM2TJz+tvxHVQ6nnyr8UkMske6ihpahG3bGHW8A6CT6/Kzh3o09lH7G6u 8+mg== 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 b76si4718935iob.116.2017.10.27.01.05.42; Fri, 27 Oct 2017 01:05: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 6776C6295D; Fri, 27 Oct 2017 08:05: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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 3AEA362961; Fri, 27 Oct 2017 08:01:36 +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 1DC2A608BD; Fri, 27 Oct 2017 08:00:57 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id 7D458608BE for ; Fri, 27 Oct 2017 08:00:53 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward104o.mail.yandex.net (Yandex) with ESMTP id DB5C870691B for ; Fri, 27 Oct 2017 11:00:51 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mGl8dPn1fP-0pHGnohJ; Fri, 27 Oct 2017 11:00:51 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0pJKV2aO; Fri, 27 Oct 2017 11:00:51 +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: Fri, 27 Oct 2017 11:00:11 +0300 Message-Id: <1509091212-14398-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> References: <1509091212-14398-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 234 Subject: [lng-odp] [PATCH API-NEXT v4 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: d61d32590d1772b70b8dcd0d0ec44d29029d7443 ** Merge commit sha: 436021e0a0bff8bda38fa420ebbc4545c97a7fc8 **/ test/validation/api/pool/pool.c | 28 ++++++++++++++++++++++++++++ test/validation/api/pool/pool.h | 1 + 2 files changed, 29 insertions(+) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 461715cc9..84c17720d 100644 --- a/test/validation/api/pool/pool.c +++ b/test/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/validation/api/pool/pool.h b/test/validation/api/pool/pool.h index 3f8f5ebce..b284524e4 100644 --- a/test/validation/api/pool/pool.h +++ b/test/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[];