From patchwork Fri Oct 27 08: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: 117297 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp474676qgn; Fri, 27 Oct 2017 01:02:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TQ+qIzF+KffcvlFTJlceeK20qLuxpz/bINa4jJEuNSu/Il/gb8vU7+1MWztLoGN70oBzki X-Received: by 10.200.9.43 with SMTP id t40mr40534477qth.257.1509091372286; Fri, 27 Oct 2017 01:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509091372; cv=none; d=google.com; s=arc-20160816; b=jTVjltsHkagnuX2OVvcFDYfVvt0W4yPYknhx3zoqM2StfY3ghcpQkg1ZvYAXUQCkZ5 IM+mvY0f6DFBH09GadusCHzRvsslNmWuCq94NMZJKN5Y9ujYpVpVzqy2VPC93py2WEla UlLMHmKBrW/gJB6qULd0ZyB2cTSe4/s9gMw4t77SCGnqIyP/AJ3yJ/oq0TAQ10GHQOYn NkdnTT8Vc/IUSviH5yfDwp9iblL/Vv7DspHlUj4KS8Aia55sk4eUrTzo6MdASvNeyQR6 ZrGRevcACbdnsh25tCGfkWe8TSSJoLIEn0S6i47FaAJGyQIv657TAKuqmZwdnpR0syV+ NpMQ== 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=uje9oVRMEmA5zxGhXidimRIHm8BwZJJS19tcCIyi9TA=; b=pO8AyRMd9l636QcCAoViv021N2KmS6fAY3v1kjGHyNKnih+4CAW0AyTJeiN51/THNs Oyyi90Jpf9G4h1e5I1B9S2gLwmuoMF/XZu8wpid3cWFvlRKfZ7wbfthMNY9NDo/SRFIQ TLFxEHlcaRidffsN+qQyG8rVReKIRxbtt5N4t0YYaL1z7ghwXB6OqI0BG0aZFIwgLfLH 16zQbxwiDUhxsl+UyCRat+WAXRjvmqTMk+n0SH7slSp0WfIeM9I9p9JgBf3SEVcCBZaT pXuCSvqcavdq1hvNQc7TNvVH51ouCnyw7b8nBivinw3Bqk6BkruO1y1+yEsgY26ZuEAo dkPA== 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 b126si3733358qkf.346.2017.10.27.01.02.52; Fri, 27 Oct 2017 01:02:52 -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 0272662972; Fri, 27 Oct 2017 08:02:52 +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 30EC960996; Fri, 27 Oct 2017 08:01:09 +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 E2C98618C8; Fri, 27 Oct 2017 08:00:53 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 5D81E609AC for ; Fri, 27 Oct 2017 08:00:51 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward100p.mail.yandex.net (Yandex) with ESMTP id E6F795104076 for ; Fri, 27 Oct 2017 11:00:49 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UobO3TiZUD-0nJ8G55E; Fri, 27 Oct 2017 11:00:49 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5leQ09wrpf-0nJebYLa; Fri, 27 Oct 2017 11:00:49 +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:08 +0300 Message-Id: <1509091212-14398-5-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 4/8] validation: pool: initialize params correctly 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 Use odp_pool_param_init() to initialize pool parameters. 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 | 87 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index c38a336ce..461715cc9 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -16,11 +16,11 @@ static const int default_buffer_size = 1500; static const int default_buffer_num = 1000; -static void pool_create_destroy(odp_pool_param_t *params) +static void pool_create_destroy(odp_pool_param_t *param) { odp_pool_t pool; - pool = odp_pool_create(NULL, params); + pool = odp_pool_create(NULL, param); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); CU_ASSERT(odp_pool_to_u64(pool) != odp_pool_to_u64(ODP_POOL_INVALID)); @@ -29,42 +29,41 @@ static void pool_create_destroy(odp_pool_param_t *params) void pool_test_create_destroy_buffer(void) { - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER, + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_packet(void) { - odp_pool_param_t params = { - .pkt = { - .seg_len = 0, - .len = default_buffer_size, - .num = default_buffer_num, - }, - .type = ODP_POOL_PACKET, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_PACKET; + param.pkt.len = default_buffer_size; + param.pkt.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_create_destroy_timeout(void) { - odp_pool_param_t params = { - .tmo = { - .num = default_buffer_num, - }, - .type = ODP_POOL_TIMEOUT, - }; - - pool_create_destroy(¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_TIMEOUT; + param.tmo.num = default_buffer_num; + + pool_create_destroy(¶m); } void pool_test_lookup_info_print(void) @@ -72,16 +71,16 @@ void pool_test_lookup_info_print(void) odp_pool_t pool; const char pool_name[] = "pool_for_lookup_test"; odp_pool_info_t info; - odp_pool_param_t params = { - .buf = { - .size = default_buffer_size, - .align = ODP_CACHE_LINE_SIZE, - .num = default_buffer_num, - }, - .type = ODP_POOL_BUFFER, - }; - - pool = odp_pool_create(pool_name, ¶ms); + odp_pool_param_t param; + + odp_pool_param_init(¶m); + + param.type = ODP_POOL_BUFFER; + param.buf.size = default_buffer_size; + param.buf.align = ODP_CACHE_LINE_SIZE; + param.buf.num = default_buffer_num; + + pool = odp_pool_create(pool_name, ¶m); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); pool = odp_pool_lookup(pool_name); @@ -89,10 +88,10 @@ void pool_test_lookup_info_print(void) CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0); CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); - CU_ASSERT(params.buf.size <= info.params.buf.size); - CU_ASSERT(params.buf.align <= info.params.buf.align); - CU_ASSERT(params.buf.num <= info.params.buf.num); - CU_ASSERT(params.type == info.params.type); + CU_ASSERT(param.buf.size <= info.params.buf.size); + CU_ASSERT(param.buf.align <= info.params.buf.align); + CU_ASSERT(param.buf.num <= info.params.buf.num); + CU_ASSERT(param.type == info.params.type); odp_pool_print(pool);