From patchwork Wed Jun 17 21:51:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 49993 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 E1175228FF for ; Wed, 17 Jun 2015 21:54:03 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf15750564lbb.0 for ; Wed, 17 Jun 2015 14:54:02 -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:cc: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=m3kyvWT73kl5sTUVSfTMCHkltGB1WB9ydGCizHZrvsQ=; b=CsD7rrvMTWRmzAOmXX5ct2PgzcMiH4TV27CBUYXwLycElOwqsKR3YuRAqFig7Nn5sQ A2yjDMYOGwBvQMJfTejMAhSfxqjAJx3U6iCvfq0ZzUCEys4t9QXDVxXb+MFbaT21CRQm nlBxUqb1mEO+7Vmi1VUVFmqgaGIgBmPWwyEfGhDVUwntbJ1cpfmgUnx1fp2Ukr2CqC+/ swiihp6nD77nmKo8nJja9/cj9vaerfJubifkL/LVK8aKDNGr8LDsHlgg3Wslsl7Qk37G fB0N241d2ZLB3MDv0WPci+GtijVdejGihl8nOLHgOA/2dpYKzCk+I0GAd7UxwxF28Jjr 0fOQ== X-Gm-Message-State: ALoCoQnNzfGdKQymCPLPwM4vS1djLJOLC3ave82O7XTum1zfZuH1vRZGqhBAzyat82q252Ptw/JL X-Received: by 10.112.26.5 with SMTP id h5mr7344453lbg.4.1434578042817; Wed, 17 Jun 2015 14:54:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.245.43 with SMTP id xl11ls380097lac.21.gmail; Wed, 17 Jun 2015 14:54:02 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr9730199lag.67.1434578042496; Wed, 17 Jun 2015 14:54:02 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id cv1si2388031lbb.49.2015.06.17.14.54.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 14:54:02 -0700 (PDT) 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 lbbwc1 with SMTP id wc1so40748415lbb.2 for ; Wed, 17 Jun 2015 14:54:02 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr9820547lak.117.1434578042397; Wed, 17 Jun 2015 14:54:02 -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.108.230 with SMTP id hn6csp752033lbb; Wed, 17 Jun 2015 14:54:01 -0700 (PDT) X-Received: by 10.55.25.145 with SMTP id 17mr17999092qkz.46.1434578041464; Wed, 17 Jun 2015 14:54:01 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q131si5810331qha.53.2015.06.17.14.54.00; Wed, 17 Jun 2015 14:54:01 -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 A4D3061DC8; Wed, 17 Jun 2015 21:54:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5B74F61FA6; Wed, 17 Jun 2015 21:52:34 +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 E9F2861FA3; Wed, 17 Jun 2015 21:52:25 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by lists.linaro.org (Postfix) with ESMTPS id 5FA8F61FA5 for ; Wed, 17 Jun 2015 21:52:10 +0000 (UTC) Received: by lblr1 with SMTP id r1so40704713lbl.0 for ; Wed, 17 Jun 2015 14:52:08 -0700 (PDT) X-Received: by 10.152.3.130 with SMTP id c2mr10027717lac.81.1434577928168; Wed, 17 Jun 2015 14:52:08 -0700 (PDT) Received: from mobile-VirtualBox.caveonetworks.com (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by mx.google.com with ESMTPSA id k10sm1273417lbq.9.2015.06.17.14.52.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Jun 2015 14:52:07 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Wed, 17 Jun 2015 23:51:42 +0200 Message-Id: <1434577905-11797-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434577905-11797-1-git-send-email-christophe.milard@linaro.org> References: <1434577905-11797-1-git-send-email-christophe.milard@linaro.org> X-Topics: crypto patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/5] validation: renaming in odp_crypto.c 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: christophe.milard@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 Renaming of things which may be, one day, exported in a lib. This renaming is important, as it creates consistency between test symbols, which is needed if things get eventually exported in the lib. Also, tests are often created from other tests: Fixing the first exemples will help geting future tests better. Things that are candidate to be exported in the lib in the future have been named as follows: -Tests, i.e. functions which are used in CUNIT testsuites are named: _test_* -Test arrays, i.e. arrays of CU_TestInfo, listing the test functions belonging to a suite, are called: _suite[_*] where the possible suffix can be used if many suites are declared. -CUNIT suite init and termination functions are called: _suite[_*]_init() and _suite[_*]_term() respectively. -Suite arrays, i.e. arrays of CU_SuiteInfo used in executables are called: _suites[_*] where the possible suffix identifies the executable using it, if many. -Main function(s), are called: _main[_*] where the possible suffix identifies the executable using it Signed-off-by: Christophe Milard --- test/validation/crypto/odp_crypto_test_inp.c | 28 +++++++++++++++------------- test/validation/crypto/odp_crypto_test_inp.h | 6 +++--- test/validation/odp_crypto.c | 8 ++++---- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/test/validation/crypto/odp_crypto_test_inp.c b/test/validation/crypto/odp_crypto_test_inp.c index 5f688d6..c1c08af 100644 --- a/test/validation/crypto/odp_crypto_test_inp.c +++ b/test/validation/crypto/odp_crypto_test_inp.c @@ -132,7 +132,7 @@ cleanup: * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer.*/ #define ASYNC_INP_ENC_ALG_3DES_CBC "ENC_ALG_3DES_CBC" -static void enc_alg_3des_cbc(void) +static void crypto_test_enc_alg_3des_cbc(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, auth_key = { .data = NULL, .length = 0 }; @@ -165,7 +165,7 @@ static void enc_alg_3des_cbc(void) * operation for 3DES_CBC algorithm. IV for the operation is the operation IV. * */ #define ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV "ENC_ALG_3DES_CBC_OVR_IV" -static void enc_alg_3des_cbc_ovr_iv(void) +static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, auth_key = { .data = NULL, .length = 0 }; @@ -199,7 +199,7 @@ static void enc_alg_3des_cbc_ovr_iv(void) * packet buffer as completion event buffer. * */ #define ASYNC_INP_DEC_ALG_3DES_CBC "DEC_ALG_3DES_CBC" -static void dec_alg_3des_cbc(void) +static void crypto_test_dec_alg_3des_cbc(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, auth_key = { .data = NULL, .length = 0 }; @@ -234,7 +234,7 @@ static void dec_alg_3des_cbc(void) * packet buffer as completion event buffer. * */ #define ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV "DEC_ALG_3DES_CBC_OVR_IV" -static void dec_alg_3des_cbc_ovr_iv(void) +static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, auth_key = { .data = NULL, .length = 0 }; @@ -270,7 +270,7 @@ static void dec_alg_3des_cbc_ovr_iv(void) * packet buffer as completion event buffer. * */ #define ASYNC_INP_ALG_HMAC_MD5 "ALG_HMAC_MD5" -static void alg_hmac_md5(void) +static void crypto_test_alg_hmac_md5(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, auth_key = { .data = NULL, .length = 0 }; @@ -298,7 +298,7 @@ static void alg_hmac_md5(void) } } -int suite_sync_inp_init(void) +int crypto_suite_sync_init(void) { suite_context.pool = odp_pool_lookup("packet_pool"); if (suite_context.pool == ODP_POOL_INVALID) @@ -309,7 +309,7 @@ int suite_sync_inp_init(void) return 0; } -int suite_async_inp_init(void) +int crypto_suite_async_init(void) { suite_context.pool = odp_pool_lookup("packet_pool"); if (suite_context.pool == ODP_POOL_INVALID) @@ -322,11 +322,13 @@ int suite_async_inp_init(void) return 0; } -CU_TestInfo test_array_inp[] = { - {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc }, - {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc }, - {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv }, - {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv }, - {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 }, +CU_TestInfo crypto_suite[] = { + {ASYNC_INP_ENC_ALG_3DES_CBC, crypto_test_enc_alg_3des_cbc }, + {ASYNC_INP_DEC_ALG_3DES_CBC, crypto_test_dec_alg_3des_cbc }, + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, + crypto_test_enc_alg_3des_cbc_ovr_iv }, + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, + crypto_test_dec_alg_3des_cbc_ovr_iv }, + {ASYNC_INP_ALG_HMAC_MD5, crypto_test_alg_hmac_md5 }, CU_TEST_INFO_NULL, }; diff --git a/test/validation/crypto/odp_crypto_test_inp.h b/test/validation/crypto/odp_crypto_test_inp.h index a3a5d8d..d46994f 100644 --- a/test/validation/crypto/odp_crypto_test_inp.h +++ b/test/validation/crypto/odp_crypto_test_inp.h @@ -13,9 +13,9 @@ #define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" /* Suite test array */ -extern CU_TestInfo test_array_inp[]; +extern CU_TestInfo crypto_suite[]; -int suite_sync_inp_init(void); -int suite_async_inp_init(void); +int crypto_suite_sync_init(void); +int crypto_suite_async_init(void); #endif diff --git a/test/validation/odp_crypto.c b/test/validation/odp_crypto.c index ef0abbc..3393909 100644 --- a/test/validation/odp_crypto.c +++ b/test/validation/odp_crypto.c @@ -15,10 +15,10 @@ #define SHM_COMPL_POOL_BUF_SIZE 128 static CU_SuiteInfo crypto_suites[] = { - {ODP_CRYPTO_SYNC_INP, suite_sync_inp_init, NULL, NULL, NULL, - test_array_inp}, - {ODP_CRYPTO_ASYNC_INP, suite_async_inp_init, NULL, NULL, NULL, - test_array_inp}, + {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, NULL, NULL, NULL, + crypto_suite}, + {ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, NULL, NULL, NULL, + crypto_suite}, CU_SUITE_INFO_NULL, };