From 48aaa1ff4050c0edd57ff1efc5f2b3c53ed69f9d Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 27 May 2024 18:48:48 +0300 Subject: [PATCH] tests: net: ieee802154: Remove extra newlines from prints As the logger will add newlines to printed strings, do not add them in the tests. Signed-off-by: Jukka Rissanen --- .../l2/src/ieee802154_fake_driver.c | 16 +++++++-------- .../ieee802154/l2/src/ieee802154_shell_test.c | 20 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c b/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c index ab6509ef0a6..a9d36e0a390 100644 --- a/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c +++ b/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c @@ -36,14 +36,14 @@ static int fake_cca(const struct device *dev) static int fake_set_channel(const struct device *dev, uint16_t channel) { - NET_INFO("Channel %u\n", channel); + NET_INFO("Channel %u", channel); return 0; } static int fake_set_txpower(const struct device *dev, int16_t dbm) { - NET_INFO("TX power %d dbm\n", dbm); + NET_INFO("TX power %d dbm", dbm); return 0; } @@ -68,7 +68,7 @@ static int fake_tx(const struct device *dev, struct net_pkt *pkt, struct net_buf *frag) { - NET_INFO("Sending packet %p - length %zu\n", + NET_INFO("Sending packet %p - length %zu", pkt, net_pkt_get_len(pkt)); if (!current_pkt) { @@ -86,12 +86,12 @@ static int fake_tx(const struct device *dev, ack_pkt = net_pkt_rx_alloc_with_buffer(iface, IEEE802154_ACK_PKT_LENGTH, AF_UNSPEC, 0, K_FOREVER); if (!ack_pkt) { - NET_ERR("*** Could not allocate ack pkt.\n"); + NET_ERR("*** Could not allocate ack pkt."); return -ENOMEM; } if (!ieee802154_create_ack_frame(iface, ack_pkt, ctx->ack_seq)) { - NET_ERR("*** Could not create ack frame.\n"); + NET_ERR("*** Could not create ack frame."); net_pkt_unref(ack_pkt); return -EFAULT; } @@ -107,14 +107,14 @@ static int fake_tx(const struct device *dev, static int fake_start(const struct device *dev) { - NET_INFO("FAKE ieee802154 driver started\n"); + NET_INFO("FAKE ieee802154 driver started"); return 0; } static int fake_stop(const struct device *dev) { - NET_INFO("FAKE ieee802154 driver stopped\n"); + NET_INFO("FAKE ieee802154 driver stopped"); return 0; } @@ -146,7 +146,7 @@ static void fake_iface_init(struct net_if *iface) ctx->channel = 26U; ctx->sequence = 62U; - NET_INFO("FAKE ieee802154 iface initialized\n"); + NET_INFO("FAKE ieee802154 iface initialized"); } static int fake_init(const struct device *dev) diff --git a/tests/net/ieee802154/l2/src/ieee802154_shell_test.c b/tests/net/ieee802154/l2/src/ieee802154_shell_test.c index e4d0fa4cefe..1bc7d98cb06 100644 --- a/tests/net/ieee802154/l2/src/ieee802154_shell_test.c +++ b/tests/net/ieee802154/l2/src/ieee802154_shell_test.c @@ -136,7 +136,7 @@ static void test_scan_shell_cmd(void) if (!ieee802154_validate_frame(net_pkt_data(current_pkt), net_pkt_get_len(current_pkt), &mpdu)) { - NET_ERR("*** Could not parse beacon request.\n"); + NET_ERR("*** Could not parse beacon request."); ztest_test_fail(); goto release_frag; } @@ -179,7 +179,7 @@ static void test_associate_shell_cmd(struct ieee802154_context *ctx) zassert_not_null(assoc_req); if (!ieee802154_validate_frame(assoc_req->data, assoc_req->len, &mpdu)) { - NET_ERR("*** Could not parse association request.\n"); + NET_ERR("*** Could not parse association request."); ztest_test_fail(); goto release_frag; } @@ -207,7 +207,7 @@ ZTEST(ieee802154_l2_shell, test_active_scan) pkt = net_pkt_rx_alloc_with_buffer(net_iface, sizeof(beacon_pkt), AF_UNSPEC, 0, K_FOREVER); if (!pkt) { - NET_ERR("*** No buffer to allocate\n"); + NET_ERR("*** No buffer to allocate"); goto fail; } @@ -253,7 +253,7 @@ ZTEST(ieee802154_l2_shell, test_associate) pkt = ieee802154_create_mac_cmd_frame(net_iface, IEEE802154_CFI_ASSOCIATION_RESPONSE, ¶ms); if (!pkt) { - NET_ERR("*** Could not create association response\n"); + NET_ERR("*** Could not create association response"); goto fail; } @@ -313,7 +313,7 @@ ZTEST(ieee802154_l2_shell, test_initiate_disassociation_from_enddevice) if (!ieee802154_validate_frame(net_pkt_data(current_pkt), net_pkt_get_len(current_pkt), &mpdu)) { - NET_ERR("*** Could not parse disassociation notification.\n"); + NET_ERR("*** Could not parse disassociation notification."); ztest_test_fail(); goto release_frag; } @@ -353,7 +353,7 @@ ZTEST(ieee802154_l2_shell, test_initiate_disassociation_from_coordinator) pkt = ieee802154_create_mac_cmd_frame(net_iface, IEEE802154_CFI_DISASSOCIATION_NOTIFICATION, ¶ms); if (!pkt) { - NET_ERR("*** Could not create association response\n"); + NET_ERR("*** Could not create association response"); goto fail; } @@ -451,21 +451,21 @@ static void *test_setup(void) k_sem_reset(&driver_lock); if (!dev) { - NET_ERR("*** Could not get fake device\n"); + NET_ERR("*** Could not get fake device"); return NULL; } net_iface = net_if_lookup_by_dev(dev); if (!net_iface) { - NET_ERR("*** Could not get fake iface\n"); + NET_ERR("*** Could not get fake iface"); return NULL; } - NET_INFO("Fake IEEE 802.15.4 network interface ready\n"); + NET_INFO("Fake IEEE 802.15.4 network interface ready"); current_pkt = net_pkt_rx_alloc(K_FOREVER); if (!current_pkt) { - NET_ERR("*** No buffer to allocate\n"); + NET_ERR("*** No buffer to allocate"); return false; }