From patchwork Fri Jul 24 11:27:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 51424 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 patches.linaro.org (Postfix) with ESMTPS id D978D20323 for ; Fri, 24 Jul 2015 11:36:05 +0000 (UTC) Received: by wicmm11 with SMTP id mm11sf5869800wic.3 for ; Fri, 24 Jul 2015 04:36:05 -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=JwpvDEZm0r0DInqR1IrYmZBvEbDTsiuIuSJg1yghD8I=; b=DWwLqE7eJrXXDDteOcyRnEFEY7PKirWWLAXmiOkqekEX5xmRxertEFOfMCiVGH06J5 m+yEWt8H2w49BGWLP0pmxAKPNzV4qr9kDn7tapvyiYkG7jgin5KrqnXNhtOIl1EGFPJJ zSkoDE34h5jRb8DZtfE4sUfzpf+Bbm+hNRfUUykbS9OW3+6+NSvo8EClifdC2683Twg4 aIuwMV+AWhF+HNvMQ5FScXsq9IxeIkU5mWUplvM51GsWQ1yYi7m5wNYKB82GNqfMidm9 2TU3/IaN8eKywq56mCTU/U3sOR/7TZMs5wUqiflUcc5u2myKt++bzYHJFn99Ko/XbeEL ixiA== X-Gm-Message-State: ALoCoQn6yg04OHi32rTAuCAr0x6ZEeyWJy/29jcCC/HTnorIa+LU6MoZyqsB7w6E1yvrUO6iuLxB X-Received: by 10.194.184.6 with SMTP id eq6mr6027984wjc.4.1437737765201; Fri, 24 Jul 2015 04:36:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.219.4 with SMTP id pk4ls383146lac.90.gmail; Fri, 24 Jul 2015 04:36:04 -0700 (PDT) X-Received: by 10.152.21.71 with SMTP id t7mr7587000lae.118.1437737764963; Fri, 24 Jul 2015 04:36:04 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id jc5si7272189lbc.127.2015.07.24.04.36.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 04:36:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbyj8 with SMTP id yj8so13365324lbb.0 for ; Fri, 24 Jul 2015 04:36:04 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr13014768lbc.112.1437737764863; Fri, 24 Jul 2015 04:36:04 -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 l6csp1117792lba; Fri, 24 Jul 2015 04:36:03 -0700 (PDT) X-Received: by 10.140.49.11 with SMTP id p11mr19561852qga.60.1437737763343; Fri, 24 Jul 2015 04:36:03 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n17si1748856qhb.24.2015.07.24.04.36.01; Fri, 24 Jul 2015 04:36:03 -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 AB25361836; Fri, 24 Jul 2015 11:36:01 +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 1D17861B60; Fri, 24 Jul 2015 11:29:58 +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 2202C61806; Fri, 24 Jul 2015 11:29:52 +0000 (UTC) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id ADA0F61B5E for ; Fri, 24 Jul 2015 11:28:15 +0000 (UTC) Received: by lahh5 with SMTP id h5so12297375lah.2 for ; Fri, 24 Jul 2015 04:28:14 -0700 (PDT) X-Received: by 10.152.203.233 with SMTP id kt9mr11547836lac.99.1437737294710; Fri, 24 Jul 2015 04:28:14 -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 y1sm1582274lal.39.2015.07.24.04.28.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jul 2015 04:28:14 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org Date: Fri, 24 Jul 2015 13:27:30 +0200 Message-Id: <1437737259-16953-12-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437737259-16953-1-git-send-email-christophe.milard@linaro.org> References: <1437737259-16953-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2 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.172 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 e6fb18a..1aeeef7 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 7e210cb..47192b5 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 registery: */ +extern CU_SuiteInfo packet_suites[]; + +/* main test program: */ int packet_main(void); #endif