From patchwork Mon Jul 27 17:38:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 51557 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 9E95A22918 for ; Mon, 27 Jul 2015 17:47:00 +0000 (UTC) Received: by wicmv11 with SMTP id mv11sf30253401wic.1 for ; Mon, 27 Jul 2015 10:47:00 -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=Edz+PT1gDY9oUqdm5W896JP7Npthm4l/qABZA6+78pA=; b=g9Cutpc5iU97iSEFQ0YBQxenLanzWlikUjuDyQI0RRdMA9Pqm4aHKcZ/6lHLmPNtrA Psfv5EE3X/HqTKv1pNbf2UUkrHGgYoZ2jLQR2vTsXSO+pXx1ApJ2eJUDtPIiHtHU2nwk svBI1+TpyEwhfkzQOxIQhUs4hvXSUSswfX2SxLiNdf7imxbju6lNttpLPo0EhS/Zqxzp FfIclTQjPSo1o6LJXabb+0YiBJymDcKFTB6899xwbOk5bs0Z07UkgMGikQX60OTXHaPY 8NA4xSKZ7xn7rIgdAzmBAqcvSSyTBFDat1Eprmq2GYqOWM8NKCeNlNNRa7I3RXIc6WYE qO5g== X-Gm-Message-State: ALoCoQl3yed3qAF+m0BofvvRBY81ca8M+CgJ6fXwKhW5fZHvvE2TeW9Y0yZExWw/PSBgbKAMl/v8 X-Received: by 10.180.11.226 with SMTP id t2mr5723284wib.0.1438019219935; Mon, 27 Jul 2015 10:46:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.4 with SMTP id x4ls676291lag.100.gmail; Mon, 27 Jul 2015 10:46:59 -0700 (PDT) X-Received: by 10.112.50.66 with SMTP id a2mr28509961lbo.68.1438019219799; Mon, 27 Jul 2015 10:46:59 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id z1si15850141laa.59.2015.07.27.10.46.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 10:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbyj8 with SMTP id yj8so58609859lbb.0 for ; Mon, 27 Jul 2015 10:46:59 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr28128583lbb.29.1438019219650; Mon, 27 Jul 2015 10:46:59 -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.7.198 with SMTP id l6csp1662174lba; Mon, 27 Jul 2015 10:46:58 -0700 (PDT) X-Received: by 10.55.54.65 with SMTP id d62mr42666606qka.59.1438019216636; Mon, 27 Jul 2015 10:46:56 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h12si21790173qge.96.2015.07.27.10.46.49; Mon, 27 Jul 2015 10:46:56 -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 E052761DD5; Mon, 27 Jul 2015 17:46: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 3457261DFA; Mon, 27 Jul 2015 17:40:45 +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 E79A461DC0; Mon, 27 Jul 2015 17:40:34 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by lists.linaro.org (Postfix) with ESMTPS id 5902561DCC for ; Mon, 27 Jul 2015 17:39:21 +0000 (UTC) Received: by lblf12 with SMTP id f12so58449209lbl.2 for ; Mon, 27 Jul 2015 10:39:20 -0700 (PDT) X-Received: by 10.112.40.66 with SMTP id v2mr27926863lbk.27.1438018760287; Mon, 27 Jul 2015 10:39:20 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id 4sm4027442lai.36.2015.07.27.10.39.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jul 2015 10:39:19 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org Date: Mon, 27 Jul 2015 19:38:43 +0200 Message-Id: <1438018732-2778-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438018732-2778-1-git-send-email-christophe.milard@linaro.org> References: <1438018732-2778-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv3 11/20] 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.217.175 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 329482a..99a6745 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -36,7 +36,7 @@ static struct udata_struct { "abcdefg", }; -static int packet_suite_init(void) +int packet_suite_init(void) { odp_pool_param_t params = { .pkt = { @@ -78,7 +78,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); @@ -87,7 +87,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; @@ -126,7 +126,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 - @@ -139,7 +139,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; @@ -154,7 +154,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; @@ -166,7 +166,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; @@ -185,13 +185,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; @@ -213,7 +213,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; @@ -287,7 +287,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; @@ -359,7 +359,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; @@ -386,7 +386,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; @@ -486,7 +486,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; @@ -506,7 +506,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; @@ -529,7 +529,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; @@ -551,7 +551,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; @@ -660,7 +660,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; @@ -679,7 +679,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); @@ -710,7 +710,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; @@ -756,7 +756,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), @@ -778,7 +778,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 7e210cb..f8a16a8 100644 --- a/test/validation/packet/packet.h +++ b/test/validation/packet/packet.h @@ -7,6 +7,39 @@ #ifndef _ODP_TEST_PACKET_H_ #define _ODP_TEST_PACKET_H_ +#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 registry: */ +extern CU_SuiteInfo packet_suites[]; + +/* main test program: */ int packet_main(void); #endif