From 94c527c85208b79594c0668d600e9b3ff241d46a Mon Sep 17 00:00:00 2001 From: Robert Walton Date: Mon, 26 Jul 2021 23:28:12 +0100 Subject: [PATCH] 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. --- .../features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp index 9fb10a39854e..fd0ab985c86c 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/Test_LoRaWANTimer.cpp @@ -71,9 +71,12 @@ TEST_F(Test_LoRaWANTimer, init) TEST_F(Test_LoRaWANTimer, start) { - equeue_stub.void_ptr = NULL; + struct equeue_event ptr; + equeue_stub.void_ptr = &ptr; timer_event_t ev; memset(&ev, 0, sizeof(ev)); + object->init(ev, my_callback); + equeue_stub.call_cb_immediately = true; object->start(ev, 10); }