From patchwork Wed Dec 3 09:22:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41838 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A4F525E66 for ; Wed, 3 Dec 2014 09:23:05 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf9211003lbd.6 for ; Wed, 03 Dec 2014 01:23:04 -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=0nOju/Vkd7QeoxcrQknLoQUDmawuDh2U42XHZbQUa90=; b=hRw9hTHdfn3ORZvXHhKjL3V2qTy7MKXlGCd0SZv7mOEn9Esi8EYirnax9865Lg5EWj +FmP3MZun7ybkOn613Tlcg05KKyYI7r6bIldzQLxV1Z4evwprEwmxwAUAhDX9/PyYQWW F4fsva1f4wqDedFPQJ8qi7mHt6eEFam4z//VUWTR1+4w1ReYEXg1HFM2X+2nxzGRBAt4 VCckbfoTgxsX8oF6oivebyEtcVjG1k67dkSbNrQxeDT0M+RIP1dwoBkKB4zQMbYAupTJ E4Wa9H9naExNCaXmQh69NemAdN2ekow4+qQRo8i2u4M3r8K8zfqbo3SCA5VtUknv/I5k pIsw== X-Gm-Message-State: ALoCoQk/NzV4AIHnAqNV1ZkXHpzzP0M94uHzE4+Di6RO7P5kU64Oox4JjzoloOgVTvzPzxlTAIs3 X-Received: by 10.152.29.226 with SMTP id n2mr1605lah.9.1417598584456; Wed, 03 Dec 2014 01:23:04 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.225 with SMTP id y1ls131238lae.25.gmail; Wed, 03 Dec 2014 01:23:04 -0800 (PST) X-Received: by 10.152.23.201 with SMTP id o9mr3265023laf.75.1417598584306; Wed, 03 Dec 2014 01:23:04 -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 b9si22509562lah.61.2014.12.03.01.23.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:23:04 -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 n15so12027561lbi.16 for ; Wed, 03 Dec 2014 01:23:04 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr3383732lav.40.1417598584180; Wed, 03 Dec 2014 01:23:04 -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 ew9csp633470lbc; Wed, 3 Dec 2014 01:23:03 -0800 (PST) X-Received: by 10.224.75.66 with SMTP id x2mr6218398qaj.21.1417598583006; Wed, 03 Dec 2014 01:23:03 -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 a5si27368071qat.0.2014.12.03.01.23.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:23:02 -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 1Xw69E-0005zB-M0; Wed, 03 Dec 2014 09:23:00 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xw68u-0005ve-Um for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 09:22:41 +0000 Received: by mail-wi0-f181.google.com with SMTP id r20so23678341wiv.2 for ; Wed, 03 Dec 2014 01:22:35 -0800 (PST) X-Received: by 10.195.11.6 with SMTP id ee6mr5569951wjd.95.1417598555523; Wed, 03 Dec 2014 01:22:35 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id mc10sm49901450wic.24.2014.12.03.01.22.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 01:22:34 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 11:22:20 +0200 Message-Id: <1417598541-31897-5-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417598541-31897-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCHv2 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.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: 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 183fb0c..ecb1170 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; }