Skip to content

Commit 537b60d

Browse files
author
Jarkko Paso
committed
FHSS unit tests: Fixed missing stub
1 parent 43bc93d commit 537b60d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

test/nanostack/unittest/service_libs/fhss_common/test_fhss_common.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ bool test_fhss_allocate_instance()
8484
if (NULL == fhss_ptr) {
8585
return false;
8686
}
87-
// Test event timer cb with invalid timer id
88-
fhss_ptr->callbacks.tx_poll = &mac_poll_tx_queue;
89-
ns_timer_stub.cb(-1, 10);
90-
// Test event timer cb with random timer id
91-
ns_timer_stub.cb(1, 10);
92-
// Test event timer cb with valid timer id
93-
ns_timer_stub.cb(0, 10);
9487
// Free allocated instance
9588
fhss_free_instance(&fhss_api);
9689

test/nanostack/unittest/stub/fhss_common_stub.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ fhss_structure_t *fhss_get_object_with_api(const fhss_api_t *fhss_api)
5555
return &fhss_common_stub.fhss_struct;
5656
}
5757

58+
fhss_structure_t *fhss_get_object_with_timer_id(const int8_t timer_id)
59+
{
60+
if (fhss_common_stub.bool_value == false) {
61+
return NULL;
62+
}
63+
fhss_common_stub.fhss_struct.fhss_event_timer = timer_id;
64+
return &fhss_common_stub.fhss_struct;
65+
}
66+
5867
void fhss_clear_active_event(fhss_structure_t *fhss_structure, uint8_t event_type)
5968
{
6069

0 commit comments

Comments
 (0)