From patchwork Fri Jun 26 11:09:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50340 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E406F228FD for ; Fri, 26 Jun 2015 11:13:34 +0000 (UTC) Received: by lagh6 with SMTP id h6sf26098785lag.0 for ; Fri, 26 Jun 2015 04:13:33 -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=mKQzY9EMvreL8+lY8KEDFCz0vYJkhVM7ggk6Ru5HDU18LJcIv058JbcgN7nWTzH27Z uYW4d0e9+dC+nYh9KmeZ3QpuSar6WlzFHXHE9NOFyjZO0X6X0XoABZKc5Czeh2jKWHr0 M+M9YgXixL+QPJLpAyjlmTrUKt6o7ieRTiShNiixdg7ILTtUZ3AJzYz4jKxS2sff/XZP uNEchCDs+9pcRtJgnbYzc5pfFYuPAGII15NESS0PN36tOXiZfNrTKbvT/fUGe1khAOMh vdLGvaLGCkuqyude01cwuTaEWx5J2jQtggsXgjsfXK3evZVLEBGZPvH30g5mzD1/AvC4 vpcg== X-Gm-Message-State: ALoCoQmy6+ww8uzc5TnLAnEEBf/WVbFvHqnW8BCL7jnzI6xqRu9R0TSkori7IgnjwZigapCgqsTB X-Received: by 10.112.159.138 with SMTP id xc10mr780572lbb.22.1435317213842; Fri, 26 Jun 2015 04:13:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.36 with SMTP id ll4ls468115lac.36.gmail; Fri, 26 Jun 2015 04:13:33 -0700 (PDT) X-Received: by 10.112.137.1 with SMTP id qe1mr1113148lbb.22.1435317213687; Fri, 26 Jun 2015 04:13:33 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id az11si26729569lab.27.2015.06.26.04.13.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 04:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbpo10 with SMTP id po10so62315301lbb.3 for ; Fri, 26 Jun 2015 04:13:33 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1147254lbc.32.1435317213434; Fri, 26 Jun 2015 04:13:33 -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 hn6csp1242266lbb; Fri, 26 Jun 2015 04:13:32 -0700 (PDT) X-Received: by 10.140.98.36 with SMTP id n33mr1306148qge.62.1435317212065; Fri, 26 Jun 2015 04:13:32 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s78si5438695qgs.37.2015.06.26.04.13.31; Fri, 26 Jun 2015 04:13:32 -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 3C40362101; Fri, 26 Jun 2015 11:13:31 +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_H2, 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 6EABF62103; Fri, 26 Jun 2015 11:12:40 +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 F04EB62100; Fri, 26 Jun 2015 11:12:33 +0000 (UTC) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by lists.linaro.org (Postfix) with ESMTPS id 35DDE62104 for ; Fri, 26 Jun 2015 11:09:57 +0000 (UTC) Received: by lbbvz5 with SMTP id vz5so62281278lbb.0 for ; Fri, 26 Jun 2015 04:09:55 -0700 (PDT) X-Received: by 10.152.37.136 with SMTP id y8mr1071945laj.21.1435316995397; Fri, 26 Jun 2015 04:09:55 -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 ja1sm8073835lbc.38.2015.06.26.04.09.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Jun 2015 04:09:54 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Fri, 26 Jun 2015 13:09:38 +0200 Message-Id: <1435316981-22355-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435316981-22355-1-git-send-email-christophe.milard@linaro.org> References: <1435316981-22355-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_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.217.173 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, };