From 537b60d10e883ea628ef3896063d890087bd550c Mon Sep 17 00:00:00 2001 From: Jarkko Paso Date: Fri, 31 Aug 2018 11:11:40 +0300 Subject: [PATCH] FHSS unit tests: Fixed missing stub --- .../unittest/service_libs/fhss_common/test_fhss_common.c | 7 ------- test/nanostack/unittest/stub/fhss_common_stub.c | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/nanostack/unittest/service_libs/fhss_common/test_fhss_common.c b/test/nanostack/unittest/service_libs/fhss_common/test_fhss_common.c index 7563fef54d0..f939082cc80 100644 --- a/test/nanostack/unittest/service_libs/fhss_common/test_fhss_common.c +++ b/test/nanostack/unittest/service_libs/fhss_common/test_fhss_common.c @@ -84,13 +84,6 @@ bool test_fhss_allocate_instance() if (NULL == fhss_ptr) { return false; } - // Test event timer cb with invalid timer id - fhss_ptr->callbacks.tx_poll = &mac_poll_tx_queue; - ns_timer_stub.cb(-1, 10); - // Test event timer cb with random timer id - ns_timer_stub.cb(1, 10); - // Test event timer cb with valid timer id - ns_timer_stub.cb(0, 10); // Free allocated instance fhss_free_instance(&fhss_api); diff --git a/test/nanostack/unittest/stub/fhss_common_stub.c b/test/nanostack/unittest/stub/fhss_common_stub.c index cb847cc3a9e..2a5b71f16c3 100644 --- a/test/nanostack/unittest/stub/fhss_common_stub.c +++ b/test/nanostack/unittest/stub/fhss_common_stub.c @@ -55,6 +55,15 @@ fhss_structure_t *fhss_get_object_with_api(const fhss_api_t *fhss_api) return &fhss_common_stub.fhss_struct; } +fhss_structure_t *fhss_get_object_with_timer_id(const int8_t timer_id) +{ + if (fhss_common_stub.bool_value == false) { + return NULL; + } + fhss_common_stub.fhss_struct.fhss_event_timer = timer_id; + return &fhss_common_stub.fhss_struct; +} + void fhss_clear_active_event(fhss_structure_t *fhss_structure, uint8_t event_type) {