From patchwork Wed Oct 14 23:02:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 54972 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 1657020490 for ; Wed, 14 Oct 2015 23:03:35 +0000 (UTC) Received: by wibzt1 with SMTP id zt1sf1579177wib.0 for ; Wed, 14 Oct 2015 16:03:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=bDKdRoEuZLTLj/IPesmjPJXkD1shhWqNhiYcUaCUQRM=; b=R3u4croBtIAOPQGLY/qPTiOHqRKxmpBzNbxfZKoTtwmc3o4UmdLRWEN/FwWlSfUfYx joDW3VO5Um/RhkcQ1eH2Hz06HycWnMSvqvgWzqYDo6PmcVJinPtSiv4Owh/q3aY4VRP9 t4ONuS7+IJ3mm/UtXAw2q8xvWg7oDw0eHp0URLV9oXVRE1oSiy79WFO/wXbIjvfhhENr lX98HJU3Ha4zJMHJrEMg41YM4gW9fA2t199t04tLjyOyB4vRg7cdnB9LEThXOTpEW6AW JjG6cU18MXPPt5F4vR0ViHbtVQMwXMJpNbrfOtOndbzNBW6rkgrsTKwUERliNprr0EDL gQSw== X-Gm-Message-State: ALoCoQn3UDKcaQmk6nKQi45vHk87gathhIFk6ds7NIyh7Es12++rpqDFoSvAhJXZ2NKGtXQcxU/p X-Received: by 10.180.9.104 with SMTP id y8mr6101209wia.7.1444863814305; Wed, 14 Oct 2015 16:03:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.82.3 with SMTP id g3ls101558lfb.10.gmail; Wed, 14 Oct 2015 16:03:34 -0700 (PDT) X-Received: by 10.25.154.201 with SMTP id c192mr1869173lfe.119.1444863814052; Wed, 14 Oct 2015 16:03:34 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id g127si7109481lfb.151.2015.10.14.16.03.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 16:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbpp2 with SMTP id pp2so27838230lbb.0 for ; Wed, 14 Oct 2015 16:03:33 -0700 (PDT) X-Received: by 10.112.159.136 with SMTP id xc8mr2359709lbb.76.1444863813131; Wed, 14 Oct 2015 16:03:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp272348lbq; Wed, 14 Oct 2015 16:03:32 -0700 (PDT) X-Received: by 10.141.23.210 with SMTP id z201mr7594118qhd.104.1444863812137; Wed, 14 Oct 2015 16:03:32 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id r189si10173873qha.4.2015.10.14.16.03.31; Wed, 14 Oct 2015 16:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id BCEB3619EC; Wed, 14 Oct 2015 23:03:31 +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, 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 D17FA61E6A; Wed, 14 Oct 2015 23:02:32 +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 E9DE661E58; Wed, 14 Oct 2015 23:02:29 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.linaro.org (Postfix) with ESMTPS id C88D061E56 for ; Wed, 14 Oct 2015 23:02:27 +0000 (UTC) Received: by oihr205 with SMTP id r205so36732218oih.3 for ; Wed, 14 Oct 2015 16:02:27 -0700 (PDT) X-Received: by 10.202.204.67 with SMTP id c64mr3565020oig.93.1444863747342; Wed, 14 Oct 2015 16:02:27 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id kw1sm5163305obb.28.2015.10.14.16.02.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Oct 2015 16:02:26 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 14 Oct 2015 18:02:21 -0500 Message-Id: <1444863741-27794-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1444863741-27794-1-git-send-email-bill.fischofer@linaro.org> References: <1444863741-27794-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 2/2] validation: config: add CUnit tests for config APIs X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Bill Fischofer --- configure.ac | 1 + test/validation/Makefile.am | 1 + test/validation/config/.gitignore | 1 + test/validation/config/Makefile.am | 10 ++++++ test/validation/config/config.c | 60 ++++++++++++++++++++++++++++++++++++ test/validation/config/config.h | 28 +++++++++++++++++ test/validation/config/config_main.c | 11 +++++++ 7 files changed, 112 insertions(+) create mode 100644 test/validation/config/.gitignore create mode 100644 test/validation/config/Makefile.am create mode 100644 test/validation/config/config.c create mode 100644 test/validation/config/config.h create mode 100644 test/validation/config/config_main.c diff --git a/configure.ac b/configure.ac index 5d84f92..a7e7413 100644 --- a/configure.ac +++ b/configure.ac @@ -313,6 +313,7 @@ AC_CONFIG_FILES([Makefile test/validation/Makefile test/validation/buffer/Makefile test/validation/classification/Makefile + test/validation/config/Makefile test/validation/cpumask/Makefile test/validation/common/Makefile test/validation/crypto/Makefile diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 56ddd64..4e36494 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -1,5 +1,6 @@ ODP_MODULES = buffer \ classification \ + config \ cpumask \ crypto \ errno \ diff --git a/test/validation/config/.gitignore b/test/validation/config/.gitignore new file mode 100644 index 0000000..dbfed8a --- /dev/null +++ b/test/validation/config/.gitignore @@ -0,0 +1 @@ +config_main \ No newline at end of file diff --git a/test/validation/config/Makefile.am b/test/validation/config/Makefile.am new file mode 100644 index 0000000..084e104 --- /dev/null +++ b/test/validation/config/Makefile.am @@ -0,0 +1,10 @@ +include ../Makefile.inc + +noinst_LTLIBRARIES = libtestconfig.la +libtestconfig_la_SOURCES = config.c + +bin_PROGRAMS = config_main$(EXEEXT) +dist_config_main_SOURCES = config_main.c +config_main_LDADD = libtestconfig.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = config.h diff --git a/test/validation/config/config.c b/test/validation/config/config.c new file mode 100644 index 0000000..a54d51e --- /dev/null +++ b/test/validation/config/config.c @@ -0,0 +1,60 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include "odp_cunit_common.h" +#include "config.h" + +int config_suite_init(void) +{ + return 0; +} + +int config_suite_term(void) +{ + return 0; +} + +void config_test(void) +{ + CU_ASSERT(odp_config_pools() == ODP_CONFIG_POOLS); + CU_ASSERT(odp_config_queues() == ODP_CONFIG_QUEUES); + CU_ASSERT(odp_config_max_ordered_locks_per_queue() == + ODP_CONFIG_MAX_ORDERED_LOCKS_PER_QUEUE); + CU_ASSERT(odp_config_sched_prios() == ODP_CONFIG_SCHED_PRIOS); + CU_ASSERT(odp_config_sched_grps() == ODP_CONFIG_SCHED_GRPS); + CU_ASSERT(odp_config_pktio_entries() == ODP_CONFIG_PKTIO_ENTRIES); + CU_ASSERT(odp_config_buffer_align_min() == ODP_CONFIG_BUFFER_ALIGN_MIN); + CU_ASSERT(odp_config_buffer_align_max() == ODP_CONFIG_BUFFER_ALIGN_MAX); + CU_ASSERT(odp_config_packet_headroom() == ODP_CONFIG_PACKET_HEADROOM); + CU_ASSERT(odp_config_packet_tailroom() == ODP_CONFIG_PACKET_TAILROOM); + CU_ASSERT(odp_config_packet_seg_len_min() == + ODP_CONFIG_PACKET_SEG_LEN_MIN); + CU_ASSERT(odp_config_packet_seg_len_max() == + ODP_CONFIG_PACKET_SEG_LEN_MAX); + CU_ASSERT(odp_config_packet_buf_len_max() == + ODP_CONFIG_PACKET_BUF_LEN_MAX); + CU_ASSERT(odp_config_shm_blocks() == ODP_CONFIG_SHM_BLOCKS); +} + +CU_TestInfo config_suite[] = { + _CU_TEST_INFO(config_test), + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo config_suites[] = { + { .pName = "config tests", + .pTests = config_suite, + .pInitFunc = config_suite_init, + .pCleanupFunc = config_suite_term, + }, + CU_SUITE_INFO_NULL, +}; + +int config_main(void) +{ + return odp_cunit_run(config_suites); +} diff --git a/test/validation/config/config.h b/test/validation/config/config.h new file mode 100644 index 0000000..95c1631 --- /dev/null +++ b/test/validation/config/config.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _ODP_TEST_CONFIG_H_ +#define _ODP_TEST_CONFIG_H_ + +#include + +/* test functions: */ +void config_test(void); + +/* test arrays: */ +extern CU_TestInfo config_suite[]; + +/* test array init/term functions: */ +int config_suite_init(void); +int config_suite_term(void); + +/* test registry: */ +extern CU_SuiteInfo config_suites[]; + +/* main test program: */ +int config_main(void); + +#endif diff --git a/test/validation/config/config_main.c b/test/validation/config/config_main.c new file mode 100644 index 0000000..4e2038f --- /dev/null +++ b/test/validation/config/config_main.c @@ -0,0 +1,11 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#include "config.h" + +int main(void) +{ + return config_main(); +}