From patchwork Fri Nov 28 16:05:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 41702 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2FB7E244C2 for ; Fri, 28 Nov 2014 16:06:24 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf4531943wiw.4 for ; Fri, 28 Nov 2014 08:06:23 -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=E01O7CR8msHgfG7lWMv/Kn1yFfNwDwDAnlPhcGGLwr+tVMePBsJkEMUXprehYMsd9W HCqzAP/So6ktH/xqaQaFbAASnXPqwq1zIdmgnDN3t3a1hKwrbDNr2zE+hMdPiMDUlIci aL117LjVSqj8s46R+IZCt20PBPXk5I8WOCO+Y617rdA24mZUX1zxsdPlqpIDi7HJmeS3 iizCjQ7nFWu73mKgUp2vcHUbOkUVxZLXk3EDpIuoAjoRzuV7nDWYbETxGdjJZ73mGm7a JH6rhPQP0ZcHVhT2l3zIGYal1S++RIXfSxF4NCBezXvNy31Lx7eWrpgIyRF+i93I0uHh nf8g== X-Gm-Message-State: ALoCoQnIMs2mR3uwb7RGBbj+/RbT1X3Y2KllMtjILwlwbIjEhSUwJtFdDB4ZCqOZMEh/etwDGJmY X-Received: by 10.112.159.199 with SMTP id xe7mr299933lbb.21.1417190783502; Fri, 28 Nov 2014 08:06:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.67 with SMTP id o3ls882468laj.86.gmail; Fri, 28 Nov 2014 08:06:22 -0800 (PST) X-Received: by 10.152.28.193 with SMTP id d1mr44318839lah.17.1417190782686; Fri, 28 Nov 2014 08:06:22 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id z6si10358495lbb.89.2014.11.28.08.06.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so5668754lbv.7 for ; Fri, 28 Nov 2014 08:06:22 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr44336657lbb.80.1417190782596; Fri, 28 Nov 2014 08:06:22 -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 ew9csp115820lbc; Fri, 28 Nov 2014 08:06:21 -0800 (PST) X-Received: by 10.170.55.138 with SMTP id 132mr50425632ykx.77.1417190781109; Fri, 28 Nov 2014 08:06:21 -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 y1si945928qcb.1.2014.11.28.08.06.20 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:06:21 -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 1XuO3n-0002Xy-C6; Fri, 28 Nov 2014 16:06:19 +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 1XuO3R-0002UH-Ki for lng-odp@lists.linaro.org; Fri, 28 Nov 2014 16:05:57 +0000 Received: by mail-wi0-f181.google.com with SMTP id r20so11671645wiv.14 for ; Fri, 28 Nov 2014 08:05:52 -0800 (PST) X-Received: by 10.180.109.45 with SMTP id hp13mr61093276wib.4.1417190752214; Fri, 28 Nov 2014 08:05:52 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id r10sm16438043wiy.19.2014.11.28.08.05.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 08:05:51 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Fri, 28 Nov 2014 18:05:39 +0200 Message-Id: <1417190740-1212-5-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1417190740-1212-1-git-send-email-taras.kondratiuk@linaro.org> References: <1417190740-1212-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto Subject: [lng-odp] [RFC 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.176 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 --- 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; }