From patchwork Fri Dec 23 19:15:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 88970 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp3471893qgi; Fri, 23 Dec 2016 11:18:39 -0800 (PST) X-Received: by 10.55.148.70 with SMTP id w67mr16087548qkd.27.1482520719494; Fri, 23 Dec 2016 11:18:39 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 60si20475690qtf.164.2016.12.23.11.18.39; Fri, 23 Dec 2016 11:18:39 -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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2CD2B60C68; Fri, 23 Dec 2016 19:18:39 +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=-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 [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8DC5860C67; Fri, 23 Dec 2016 19:16:53 +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 0715F60C67; Fri, 23 Dec 2016 19:16:46 +0000 (UTC) Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by lists.linaro.org (Postfix) with ESMTPS id 3EDF960A0D for ; Fri, 23 Dec 2016 19:15:54 +0000 (UTC) Received: by mail-qk0-f175.google.com with SMTP id h201so11551157qke.1 for ; Fri, 23 Dec 2016 11:15:54 -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=uOIBJjNQIFnodZTI5fmplySMFkb48sTXl5Poj6DwQgg=; b=PeZ3f1b7P8UgyrjrZouzv8xo7yLolvkNsxPwzqyfvGRyFM1SMYPjAUYZPfZFzJamfh 3FUQLgVXUvR6DJAQxj9fXI53sftnU5FxJIcRzkbeHtf9ZEosdu7/rXsfPGFL77KWUbvE nxzAZ9qHnAEpHS5WDSmv7b/6rgZdOaaMWlUzZP1z3fNJBIyDVdQf+KqbDJLSU4YbdBMH +KEyL2FWB4FqVC8VlhoIfq5n9JdAIkyvmrX67GVaUSMZoPZ75G9K9qOSC11wJ2Pethm5 WsFzVYy+ArU4gB7kLcNHnIV/fV4kluwC/q4+oREitdNHgCmMvpZu7sB6p98XsgD13an0 nK0w== X-Gm-Message-State: AIkVDXIwc8bGNlRJJoQ0SDv46XRYQBVNmRZF3GtgwphlWh0l5oXhhf5M3JrIEXPGZNy5JQ5o0Xw= X-Received: by 10.55.43.74 with SMTP id r71mr16138333qkh.306.1482520553337; Fri, 23 Dec 2016 11:15:53 -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 m20sm3993816qke.25.2016.12.23.11.15.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Dec 2016 11:15:52 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 23 Dec 2016 14:15:41 -0500 Message-Id: <20161223191541.31493-5-mike.holmes@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161223191541.31493-1-mike.holmes@linaro.org> References: <20161223191541.31493-1-mike.holmes@linaro.org> Subject: [lng-odp] [PATCH 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/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 +++--- 7 files changed, 102 insertions(+), 86 deletions(-) -- 2.9.3 diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index 47dcb86..38c7fe2 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) \ parse$(EXEEXT)\ table$(EXEEXT) @@ -35,6 +52,5 @@ EXTRA_DIST = odpthreads_as_processes odpthreads_as_pthreads dist_chksum_SOURCES = chksum.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 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/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); }