From patchwork Mon Jun 29 12:48:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50409 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EC76218E4 for ; Mon, 29 Jun 2015 12:49:51 +0000 (UTC) Received: by widjy10 with SMTP id jy10sf23061255wid.3 for ; Mon, 29 Jun 2015 05:49:50 -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=yI03djSeiCyJp9bYggxQKpGIsfusySReK9sEajdKVVg=; b=IXzUtIFwUVg/FEgrPKAmDbhEukFcvrizORFBb3B85F3HvssrKU2XgZrdrZcv52+JKZ Pw8sl6rHc2R7VakGdfwALg1KcKKMTPo4+ix9bKp9vPH8+e7Hye1nz2UDssfdILpZus1X V1p0d4NwhOx2dfUcgxhd5pfbDXdWj22uP6NxPLqdqvkZFGKAshrGyz6jbBcH3YnJ6bgv ViQaCBe087H2e7L0Hx+Wh+WeO6ez9WrO1sbSzqOuVignnZE0gRcBN5Oy6Zj/Pi4eMBw6 wo4+6JXJ7B+blUQc9SF24Kk8rrxfWe/tHDzGs2IYY35hbUJt3Ut2KP+SL4ShYMXDmcTm 9IEQ== X-Gm-Message-State: ALoCoQkhx86JEGX+imclAJzrZT/yL/Tx8rhXrS8q0Ew/HxmvUo6ZrUHclKqLx6CajTY2OU3LY1we X-Received: by 10.112.166.137 with SMTP id zg9mr10840230lbb.11.1435582190594; Mon, 29 Jun 2015 05:49:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls755502lac.43.gmail; Mon, 29 Jun 2015 05:49:50 -0700 (PDT) X-Received: by 10.112.204.199 with SMTP id la7mr14027505lbc.114.1435582190441; Mon, 29 Jun 2015 05:49:50 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id k5si34969142lag.54.2015.06.29.05.49.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 05:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagc2 with SMTP id c2so8425998lag.3 for ; Mon, 29 Jun 2015 05:49:50 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr14211881lbb.35.1435582190013; Mon, 29 Jun 2015 05:49:50 -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 hn6csp1683686lbb; Mon, 29 Jun 2015 05:49:49 -0700 (PDT) X-Received: by 10.140.202.65 with SMTP id x62mr19624823qha.102.1435582188739; Mon, 29 Jun 2015 05:49:48 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d2si18981803qcj.11.2015.06.29.05.49.48; Mon, 29 Jun 2015 05:49:48 -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 F088361DE6; Mon, 29 Jun 2015 12:49:47 +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 3471B61DDD; Mon, 29 Jun 2015 12:48:43 +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 2801D61DC5; Mon, 29 Jun 2015 12:48:37 +0000 (UTC) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by lists.linaro.org (Postfix) with ESMTPS id C772F61C89 for ; Mon, 29 Jun 2015 12:48:35 +0000 (UTC) Received: by lagc2 with SMTP id c2so8384872lag.3 for ; Mon, 29 Jun 2015 05:48:34 -0700 (PDT) X-Received: by 10.112.160.165 with SMTP id xl5mr13945587lbb.36.1435582114530; Mon, 29 Jun 2015 05:48:34 -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 w7sm10798397lag.42.2015.06.29.05.48.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Jun 2015 05:48:33 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Mon, 29 Jun 2015 14:48:18 +0200 Message-Id: <1435582101-18831-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435582101-18831-1-git-send-email-christophe.milard@linaro.org> References: <1435582101-18831-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2 2/5] validation: renaming in odp_packet.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.49 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_packet.c | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/test/validation/odp_packet.c b/test/validation/odp_packet.c index a621747..e9a022c 100644 --- a/test/validation/odp_packet.c +++ b/test/validation/odp_packet.c @@ -34,7 +34,7 @@ static struct udata_struct { "abcdefg", }; -static int packet_testsuite_init(void) +static int packet_suite_init(void) { odp_pool_param_t params = { .pkt = { @@ -67,7 +67,7 @@ static int packet_testsuite_init(void) return 0; } -static int packet_testsuite_finalize(void) +static int packet_suite_term(void) { odp_packet_free(test_packet); if (odp_pool_destroy(packet_pool) != 0) @@ -75,7 +75,7 @@ static int packet_testsuite_finalize(void) return 0; } -static void packet_alloc_free(void) +static void packet_test_alloc_free(void) { odp_pool_t pool; odp_packet_t packet; @@ -114,7 +114,7 @@ static void packet_alloc_free(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } -static void packet_alloc_segmented(void) +static void packet_test_alloc_segmented(void) { odp_packet_t pkt; const uint32_t len = ODP_CONFIG_PACKET_BUF_LEN_MAX - @@ -127,7 +127,7 @@ static void packet_alloc_segmented(void) odp_packet_free(pkt); } -static void packet_event_conversion(void) +static void packet_test_event_conversion(void) { odp_packet_t pkt = test_packet; odp_packet_t tmp_pkt; @@ -142,7 +142,7 @@ static void packet_event_conversion(void) /** @todo: Need an API to compare packets */ } -static void packet_basic_metadata(void) +static void packet_test_basic_metadata(void) { odp_packet_t pkt = test_packet; CU_ASSERT(odp_packet_head(pkt) != NULL); @@ -153,7 +153,7 @@ static void packet_basic_metadata(void) CU_ASSERT(odp_packet_input(pkt) == ODP_PKTIO_INVALID); } -static void packet_length(void) +static void packet_test_length(void) { odp_packet_t pkt = test_packet; uint32_t buf_len, headroom, tailroom; @@ -172,13 +172,13 @@ static void packet_length(void) CU_ASSERT(buf_len >= packet_len + headroom + tailroom); } -static void packet_debug(void) +static void packet_test_debug(void) { CU_ASSERT(odp_packet_is_valid(test_packet) == 1); odp_packet_print(test_packet); } -static void packet_context(void) +static void packet_test_context(void) { odp_packet_t pkt = test_packet; char ptr_test_value = 2; @@ -200,7 +200,7 @@ static void packet_context(void) odp_packet_reset(pkt, packet_len); } -static void packet_layer_offsets(void) +static void packet_test_layer_offsets(void) { odp_packet_t pkt = test_packet; uint8_t *l2_addr, *l3_addr, *l4_addr; @@ -274,7 +274,7 @@ static void _verify_headroom_shift(odp_packet_t packet, CU_ASSERT(data == data_orig - shift); } -static void packet_headroom(void) +static void packet_test_headroom(void) { odp_packet_t pkt = test_packet; uint32_t room; @@ -345,7 +345,7 @@ static void _verify_tailroom_shift(odp_packet_t pkt, } } -static void packet_tailroom(void) +static void packet_test_tailroom(void) { odp_packet_t pkt = test_packet; odp_packet_seg_t segment; @@ -372,7 +372,7 @@ static void packet_tailroom(void) _verify_tailroom_shift(pkt, 0); } -static void packet_segments(void) +static void packet_test_segments(void) { int num_segs, seg_index; uint32_t data_len, buf_len; @@ -429,7 +429,7 @@ static void packet_segments(void) CU_ASSERT(seg == ODP_PACKET_SEG_INVALID); } -static void packet_segment_last(void) +static void packet_test_segment_last(void) { odp_packet_t pkt = test_packet; odp_packet_seg_t seg; @@ -449,7 +449,7 @@ do { \ CU_ASSERT(odp_packet_has_##flag(packet) != 0); \ } while (0) -static void packet_in_flags(void) +static void packet_test_in_flags(void) { odp_packet_t pkt = test_packet; @@ -472,7 +472,7 @@ static void packet_in_flags(void) TEST_INFLAG(pkt, icmp); } -static void packet_error_flags(void) +static void packet_test_error_flags(void) { odp_packet_t pkt = test_packet; int err; @@ -494,7 +494,7 @@ struct packet_metadata { uint64_t usr_u64; }; -static void packet_add_rem_data(void) +static void packet_test_add_rem_data(void) { odp_packet_t pkt, new_pkt; uint32_t pkt_len, offset, add_len; @@ -604,7 +604,7 @@ static void _packet_compare_data(odp_packet_t pkt1, odp_packet_t pkt2) } } -static void packet_copy(void) +static void packet_test_copy(void) { odp_packet_t pkt = test_packet; odp_packet_t pkt_copy; @@ -623,7 +623,7 @@ static void packet_copy(void) odp_packet_free(pkt_copy); } -static void packet_copydata(void) +static void packet_test_copydata(void) { odp_packet_t pkt = test_packet; uint32_t pkt_len = odp_packet_len(pkt); @@ -654,7 +654,7 @@ static void packet_copydata(void) free(data_buf); } -static void packet_offset(void) +static void packet_test_offset(void) { odp_packet_t pkt = test_packet; uint32_t seg_len, full_seg_len; @@ -700,33 +700,33 @@ static void packet_offset(void) CU_ASSERT(ptr != NULL); } -static CU_TestInfo packet_tests[] = { - _CU_TEST_INFO(packet_alloc_free), - _CU_TEST_INFO(packet_alloc_segmented), - _CU_TEST_INFO(packet_basic_metadata), - _CU_TEST_INFO(packet_debug), - _CU_TEST_INFO(packet_length), - _CU_TEST_INFO(packet_headroom), - _CU_TEST_INFO(packet_tailroom), - _CU_TEST_INFO(packet_context), - _CU_TEST_INFO(packet_event_conversion), - _CU_TEST_INFO(packet_layer_offsets), - _CU_TEST_INFO(packet_segments), - _CU_TEST_INFO(packet_segment_last), - _CU_TEST_INFO(packet_in_flags), - _CU_TEST_INFO(packet_error_flags), - _CU_TEST_INFO(packet_add_rem_data), - _CU_TEST_INFO(packet_copy), - _CU_TEST_INFO(packet_copydata), - _CU_TEST_INFO(packet_offset), +static CU_TestInfo packet_suite[] = { + _CU_TEST_INFO(packet_test_alloc_free), + _CU_TEST_INFO(packet_test_alloc_segmented), + _CU_TEST_INFO(packet_test_basic_metadata), + _CU_TEST_INFO(packet_test_debug), + _CU_TEST_INFO(packet_test_length), + _CU_TEST_INFO(packet_test_headroom), + _CU_TEST_INFO(packet_test_tailroom), + _CU_TEST_INFO(packet_test_context), + _CU_TEST_INFO(packet_test_event_conversion), + _CU_TEST_INFO(packet_test_layer_offsets), + _CU_TEST_INFO(packet_test_segments), + _CU_TEST_INFO(packet_test_segment_last), + _CU_TEST_INFO(packet_test_in_flags), + _CU_TEST_INFO(packet_test_error_flags), + _CU_TEST_INFO(packet_test_add_rem_data), + _CU_TEST_INFO(packet_test_copy), + _CU_TEST_INFO(packet_test_copydata), + _CU_TEST_INFO(packet_test_offset), CU_TEST_INFO_NULL, }; static CU_SuiteInfo packet_suites[] = { { .pName = "packet tests", - .pTests = packet_tests, - .pInitFunc = packet_testsuite_init, - .pCleanupFunc = packet_testsuite_finalize, + .pTests = packet_suite, + .pInitFunc = packet_suite_init, + .pCleanupFunc = packet_suite_term, }, CU_SUITE_INFO_NULL, };