Skip to content

Commit

Permalink
FHSS unit tests: Fixed broadcast handler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Sep 3, 2018
1 parent e7aa893 commit 8956418
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/nanostack/unittest/service_libs/fhss_ws/test_fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ bool test_fhss_broadcast_handler()
fhss_common_stub.fhss_struct.ws->bc_slot = fhss_common_stub.fhss_struct.number_of_channels - 1;
enable_fhss_struct();
// Test setting TR51 broadcast channel
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_channel_function = WS_TR51CF;
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_bc_channel_function = WS_TR51CF;
fhss_common_stub.fhss_struct.fhss_api->synch_state_set(api, DEFAULT_FHSS_STATE, DEFAULT_PANID);
if ((fhss_common_stub.fhss_struct.ws->is_on_bc_channel == false) || (4 != fhss_callbacks_stub.uint8_value) || (fhss_common_stub.fhss_struct.ws->bc_slot != 0)) {
return false;
Expand All @@ -518,7 +518,7 @@ bool test_fhss_broadcast_handler()
return false;
}
// Test setting direct hash broadcast channel
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_channel_function = WS_DH1CF;
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_bc_channel_function = WS_DH1CF;
fhss_common_stub.fhss_struct.fhss_api->synch_state_set(api, DEFAULT_FHSS_STATE, DEFAULT_PANID);
if ((fhss_common_stub.fhss_struct.ws->is_on_bc_channel == false) || (2 != fhss_callbacks_stub.uint8_value) || (fhss_common_stub.fhss_struct.ws->bc_slot != 1)) {
return false;
Expand All @@ -530,7 +530,7 @@ bool test_fhss_broadcast_handler()
}
// Test setting vendor defined broadcast channel
fhss_common_stub.fhss_struct.ws->fhss_configuration.vendor_defined_cf = app_channel_function;
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_channel_function = WS_VENDOR_DEF_CF;
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_bc_channel_function = WS_VENDOR_DEF_CF;
fhss_common_stub.fhss_struct.fhss_api->synch_state_set(api, DEFAULT_FHSS_STATE, DEFAULT_PANID);
if ((fhss_common_stub.fhss_struct.ws->is_on_bc_channel == false) || (VENDOR_CHANNEL != fhss_callbacks_stub.uint8_value) || (fhss_common_stub.fhss_struct.ws->bc_slot != 1)) {
return false;
Expand Down Expand Up @@ -627,10 +627,7 @@ bool test_fhss_ws_set_parent()
if (-1 != fhss_ws_set_parent(&fake_fhss_structure, dest_address, &bc_timing_info)) {
return false;
}
// Test on fixed channel
if (0 != fhss_ws_set_parent(&fhss_common_stub.fhss_struct, dest_address, &bc_timing_info)) {
return false;
}

// Test success
fhss_common_stub.fhss_struct.ws->fhss_configuration.ws_channel_function = WS_TR51CF;
bc_timing_info.broadcast_channel_function = WS_TR51CF;
Expand Down

0 comments on commit 8956418

Please sign in to comment.