From patchwork Wed Jan 18 22:01:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 91833 Delivered-To: patch@linaro.org Received: by 10.140.106.54 with SMTP id d51csp5364qgf; Wed, 18 Jan 2017 14:07:41 -0800 (PST) X-Received: by 10.237.36.122 with SMTP id s55mr5030175qtc.0.1484777261580; Wed, 18 Jan 2017 14:07:41 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a28si1225980qta.159.2017.01.18.14.07.41; Wed, 18 Jan 2017 14:07:41 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1E2CA62C12; Wed, 18 Jan 2017 22:07:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 66AAE62B86; Wed, 18 Jan 2017 22:02: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 6FEFB62BBA; Wed, 18 Jan 2017 22:02:49 +0000 (UTC) Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.171]) by lists.linaro.org (Postfix) with ESMTPS id D68EB60C2A for ; Wed, 18 Jan 2017 22:01:49 +0000 (UTC) Received: by mail-qt0-f171.google.com with SMTP id k15so34020281qtg.3 for ; Wed, 18 Jan 2017 14:01:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vA5lMG8lp23HP8NvSwOPW3ICB1OnzuWgyzNIFlzdWw0=; b=o9qVyc18JHkBT0Vf5n2+EBliVDl7pI9fLGLmWifv8QxFYkpBVkorNY1c11QFssiiHM QkmVffYBolmcEBaBUMRrfpnZhXh2G6wCquUd92LzTlep9ftBCEO8rk3yvZp/OMm7CIX1 GR2oHaB/n3jMG+6JoYENU3zQfJg/IpxkocdBUxl0jZhwBLEHc5E9rDtmZB1eABOm3bbI QDuojngZxnCOsgSDAx+TVl57xty/8bpFt1KHSBDxiQ8TRwdaZYe39AFCwaEq8bhLDOSM caDzREwVMFqaVLMF729fkjESzObZIAHaOgBXj1NulHri7NBhXwggfbPl2BRVBrW1J/S9 +qbw== X-Gm-Message-State: AIkVDXIeqCo7fr3n4feh5ROYRMapYZvX5lPfiUqDv5zQLI5Cw07ZArgIGiA6fdfngY7SSmAOaxk= X-Received: by 10.55.26.159 with SMTP id l31mr5238891qkh.164.1484776909344; Wed, 18 Jan 2017 14:01:49 -0800 (PST) Received: from localhost (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id 23sm1336519qtp.20.2017.01.18.14.01.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jan 2017 14:01:48 -0800 (PST) From: Mike Holmes To: christophe.milard@linaro.org, lng-odp@lists.linaro.org Date: Wed, 18 Jan 2017 17:01:37 -0500 Message-Id: <20170118220137.6817-5-mike.holmes@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170118220137.6817-1-mike.holmes@linaro.org> References: <20170118220137.6817-1-mike.holmes@linaro.org> Subject: [lng-odp] [PATCH v3 4/4] helper: remove dependence on test dir X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" There is no reason that the helpers need to depend on the test directory so remove the offending links Signed-off-by: Mike Holmes --- helper/test/Makefile.am | 26 ++++++++--- helper/test/chksum.c | 18 ++++---- helper/test/cuckootable.c | 4 +- helper/test/iplookuptable.c | 4 +- helper/test/linux-generic/process.c | 14 +++--- helper/test/linux-generic/thread.c | 14 +++--- helper/test/odpthreads.c | 18 ++++---- helper/test/parse.c | 86 ++++++++++++++++++------------------- helper/test/table.c | 12 +++--- 9 files changed, 106 insertions(+), 90 deletions(-) -- 2.9.3 diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index 7d55ae6..8d5bc9d 100644 --- a/helper/test/Makefile.am +++ b/helper/test/Makefile.am @@ -1,10 +1,27 @@ -include $(top_srcdir)/test/Makefile.inc +include $(top_srcdir)/platform/@with_platform@/Makefile.inc -AM_CFLAGS += -I$(srcdir)/common +LIB = $(top_builddir)/lib + +#in the following line, the libs using the symbols should come before +#the libs containing them! The includer is given a chance to add things +#before libodp by setting PRE_LDADD before the inclusion. +LDADD = $(PRE_LDADD) $(LIB)/libodphelper-@with_helper_platform@.la $(LIB)/libodp-linux.la + +INCFLAGS = \ + -I$(top_builddir)/platform/@with_platform@/include \ + -I$(top_srcdir)/helper/include \ + -I$(top_srcdir)/helper/platform/@with_helper_platform@/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/platform/@with_platform@/include \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/helper + +ODP_PLATFORM=${with_platform} + +AM_CFLAGS += $(INCFLAGS) +AM_CXXFLAGS = $(INCFLAGS) AM_LDFLAGS += -static -TESTS_ENVIRONMENT += TEST_DIR=${builddir} - EXECUTABLES = chksum$(EXEEXT) \ cuckootable$(EXEEXT) \ parse$(EXEEXT)\ @@ -38,7 +55,6 @@ EXTRA_DIST = odpthreads_as_processes odpthreads_as_pthreads dist_chksum_SOURCES = chksum.c dist_cuckootable_SOURCES = cuckootable.c dist_odpthreads_SOURCES = odpthreads.c -odpthreads_LDADD = $(LIB)/libodphelper-@with_helper_platform@.la $(LIB)/libodp-linux.la dist_parse_SOURCES = parse.c dist_table_SOURCES = table.c dist_iplookuptable_SOURCES = iplookuptable.c diff --git a/helper/test/chksum.c b/helper/test/chksum.c index 749d495..7c572ae 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include "odph_debug.h" #include #include #include @@ -21,7 +21,7 @@ struct udata_struct { }; /* Create additional dataplane threads */ -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odp_instance_t instance; int status = 0; @@ -41,17 +41,17 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) odp_pool_capability_t capa; if (odp_init_global(&instance, NULL, NULL)) { - LOG_ERR("Error: ODP global init failed.\n"); + ODPH_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } if (odp_init_local(instance, ODP_THREAD_WORKER)) { - LOG_ERR("Error: ODP local init failed.\n"); + ODPH_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } if (odp_pool_capability(&capa) < 0) { - LOG_ERR("Error: ODP global init failed.\n"); + ODPH_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } @@ -91,12 +91,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4); if (odph_ipv4_addr_parse(&dstip, "192.168.0.1")) { - LOG_ERR("Error: parse ip\n"); + ODPH_ERR("Error: parse ip\n"); return -1; } if (odph_ipv4_addr_parse(&srcip, "192.168.0.2")) { - LOG_ERR("Error: parse ip\n"); + ODPH_ERR("Error: parse ip\n"); return -1; } @@ -139,12 +139,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) return -1; if (odp_term_local()) { - LOG_ERR("Error: ODP local term failed.\n"); + ODPH_ERR("Error: ODP local term failed.\n"); exit(EXIT_FAILURE); } if (odp_term_global(instance)) { - LOG_ERR("Error: ODP global term failed.\n"); + ODPH_ERR("Error: ODP global term failed.\n"); exit(EXIT_FAILURE); } diff --git a/helper/test/cuckootable.c b/helper/test/cuckootable.c index 5b4333b..6736f2b 100644 --- a/helper/test/cuckootable.c +++ b/helper/test/cuckootable.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include <../odph_cuckootable.h> /******************************************************************************* @@ -534,7 +534,7 @@ test_cuckoo_hash_table(void) return 0; } -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odp_instance_t instance; int ret = 0; diff --git a/helper/test/iplookuptable.c b/helper/test/iplookuptable.c index e1d2820..86aa1b3 100644 --- a/helper/test/iplookuptable.c +++ b/helper/test/iplookuptable.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include <../odph_iplookuptable.h> #include @@ -138,7 +138,7 @@ static int test_ip_lookup_table(void) return 0; } -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odp_instance_t instance; int ret = 0; diff --git a/helper/test/linux-generic/process.c b/helper/test/linux-generic/process.c index f641128..f9bdc3e 100644 --- a/helper/test/linux-generic/process.c +++ b/helper/test/linux-generic/process.c @@ -4,13 +4,13 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include #include #include #define NUMBER_WORKERS 16 /* 0 = max */ -static void *worker_fn(void *arg TEST_UNUSED) +static void *worker_fn(void *arg ODPH_UNUSED) { /* depend on the odp helper to call odp_init_local */ printf("Worker thread on CPU %d\n", odp_cpu_id()); @@ -19,7 +19,7 @@ static void *worker_fn(void *arg TEST_UNUSED) } /* Create additional dataplane processes */ -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odp_cpumask_t cpu_mask; int num_workers; @@ -31,12 +31,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) odph_linux_thr_params_t thr_params; if (odp_init_global(&instance, NULL, NULL)) { - LOG_ERR("Error: ODP global init failed.\n"); + ODPH_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } if (odp_init_local(instance, ODP_THREAD_CONTROL)) { - LOG_ERR("Error: ODP local init failed.\n"); + ODPH_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } @@ -71,7 +71,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) ret = odph_linux_process_fork_n(proc, &cpu_mask, &thr_params); if (ret < 0) { - LOG_ERR("Fork workers failed %i\n", ret); + ODPH_ERR("Fork workers failed %i\n", ret); return -1; } @@ -83,7 +83,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) odph_linux_process_wait_n(proc, num_workers); if (odp_term_global(instance)) { - LOG_ERR("Error: ODP global term failed.\n"); + ODPH_ERR("Error: ODP global term failed.\n"); exit(EXIT_FAILURE); } } diff --git a/helper/test/linux-generic/thread.c b/helper/test/linux-generic/thread.c index f1ca1b7..919f00e 100644 --- a/helper/test/linux-generic/thread.c +++ b/helper/test/linux-generic/thread.c @@ -4,12 +4,12 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include #include #include #define NUMBER_WORKERS 16 -static void *worker_fn(void *arg TEST_UNUSED) +static void *worker_fn(void *arg ODPH_UNUSED) { /* depend on the odp helper to call odp_init_local */ @@ -21,7 +21,7 @@ static void *worker_fn(void *arg TEST_UNUSED) } /* Create additional dataplane threads */ -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odph_linux_pthread_t thread_tbl[NUMBER_WORKERS]; odp_cpumask_t cpu_mask; @@ -32,12 +32,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) odph_linux_thr_params_t thr_params; if (odp_init_global(&instance, NULL, NULL)) { - LOG_ERR("Error: ODP global init failed.\n"); + ODPH_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } if (odp_init_local(instance, ODP_THREAD_CONTROL)) { - LOG_ERR("Error: ODP local init failed.\n"); + ODPH_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } @@ -74,12 +74,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) odph_linux_pthread_join(thread_tbl, num_workers); if (odp_term_local()) { - LOG_ERR("Error: ODP local term failed.\n"); + ODPH_ERR("Error: ODP local term failed.\n"); exit(EXIT_FAILURE); } if (odp_term_global(instance)) { - LOG_ERR("Error: ODP global term failed.\n"); + ODPH_ERR("Error: ODP global term failed.\n"); exit(EXIT_FAILURE); } diff --git a/helper/test/odpthreads.c b/helper/test/odpthreads.c index 216bccd..4bb3c3b 100644 --- a/helper/test/odpthreads.c +++ b/helper/test/odpthreads.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -25,7 +25,7 @@ static void main_exit(void); /* ODP application instance */ static odp_instance_t odp_instance; -static int worker_fn(void *arg TEST_UNUSED) +static int worker_fn(void *arg ODPH_UNUSED) { int cpu; odp_cpumask_t workers; @@ -74,12 +74,12 @@ int main(int argc, char *argv[]) odph_parse_options(argc, argv, NULL, NULL); if (odp_init_global(&odp_instance, NULL, NULL)) { - LOG_ERR("Error: ODP global init failed.\n"); + ODPH_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } if (odp_init_local(odp_instance, ODP_THREAD_CONTROL)) { - LOG_ERR("Error: ODP local init failed.\n"); + ODPH_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } @@ -89,13 +89,13 @@ int main(int argc, char *argv[]) odp_cpumask_zero(&cpu_mask); /* allocate the 1st available control cpu to main process */ if (odp_cpumask_default_control(&cpu_mask, 1) != 1) { - LOG_ERR("Allocate main process CPU core failed.\n"); + ODPH_ERR("Allocate main process CPU core failed.\n"); exit(EXIT_FAILURE); } cpu = odp_cpumask_first(&cpu_mask); if (odph_odpthread_setaffinity(cpu) != 0) { - LOG_ERR("Set main process affinify to " + ODPH_ERR("Set main process affinify to " "cpu(%d) failed.\n", cpu); exit(EXIT_FAILURE); } @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) /* read back affinity to verify */ affinity = odph_odpthread_getaffinity(); if ((affinity < 0) || (cpu != affinity)) { - LOG_ERR("Verify main process affinity failed: " + ODPH_ERR("Verify main process affinity failed: " "set(%d) read(%d).\n", cpu, affinity); exit(EXIT_FAILURE); } @@ -152,12 +152,12 @@ int main(int argc, char *argv[]) static void main_exit(void) { if (odp_term_local()) { - LOG_ERR("Error: ODP local term failed.\n"); + ODPH_ERR("Error: ODP local term failed.\n"); _exit(EXIT_FAILURE); } if (odp_term_global(odp_instance)) { - LOG_ERR("Error: ODP global term failed.\n"); + ODPH_ERR("Error: ODP global term failed.\n"); _exit(EXIT_FAILURE); } } diff --git a/helper/test/parse.c b/helper/test/parse.c index b5a4ab4..26dfc68 100644 --- a/helper/test/parse.c +++ b/helper/test/parse.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include +#include #include #include @@ -42,37 +42,37 @@ static int test_mac(void) /* String must not start with other chars */ if (!odph_eth_addr_parse(&mac, "foo 01:02:03:04:05:06")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Missing digit */ if (!odph_eth_addr_parse(&mac, "01:02:03:04:05:")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Missing colon */ if (!odph_eth_addr_parse(&mac, "01:02:03:04:05 06")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Too large value */ if (!odph_eth_addr_parse(&mac, "01:02:03:04:05:1ff")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Negative value */ if (!odph_eth_addr_parse(&mac, "-1:02:03:04:05:06")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Failed function call must not store address */ if (different_mac(&mac, &ref)) { - LOG_ERR("Modified address when failed\n"); + ODPH_ERR("Modified address when failed\n"); return -1; } @@ -86,36 +86,36 @@ static int test_mac(void) /* Zero pre-fixed */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "01:02:03:04:05:06")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } /* Not zero pre-fixed */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "1:2:3:4:5:6")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } /* String may continue with other chars */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "01:02:03:04:05:06 foobar")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -129,24 +129,24 @@ static int test_mac(void) /* Zero pre-fixed */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "0a:0b:0c:0d:0e:0f")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } /* Not zero pre-fixed */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "a:b:c:d:e:f")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -160,12 +160,12 @@ static int test_mac(void) /* Dual digits */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "1a:2b:3c:4d:5e:6f")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -174,12 +174,12 @@ static int test_mac(void) /* All zeros */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "00:00:00:00:00:00")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -188,12 +188,12 @@ static int test_mac(void) /* All ones */ memset(&mac, 0, sizeof(odph_ethaddr_t)); if (odph_eth_addr_parse(&mac, "ff:ff:ff:ff:ff:ff")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_mac(&mac, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -215,37 +215,37 @@ static int test_ipv4(void) /* String must not start with other chars */ if (!odph_ipv4_addr_parse(&ip_addr, "foo 1.2.3.4")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Missing digit */ if (!odph_ipv4_addr_parse(&ip_addr, "1.2.3.")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Missing dot */ if (!odph_ipv4_addr_parse(&ip_addr, "1.2.3 4")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Too large value */ if (!odph_ipv4_addr_parse(&ip_addr, "1.2.3.256")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Negative value */ if (!odph_ipv4_addr_parse(&ip_addr, "-1.2.3.4")) { - LOG_ERR("Accepted bad string\n"); + ODPH_ERR("Accepted bad string\n"); return -1; } /* Failed function call must not store address */ if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Modified address when failed\n"); + ODPH_ERR("Modified address when failed\n"); return -1; } @@ -254,36 +254,36 @@ static int test_ipv4(void) /* Zero pre-fixed */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "001.002.003.004")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } /* Not zero pre-fixed */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "1.2.3.4")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } /* String may continue with other chars */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "1.2.3.4 foobar")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -292,12 +292,12 @@ static int test_ipv4(void) /* Dual digits */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "26.43.60.77")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -306,12 +306,12 @@ static int test_ipv4(void) /* Triple digits */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "161.178.195.212")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -320,12 +320,12 @@ static int test_ipv4(void) /* All zeros */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "0.0.0.0")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } @@ -334,12 +334,12 @@ static int test_ipv4(void) /* All ones */ ip_addr = 0; if (odph_ipv4_addr_parse(&ip_addr, "255.255.255.255")) { - LOG_ERR("Parse call failed\n"); + ODPH_ERR("Parse call failed\n"); return -1; } if (different_ipv4(&ip_addr, &ref)) { - LOG_ERR("Bad parse result\n"); + ODPH_ERR("Bad parse result\n"); return -1; } diff --git a/helper/test/table.c b/helper/test/table.c index abb5b3b..3b74b22 100644 --- a/helper/test/table.c +++ b/helper/test/table.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier:BSD-3-Clause */ -#include +#include #include <../odph_hashtable.h> #include <../odph_lineartable.h> #include @@ -25,7 +25,7 @@ * value (data): MAC address of the next hop station (6 bytes). */ -int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) +int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) { odp_instance_t instance; int ret = 0; @@ -43,12 +43,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) ret = odp_init_global(&instance, NULL, NULL); if (ret != 0) { - LOG_ERR("odp_shm_init_global fail\n"); + ODPH_ERR("odp_shm_init_global fail\n"); exit(EXIT_FAILURE); } ret = odp_init_local(instance, ODP_THREAD_WORKER); if (ret != 0) { - LOG_ERR("odp_shm_init_local fail\n"); + ODPH_ERR("odp_shm_init_local fail\n"); exit(EXIT_FAILURE); } @@ -121,12 +121,12 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) printf("all test finished success!!\n"); if (odp_term_local()) { - LOG_ERR("Error: ODP local term failed.\n"); + ODPH_ERR("Error: ODP local term failed.\n"); exit(EXIT_FAILURE); } if (odp_term_global(instance)) { - LOG_ERR("Error: ODP global term failed.\n"); + ODPH_ERR("Error: ODP global term failed.\n"); exit(EXIT_FAILURE); }