Skip to content

Commit cd3a032

Browse files
author
Hasnain Virk
committed
Unit test fix for RX TOA change
The change had an impact on unittests and we needed to adjust the test cases a little to accomodate the change.
1 parent 8fd791d commit cd3a032

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ TEST_F(Test_LoRaMac, initialize)
7777
conn.connection_u.otaa.nb_trials = 2;
7878
object->prepare_join(&conn, true);
7979

80+
channel_params_t params[] = {868300000, 0, { ((DR_5 << 4) | DR_0) }, 1};
81+
LoRaPHY_stub::channel_params_ptr = params;
82+
8083
LoRaWANTimer_stub::call_cb_immediately = true;
8184
EXPECT_TRUE(LORAWAN_STATUS_OK == object->initialize(NULL, my_cb));
8285
}

UNITTESTS/stubs/LoRaPHY_stub.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,4 +416,8 @@ uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset)
416416
return LoRaPHY_stub::uint8_value;
417417
}
418418

419+
uint32_t LoRaPHY::get_rx_time_on_air(uint8_t modem, uint16_t pkt_len)
420+
{
421+
return LoRaPHY_stub::uint32_value;
422+
}
419423

0 commit comments

Comments
 (0)