Skip to content

Commit 421adc9

Browse files
committed
unittests: Fix Test_LoRaWANStack.acquire_tx_metadata
This test was relying on the state of `LoRaMac_stub::bool_true_counter` to be set to 1 from a previous test. When the test was ran in isolation the `LoRaWANStack::rx_timeout_interrupt_handler` callback would fail because we weren't returning true from the stub implementation of `LoRaMac::nwk_joined`. Due to this `LoRaWANStack::post_process_tx_no_reception` was never called. This caused the LoRaWANStack object to think the "tx_metadata" was "stale" (i.e the data hadn't changed since any previous read). So, when we attempted to call `LoRaWANStack::acquire_tx_metadata` it returned `LORAWAN_STATUS_METADATA_NOT_AVAILABLE` as it thought we had no new metadata to report, causing the test assertion to fail.
1 parent 9f3069f commit 421adc9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ TEST_F(Test_LoRaWANStack, acquire_tx_metadata)
631631
memset(&conf, 0, sizeof(conf));
632632
conf.status = LORAMAC_EVENT_INFO_STATUS_OK;
633633
LoRaMac_stub::mcps_conf_ptr = &conf;
634+
LoRaMac_stub::bool_true_counter = 1;
634635
radio._ev->tx_done();
635636

636637
LoRaMac_stub::slot_value = RX_SLOT_WIN_2;

0 commit comments

Comments
 (0)