Skip to content

Commit 94c527c

Browse files
committed
unittests: Test_LoRaWANTimer.start: Fix test failure
We weren't initialising the mocks correctly, so an MBED_ASSERT failed in `LoRaWANTimer::start` because the "timer_id" was not set.
1 parent 0b711a4 commit 94c527c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ TEST_F(Test_LoRaWANTimer, init)
7171

7272
TEST_F(Test_LoRaWANTimer, start)
7373
{
74-
equeue_stub.void_ptr = NULL;
74+
struct equeue_event ptr;
75+
equeue_stub.void_ptr = &ptr;
7576
timer_event_t ev;
7677
memset(&ev, 0, sizeof(ev));
78+
object->init(ev, my_callback);
79+
equeue_stub.call_cb_immediately = true;
7780
object->start(ev, 10);
7881
}
7982

0 commit comments

Comments
 (0)