From patchwork Wed Jul 1 16:17:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50524 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0CB55229DF for ; Wed, 1 Jul 2015 16:18:47 +0000 (UTC) Received: by wiar9 with SMTP id r9sf17152001wia.1 for ; Wed, 01 Jul 2015 09:18:46 -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=FSBbbF0zCBI/73+3/wrEKfZOlLSG5GcpzLhlKFfswDI=; b=ltfGuu0ktP5HO6e1ESltvOGnWC1R7v0/cW2k4KN1ILUBOohK8clnFP087Kq8r6UHN+ UhcCP2hgIOVSdk2pCuxjbxxBcUjHSL039y2s6agBGdIL+WITVrjyOUG4sA+nN5yHpFlc QVPq81S+lfN8Nu2YuTl6/Yp40+G471voShyJM7OyNKRwXQm3XPA7ASuU8bjh38QiEH9C vvk7ZSn0/VWWJc8gwKuxFd15nCiR5zbLMCVIyC6UJvysEh4+l1eVaaBJfwan1Wz434BU iq0mz4BZAMrwMx0waXd69HcQh//WcMVp44IA2k7P2y0Zn7dN3ncCKduwFlOWx04g2ZOU DAcQ== X-Gm-Message-State: ALoCoQnAB8Jo+uwirL1zmce9/exrxSF7k0FTvDiXquCGmwLtBiHzHwEgjndRvUfdrF2fpXrqnS0C X-Received: by 10.112.200.163 with SMTP id jt3mr17517915lbc.17.1435767526307; Wed, 01 Jul 2015 09:18:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.38 with SMTP id lt6ls229236lac.50.gmail; Wed, 01 Jul 2015 09:18:46 -0700 (PDT) X-Received: by 10.112.185.100 with SMTP id fb4mr26297782lbc.79.1435767526150; Wed, 01 Jul 2015 09:18:46 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id z11si2103716lbn.83.2015.07.01.09.18.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 09:18:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagc2 with SMTP id c2so44151629lag.3 for ; Wed, 01 Jul 2015 09:18:46 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr26713066laf.32.1435767526002; Wed, 01 Jul 2015 09:18:46 -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 hn6csp714452lbb; Wed, 1 Jul 2015 09:18:44 -0700 (PDT) X-Received: by 10.140.43.100 with SMTP id d91mr35377638qga.77.1435767524505; Wed, 01 Jul 2015 09:18:44 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f60si2771089qgf.106.2015.07.01.09.18.43; Wed, 01 Jul 2015 09:18:44 -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 B79F961F38; Wed, 1 Jul 2015 16:18:43 +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 5A0F661F2C; Wed, 1 Jul 2015 16:17:46 +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 8F29661F3B; Wed, 1 Jul 2015 16:17:41 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 5DA8A61F22 for ; Wed, 1 Jul 2015 16:17:34 +0000 (UTC) Received: by lagx9 with SMTP id x9so44092807lag.1 for ; Wed, 01 Jul 2015 09:17:33 -0700 (PDT) X-Received: by 10.152.121.99 with SMTP id lj3mr25474031lab.37.1435767453326; Wed, 01 Jul 2015 09:17:33 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by mx.google.com with ESMTPSA id o8sm627324laf.7.2015.07.01.09.17.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jul 2015 09:17:32 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Wed, 1 Jul 2015 18:17:05 +0200 Message-Id: <1435767428-22409-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435767428-22409-1-git-send-email-christophe.milard@linaro.org> References: <1435767428-22409-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/5] validation: renaming in odp_synchronizers.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.215.51 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/odp_synchronizers.c | 84 ++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/test/validation/odp_synchronizers.c b/test/validation/odp_synchronizers.c index aa3acfa..0e8c846 100644 --- a/test/validation/odp_synchronizers.c +++ b/test/validation/odp_synchronizers.c @@ -914,7 +914,7 @@ static void test_atomic_validate(void) } /* Barrier tests */ -static void test_no_barrier_functional(void) +static void synchronizers_test_no_barrier_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -924,7 +924,7 @@ static void test_no_barrier_functional(void) odp_cunit_thread_exit(&arg); } -static void test_barrier_functional(void) +static void synchronizers_test_barrier_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -934,14 +934,14 @@ static void test_barrier_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo test_odp_barrier[] = { - {"no_barrier_functional", test_no_barrier_functional}, - {"barrier_functional", test_barrier_functional}, +static CU_TestInfo synchronizers_suite_barrier[] = { + {"no_barrier_functional", synchronizers_test_no_barrier_functional}, + {"barrier_functional", synchronizers_test_barrier_functional}, CU_TEST_INFO_NULL }; /* Thread-unsafe tests */ -static void test_no_lock_functional(void) +static void synchronizers_test_no_lock_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -950,13 +950,13 @@ static void test_no_lock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo test_no_locking[] = { - {"no_lock_functional", test_no_lock_functional}, +static CU_TestInfo synchronizers_suite_no_locking[] = { + {"no_lock_functional", synchronizers_test_no_lock_functional}, CU_TEST_INFO_NULL }; /* Spin lock tests */ -static void test_spinlock_api(void) +static void synchronizers_test_spinlock_api(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -965,7 +965,7 @@ static void test_spinlock_api(void) odp_cunit_thread_exit(&arg); } -static void test_spinlock_functional(void) +static void synchronizers_test_spinlock_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -975,14 +975,14 @@ static void test_spinlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo test_odp_spinlock[] = { - {"spinlock_api", test_spinlock_api}, - {"spinlock_functional", test_spinlock_functional}, +static CU_TestInfo synchronizers_suite_spinlock[] = { + {"spinlock_api", synchronizers_test_spinlock_api}, + {"spinlock_functional", synchronizers_test_spinlock_functional}, CU_TEST_INFO_NULL }; /* Ticket lock tests */ -static void test_ticketlock_api(void) +static void synchronizers_test_ticketlock_api(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -991,7 +991,7 @@ static void test_ticketlock_api(void) odp_cunit_thread_exit(&arg); } -static void test_ticketlock_functional(void) +static void synchronizers_test_ticketlock_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -1001,14 +1001,14 @@ static void test_ticketlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo test_odp_ticketlock[] = { - {"ticketlock_api", test_ticketlock_api}, - {"ticketlock_functional", test_ticketlock_functional}, +static CU_TestInfo synchronizers_suite_ticketlock[] = { + {"ticketlock_api", synchronizers_test_ticketlock_api}, + {"ticketlock_functional", synchronizers_test_ticketlock_functional}, CU_TEST_INFO_NULL }; /* RW lock tests */ -static void test_rwlock_api(void) +static void synchronizers_test_rwlock_api(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -1017,7 +1017,7 @@ static void test_rwlock_api(void) odp_cunit_thread_exit(&arg); } -static void test_rwlock_functional(void) +static void synchronizers_test_rwlock_functional(void) { pthrd_arg arg; arg.numthrds = global_mem->g_num_threads; @@ -1027,14 +1027,14 @@ static void test_rwlock_functional(void) odp_cunit_thread_exit(&arg); } -static CU_TestInfo test_odp_rwlock[] = { - {"rwlock_api", test_rwlock_api}, - {"rwlock_functional", test_rwlock_functional}, +static CU_TestInfo synchronizers_suite_rwlock[] = { + {"rwlock_api", synchronizers_test_rwlock_api}, + {"rwlock_functional", synchronizers_test_rwlock_functional}, CU_TEST_INFO_NULL }; -static int init_locks(void) +static int synchronizers_suite_init(void) { uint32_t num_threads, idx; @@ -1156,41 +1156,47 @@ static void test_atomic_functional(void *func_ptr(void *)) test_atomic_validate(); } -static void test_atomic_inc_dec(void) +static void synchronizers_test_atomic_inc_dec(void) { test_atomic_functional(test_atomic_inc_dec_thread); } -static void test_atomic_add_sub(void) +static void synchronizers_test_atomic_add_sub(void) { test_atomic_functional(test_atomic_add_sub_thread); } -static void test_atomic_fetch_inc_dec(void) +static void synchronizers_test_atomic_fetch_inc_dec(void) { test_atomic_functional(test_atomic_fetch_inc_dec_thread); } -static void test_atomic_fetch_add_sub(void) +static void synchronizers_test_atomic_fetch_add_sub(void) { test_atomic_functional(test_atomic_fetch_add_sub_thread); } -static CU_TestInfo test_odp_atomic[] = { - {"atomic_inc_dec", test_atomic_inc_dec}, - {"atomic_add_sub", test_atomic_add_sub}, - {"atomic_fetch_inc_dec", test_atomic_fetch_inc_dec}, - {"atomic_fetch_add_sub", test_atomic_fetch_add_sub}, +static CU_TestInfo synchronizers_suite_atomic[] = { + {"atomic_inc_dec", synchronizers_test_atomic_inc_dec}, + {"atomic_add_sub", synchronizers_test_atomic_add_sub}, + {"atomic_fetch_inc_dec", synchronizers_test_atomic_fetch_inc_dec}, + {"atomic_fetch_add_sub", synchronizers_test_atomic_fetch_add_sub}, CU_TEST_INFO_NULL, }; static CU_SuiteInfo synchronizers_suites[] = { - {"barrier", NULL, NULL, NULL, NULL, test_odp_barrier}, - {"nolocking", init_locks, NULL, NULL, NULL, test_no_locking}, - {"spinlock", init_locks, NULL, NULL, NULL, test_odp_spinlock}, - {"ticketlock", init_locks, NULL, NULL, NULL, test_odp_ticketlock}, - {"rwlock", init_locks, NULL, NULL, NULL, test_odp_rwlock}, - {"atomic", NULL, NULL, NULL, NULL, test_odp_atomic}, + {"barrier", NULL, + NULL, NULL, NULL, synchronizers_suite_barrier}, + {"nolocking", synchronizers_suite_init, + NULL, NULL, NULL, synchronizers_suite_no_locking}, + {"spinlock", synchronizers_suite_init, + NULL, NULL, NULL, synchronizers_suite_spinlock}, + {"ticketlock", synchronizers_suite_init, + NULL, NULL, NULL, synchronizers_suite_ticketlock}, + {"rwlock", synchronizers_suite_init, + NULL, NULL, NULL, synchronizers_suite_rwlock}, + {"atomic", NULL, NULL, NULL, NULL, + synchronizers_suite_atomic}, CU_SUITE_INFO_NULL };