From patchwork Mon Dec 1 17:05:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41801 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 8D7D124001 for ; Mon, 1 Dec 2014 17:06:28 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf7034712eek.5 for ; Mon, 01 Dec 2014 09:06:27 -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=fRwXeKVqgEkQFnC7AYlmp0FTJ/24WLOUBBmhyiMtTwg=; b=U4X+amZpZJCRY5gqbk5TTQNzNhmSSPFt39PL+r+PmQuaL8HVr6PfWzNDZrwmIjfLkZ PPG+Oux7cFUpjsEuojcfS3HYsbnRdRcmYjHJTs3SKYneTnjXvYZzo1/M+C7EeIXuID4k B55xVpqH81sUef7fSnQmhQmcrK7GpQuVrGqS/17RdBBjH+SE2VMAQRNLQFVfDLe2zCC4 udGm52rB11cNjjrO6EqIRIqi0BTUT5sSCj4tOD5fL8orN8v7w765wViv7fQix9uixdyn yxIps/sRhq9KXCLTStGqgcY+7TMfQrQFTQyH/NBaINQssLhUsXxsH181CKXMIdLCMo9E oyOg== X-Gm-Message-State: ALoCoQnJY9XEeXiJq1WXvOrtAHSq48mj2Qz8Q3zBUv3UAYp/3A7CteNtUwLIbZ9HEvknwMkQpmFF X-Received: by 10.112.143.136 with SMTP id se8mr308306lbb.18.1417453587736; Mon, 01 Dec 2014 09:06:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.39 with SMTP id f7ls1112601lab.75.gmail; Mon, 01 Dec 2014 09:06:27 -0800 (PST) X-Received: by 10.152.207.37 with SMTP id lt5mr37678701lac.66.1417453587464; Mon, 01 Dec 2014 09:06:27 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id v7si18166940lal.125.2014.12.01.09.06.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id hv19so4497508lab.0 for ; Mon, 01 Dec 2014 09:06:27 -0800 (PST) X-Received: by 10.112.62.166 with SMTP id z6mr56485273lbr.74.1417453587368; Mon, 01 Dec 2014 09:06:27 -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 ew9csp330522lbc; Mon, 1 Dec 2014 09:06:25 -0800 (PST) X-Received: by 10.236.37.73 with SMTP id x49mr59650426yha.123.1417453585178; Mon, 01 Dec 2014 09:06:25 -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 79si8266859ykt.36.2014.12.01.09.06.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:06:25 -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 1XvUQX-00011b-Rj; Mon, 01 Dec 2014 17:06:21 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvUPz-0000zI-OQ for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 17:05:47 +0000 Received: by mail-la0-f53.google.com with SMTP id gm9so9056322lab.26 for ; Mon, 01 Dec 2014 09:05:42 -0800 (PST) X-Received: by 10.112.17.1 with SMTP id k1mr56701432lbd.39.1417453541896; Mon, 01 Dec 2014 09:05:41 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id kw10sm1228243lac.45.2014.12.01.09.05.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 09:05:41 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 1 Dec 2014 19:05:29 +0200 Message-Id: <1417453530-18743-5-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417453530-18743-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417453530-18743-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCH 4/5] validation: crypto: reuse common main() function 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: taras.kondratiuk@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.215.41 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: Taras Kondratiuk Reviewed-by: Mike Holmes --- test/validation/Makefile.am | 2 +- test/validation/odp_crypto.c | 43 ++++++------------------------------------ 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index 1f5eed4..d8dcb59 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -19,5 +19,5 @@ dist_odp_init_SOURCES = odp_init.c dist_odp_queue_SOURCES = odp_queue.c common/odp_cunit_common.c dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ crypto/odp_crypto_test_sync_inp.c \ - odp_crypto.c + odp_crypto.c common/odp_cunit_common.c dist_odp_shm_SOURCES = odp_shm.c common/odp_cunit_common.c diff --git a/test/validation/odp_crypto.c b/test/validation/odp_crypto.c index 9342aca..ec3f16a 100644 --- a/test/validation/odp_crypto.c +++ b/test/validation/odp_crypto.c @@ -5,8 +5,7 @@ */ #include -#include "CUnit/Basic.h" -#include "CUnit/TestDB.h" +#include "odp_cunit_common.h" #include "odp_crypto_test_async_inp.h" #include "odp_crypto_test_sync_inp.h" @@ -16,32 +15,19 @@ #define SHM_COMPL_POOL_SIZE (128*1024) #define SHM_COMPL_POOL_BUF_SIZE 128 -static int init_suite(void) -{ - printf("\tODP API version: %s\n", odp_version_api_str()); - printf("\tODP implementation version: %s\n", odp_version_impl_str()); - return 0; -} - -CU_SuiteInfo suites[] = { - {ODP_CRYPTO_SYNC_INP, init_suite, NULL, NULL, NULL, test_array_sync }, - {ODP_CRYPTO_ASYNC_INP, init_suite, NULL, NULL, NULL, test_array_async }, +CU_SuiteInfo odp_testsuites[] = { + {ODP_CRYPTO_SYNC_INP, NULL, NULL, NULL, NULL, test_array_sync }, + {ODP_CRYPTO_ASYNC_INP, NULL, NULL, NULL, NULL, test_array_async }, CU_SUITE_INFO_NULL, }; -int main(void) +int tests_global_init(void) { odp_shm_t shm; void *pool_base; odp_buffer_pool_t pool; odp_queue_t out_queue; - if (odp_init_global(NULL, NULL)) { - printf("ODP global init failed.\n"); - return -1; - } - odp_init_local(); - shm = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0); @@ -86,22 +72,5 @@ int main(void) return -1; } - printf("\tODP version: %s\n", odp_version_api_str()); - - - /* initialize the CUnit test registry */ - if (CUE_SUCCESS != CU_initialize_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); - CU_basic_run_tests(); - CU_cleanup_registry(); - - odp_term_local(); - odp_term_global(); - - return CU_get_error(); + return 0; }