From patchwork Fri Jul 10 00:44:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 51000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C651228E5 for ; Fri, 10 Jul 2015 00:51:53 +0000 (UTC) Received: by lagx9 with SMTP id x9sf78708074lag.2 for ; Thu, 09 Jul 2015 17:51:52 -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=qFyV4/eg5WxVtvneD6tYvDNXFRFwng5RpkNQzYLqR2E=; b=mkCd5P2mjq1e00OIMMbUe8JEjiAUPH/OG/xCAD9XneVv+z3unB8CDma5G8LkvrnKdd oSEgZCDb9M+kwukOpjlZj/Qd7rgeZP9biwFGBtfTLYnDRKG1ltj/5PaaRfKaUWzidlOx ITFWYXFtEkFX0Gn9Tb6KKce6VItiE+lXIbFMXjhnk/rnMbRAJuV4uFPZcddqyWdK+TVA ntN/s/FMM4rlv29LUJjfO6jPWIkZRuWOmrt3wBIO28HixgjlVo/DOfTnYFLh6L8t2bwb oh/54pGXyzm2IuUh+qtHKVCZXZEQxgKbFDLMPEo0piAIrmaOMScnuFVoofFM0YzKvRf2 wOuQ== X-Gm-Message-State: ALoCoQk9WS/tREv27gwW/+6Q1p7rWC3ymdqEnao+VfUTk7RkaexIbXcpKHdgNErDnKyaUF1ZaJHq X-Received: by 10.181.13.202 with SMTP id fa10mr350075wid.4.1436489512130; Thu, 09 Jul 2015 17:51:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.168 with SMTP id kz8ls973926lac.105.gmail; Thu, 09 Jul 2015 17:51:51 -0700 (PDT) X-Received: by 10.112.61.132 with SMTP id p4mr17228222lbr.48.1436489511955; Thu, 09 Jul 2015 17:51:51 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id eu8si6170483lbc.171.2015.07.09.17.51.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 17:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by lagc2 with SMTP id c2so253254463lag.3 for ; Thu, 09 Jul 2015 17:51:51 -0700 (PDT) X-Received: by 10.112.128.169 with SMTP id np9mr17378124lbb.73.1436489511526; Thu, 09 Jul 2015 17:51:51 -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 hn6csp1012777lbb; Thu, 9 Jul 2015 17:51:50 -0700 (PDT) X-Received: by 10.140.151.200 with SMTP id 191mr30356089qhx.95.1436489509038; Thu, 09 Jul 2015 17:51:49 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 69si7483343qkp.5.2015.07.09.17.51.48; Thu, 09 Jul 2015 17:51: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 19DC762072; Fri, 10 Jul 2015 00:51:48 +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 720626207D; Fri, 10 Jul 2015 00:46:49 +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 D3B6D6207B; Fri, 10 Jul 2015 00:46:32 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id 19A6762082 for ; Fri, 10 Jul 2015 00:44:50 +0000 (UTC) Received: by lagx9 with SMTP id x9so256015926lag.1 for ; Thu, 09 Jul 2015 17:44:48 -0700 (PDT) X-Received: by 10.112.138.199 with SMTP id qs7mr17285832lbb.21.1436489088748; Thu, 09 Jul 2015 17:44:48 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id o18sm1936473lbg.1.2015.07.09.17.44.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 17:44:48 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Fri, 10 Jul 2015 02:44:19 +0200 Message-Id: <1436489068-8929-9-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436489068-8929-1-git-send-email-christophe.milard@linaro.org> References: <1436489068-8929-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 08/17] validation: packet: lib populated 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.46 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 test symbols are now exported in the module lib. Signed-off-by: Christophe Milard --- test/validation/packet/packet.c | 44 ++++++++++++++++++++--------------------- test/validation/packet/packet.h | 33 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 0bd1666..2d2209a 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -39,7 +39,7 @@ static struct udata_struct { "abcdefg", }; -static int packet_suite_init(void) +int packet_suite_init(void) { odp_pool_param_t params = { .pkt = { @@ -81,7 +81,7 @@ static int packet_suite_init(void) return 0; } -static int packet_suite_term(void) +int packet_suite_term(void) { odp_packet_free(test_packet); odp_packet_free(segmented_test_packet); @@ -90,7 +90,7 @@ static int packet_suite_term(void) return 0; } -static void packet_test_alloc_free(void) +void packet_test_alloc_free(void) { odp_pool_t pool; odp_packet_t packet; @@ -129,7 +129,7 @@ static void packet_test_alloc_free(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } -static void packet_test_alloc_segmented(void) +void packet_test_alloc_segmented(void) { odp_packet_t pkt; const uint32_t len = ODP_CONFIG_PACKET_BUF_LEN_MAX - @@ -142,7 +142,7 @@ static void packet_test_alloc_segmented(void) odp_packet_free(pkt); } -static void packet_test_event_conversion(void) +void packet_test_event_conversion(void) { odp_packet_t pkt = test_packet; odp_packet_t tmp_pkt; @@ -157,7 +157,7 @@ static void packet_test_event_conversion(void) /** @todo: Need an API to compare packets */ } -static void packet_test_basic_metadata(void) +void packet_test_basic_metadata(void) { odp_packet_t pkt = test_packet; @@ -169,7 +169,7 @@ static void packet_test_basic_metadata(void) CU_ASSERT(odp_packet_input(pkt) == ODP_PKTIO_INVALID); } -static void packet_test_length(void) +void packet_test_length(void) { odp_packet_t pkt = test_packet; uint32_t buf_len, headroom, tailroom; @@ -188,13 +188,13 @@ static void packet_test_length(void) CU_ASSERT(buf_len >= packet_len + headroom + tailroom); } -static void packet_test_debug(void) +void packet_test_debug(void) { CU_ASSERT(odp_packet_is_valid(test_packet) == 1); odp_packet_print(test_packet); } -static void packet_test_context(void) +void packet_test_context(void) { odp_packet_t pkt = test_packet; char ptr_test_value = 2; @@ -216,7 +216,7 @@ static void packet_test_context(void) odp_packet_reset(pkt, packet_len); } -static void packet_test_layer_offsets(void) +void packet_test_layer_offsets(void) { odp_packet_t pkt = test_packet; uint8_t *l2_addr, *l3_addr, *l4_addr; @@ -290,7 +290,7 @@ static void _verify_headroom_shift(odp_packet_t packet, CU_ASSERT(data == data_orig - shift); } -static void packet_test_headroom(void) +void packet_test_headroom(void) { odp_packet_t pkt = test_packet; uint32_t room; @@ -362,7 +362,7 @@ static void _verify_tailroom_shift(odp_packet_t pkt, } } -static void packet_test_tailroom(void) +void packet_test_tailroom(void) { odp_packet_t pkt = test_packet; odp_packet_seg_t segment; @@ -389,7 +389,7 @@ static void packet_test_tailroom(void) _verify_tailroom_shift(pkt, 0); } -static void packet_test_segments(void) +void packet_test_segments(void) { int num_segs, seg_index; uint32_t data_len, buf_len; @@ -489,7 +489,7 @@ static void packet_test_segments(void) CU_ASSERT(seg == ODP_PACKET_SEG_INVALID); } -static void packet_test_segment_last(void) +void packet_test_segment_last(void) { odp_packet_t pkt = test_packet; odp_packet_seg_t seg; @@ -509,7 +509,7 @@ do { \ CU_ASSERT(odp_packet_has_##flag(packet) != 0); \ } while (0) -static void packet_test_in_flags(void) +void packet_test_in_flags(void) { odp_packet_t pkt = test_packet; @@ -532,7 +532,7 @@ static void packet_test_in_flags(void) TEST_INFLAG(pkt, icmp); } -static void packet_test_error_flags(void) +void packet_test_error_flags(void) { odp_packet_t pkt = test_packet; int err; @@ -554,7 +554,7 @@ struct packet_metadata { uint64_t usr_u64; }; -static void packet_test_add_rem_data(void) +void packet_test_add_rem_data(void) { odp_packet_t pkt, new_pkt; uint32_t pkt_len, offset, add_len; @@ -663,7 +663,7 @@ static void _packet_compare_data(odp_packet_t pkt1, odp_packet_t pkt2) } } -static void packet_test_copy(void) +void packet_test_copy(void) { odp_packet_t pkt = test_packet; odp_packet_t pkt_copy; @@ -682,7 +682,7 @@ static void packet_test_copy(void) odp_packet_free(pkt_copy); } -static void packet_test_copydata(void) +void packet_test_copydata(void) { odp_packet_t pkt = test_packet; uint32_t pkt_len = odp_packet_len(pkt); @@ -713,7 +713,7 @@ static void packet_test_copydata(void) free(data_buf); } -static void packet_test_offset(void) +void packet_test_offset(void) { odp_packet_t pkt = test_packet; uint32_t seg_len, full_seg_len; @@ -759,7 +759,7 @@ static void packet_test_offset(void) CU_ASSERT_PTR_NOT_NULL(ptr); } -static CU_TestInfo packet_suite[] = { +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), @@ -781,7 +781,7 @@ static CU_TestInfo packet_suite[] = { CU_TEST_INFO_NULL, }; -static CU_SuiteInfo packet_suites[] = { +CU_SuiteInfo packet_suites[] = { { .pName = "packet tests", .pTests = packet_suite, .pInitFunc = packet_suite_init, diff --git a/test/validation/packet/packet.h b/test/validation/packet/packet.h index 421bc25..10d73f5 100644 --- a/test/validation/packet/packet.h +++ b/test/validation/packet/packet.h @@ -4,4 +4,37 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include + +/* test functions: */ +void packet_test_alloc_free(void); +void packet_test_alloc_segmented(void); +void packet_test_event_conversion(void); +void packet_test_basic_metadata(void); +void packet_test_length(void); +void packet_test_debug(void); +void packet_test_context(void); +void packet_test_layer_offsets(void); +void packet_test_headroom(void); +void packet_test_tailroom(void); +void packet_test_segments(void); +void packet_test_segment_last(void); +void packet_test_in_flags(void); +void packet_test_error_flags(void); +void packet_test_add_rem_data(void); +void packet_test_copy(void); +void packet_test_copydata(void); +void packet_test_offset(void); + +/* test arrays: */ +extern CU_TestInfo packet_suite[]; + +/* test array init/term functions: */ +int packet_suite_init(void); +int packet_suite_term(void); + +/* test registery: */ +extern CU_SuiteInfo packet_suites[]; + +/* main test program: */ int packet_main(void);