Skip to content

Commit

Permalink
FHSS unit tests: Fixed missing stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Aug 31, 2018
1 parent 43bc93d commit 537b60d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 9 additions & 0 deletions test/nanostack/unittest/stub/fhss_common_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand Down

0 comments on commit 537b60d

Please sign in to comment.