Skip to content

Commit fc74a31

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Fixed unit test for support extensions.
Change-Id: I2ea6b1afa1a8c61f95784fc3dfd7e48eb42fa5d8
1 parent e803974 commit fc74a31

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

test/nanostack/unittest/mac/mac_mlme/test_mac_mlme.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ static int8_t test_phy_rf_virtual_tx(const virtual_data_req_t *data, int8_t driv
7878
return 0;
7979
}
8080

81+
static int8_t test_phy_extension(phy_extension_type_e extension, uint8_t * data_ptr)
82+
{
83+
uint32_t *temp_32;
84+
switch (extension) {
85+
case PHY_EXTENSION_DYNAMIC_RF_SUPPORTED:
86+
*data_ptr = 1;
87+
break;
88+
case PHY_EXTENSION_GET_SYMBOLS_PER_SECOND:
89+
temp_32 = (uint32_t *) data_ptr;
90+
*data_ptr = 62500;
91+
break;
92+
default:
93+
break;
94+
}
95+
return 0;
96+
}
97+
8198
static arm_device_driver_list_s * rf_client_driver_allocate()
8299
{
83100
arm_device_driver_list_s *driver = malloc(sizeof(arm_device_driver_list_s));
@@ -1386,8 +1403,11 @@ bool test_mac_mlme_data_base_allocate()
13861403
list.phy_driver = &drv;
13871404
drv.phy_MTU = 0;
13881405
drv.phy_channel_pages = &phy_channel_pages;
1406+
drv.extension = &test_phy_extension;
13891407
nsdynmemlib_stub.returnCounter = 0;
13901408
mac_security_mib_stub.int8_value = 1;
1409+
1410+
common_functions_stub.uint32_value = 62500;
13911411
setup = mac_mlme_data_base_allocate(&buf, &list, &storage_sizes);
13921412
if( setup ){
13931413
return false;

test/nanostack/unittest/mac/sw_mac/test_sw_mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ bool test_ns_sw_mac_fhss_register()
824824
storage_sizes.key_lookup_size = 1;
825825
storage_sizes.key_usage_size = 3;
826826
mac_mlme_stub.setup_ptr = &setup;
827+
setup.rf_csma_extension_supported = true;
827828
nsdynmemlib_stub.returnCounter = 3;
828829
mac_api_t *mac_api = ns_sw_mac_create(0, &storage_sizes);
829830
if( !mac_api ){

0 commit comments

Comments
 (0)