From patchwork Mon Dec 1 16:15:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 41797 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D693220672 for ; Mon, 1 Dec 2014 16:17:02 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf6980163eek.1 for ; Mon, 01 Dec 2014 08:17:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state: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=KUreelGsONivIVyq4AVX/ZZVW3OIlhI0zRc8LoQZOHY=; b=mm6rFi+GJgTztm29GGlcPOhFNMxQQyxw7W0vJmi9ZwQ7ILiXZXNDAc83xQhe3Zs3mZ NcbPOWL0uQq1tAldgH/0hHnsSGSUq5tO1yUH/lj0B7j7MpEzxTV7Jqcj+Ph6tRfBw/2V FjdoJMTQoHZl1sNiz1U0SO1LK0TLYu8m4GUDlRI29qHq9hR/xN77UPpNxDEzZJY7ienl jMTPya4OaduL3l6B5EyQbzHHUe3Evp7USIj5lEhycesq+hUZzdpEAJPDZIE1Sevx1y8t S6rJFYOlabr6DbfNs2Tvo5suzzW6RwEsYHu7WbECaKRkNWTMDE3S47AaCegKPTPPe+iz fnkw== X-Gm-Message-State: ALoCoQmuzmpL1LR/GKfmsszHaT2QlA6DkFBtHUcexYzfqCnQwBCquN3jUQXrh7QRQRtcq6lq3hO1 X-Received: by 10.194.178.163 with SMTP id cz3mr15335672wjc.1.1417450622064; Mon, 01 Dec 2014 08:17:02 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.9 with SMTP id w9ls1198220law.1.gmail; Mon, 01 Dec 2014 08:17:01 -0800 (PST) X-Received: by 10.112.17.101 with SMTP id n5mr57566922lbd.83.1417450621806; Mon, 01 Dec 2014 08:17:01 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id m3si18081764laj.77.2014.12.01.08.17.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 08:17:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id n15so8843270lbi.2 for ; Mon, 01 Dec 2014 08:17:01 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr56271718lbr.74.1417450621688; Mon, 01 Dec 2014 08:17:01 -0800 (PST) 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.184.201 with SMTP id ew9csp320068lbc; Mon, 1 Dec 2014 08:17:00 -0800 (PST) X-Received: by 10.140.31.35 with SMTP id e32mr1496608qge.81.1417450619438; Mon, 01 Dec 2014 08:16:59 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m64si21015418qgd.29.2014.12.01.08.16.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 08:16:59 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvTeg-0007Hp-EW; Mon, 01 Dec 2014 16:16:54 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvTe0-0007BP-80 for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 16:16:12 +0000 Received: by mail-lb0-f172.google.com with SMTP id u10so8960529lbd.3 for ; Mon, 01 Dec 2014 08:16:06 -0800 (PST) X-Received: by 10.112.24.130 with SMTP id u2mr57736641lbf.57.1417450566711; Mon, 01 Dec 2014 08:16:06 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id ar4sm4819466lbc.48.2014.12.01.08.16.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 08:16:05 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 19:15:37 +0300 Message-Id: <1417450537-7640-12-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1417450537-7640-1-git-send-email-maxim.uvarov@linaro.org> References: <1417450537-7640-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv4 11/11] cunit: pktio use CU_register_suites X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@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.171 as permitted sender) smtp.mail=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: Maxim Uvarov --- test/validation/odp_pktio.c | 50 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 67dd8d0..cfdf3f8 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -108,14 +108,34 @@ static void test_pktio_promisc(void) return; } +static CU_TestInfo test_mac[] = { + {"mac", test_pktio_mac }, + CU_TEST_INFO_NULL, +}; + +static CU_TestInfo test_mtu[] = { + {"mtu", test_pktio_mtu }, + CU_TEST_INFO_NULL, +}; + +static CU_TestInfo test_promisc[] = { + {"promisc", test_pktio_promisc }, + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo suites[] = { + { "MAC" , NULL, NULL, NULL, NULL, test_mac }, + { "MTU" , NULL, NULL, NULL, NULL, test_mtu }, + { "PROMISC" , NULL, NULL, NULL, NULL, test_promisc }, + CU_SUITE_INFO_NULL, +}; + int main(void) { odp_shm_t shm; void *pool_base; odp_buffer_pool_t pool; odp_queue_t out_queue; - CU_pSuite ptr_suite; - CU_pTest ptest; if (odp_init_global(NULL, NULL)) { printf("ODP global init failed.\n"); @@ -180,30 +200,8 @@ int main(void) if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); - /* add a suite to the registry */ - ptr_suite = CU_add_suite(__FILE__, NULL, NULL); - if (NULL == ptr_suite) { - CU_cleanup_registry(); - return CU_get_error(); - } - - ptest = CU_ADD_TEST(ptr_suite, test_pktio_mtu); - if (NULL == ptest) { - CU_cleanup_registry(); - return CU_get_error(); - } - - ptest = CU_ADD_TEST(ptr_suite, test_pktio_promisc); - if (NULL == ptest) { - CU_cleanup_registry(); - return CU_get_error(); - } - - ptest = CU_ADD_TEST(ptr_suite, test_pktio_mac); - if (NULL == ptest) { - CU_cleanup_registry(); - return CU_get_error(); - } + /* register suites */ + CU_register_suites(suites); /* Run all tests using the CUnit Basic interface */ CU_basic_set_mode(CU_BRM_VERBOSE);