From 2ca0f74a2180c6ed1036c7cee9ae37e79ae1d275 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 25 Sep 2018 14:11:22 +0300 Subject: [PATCH] Fix WIFI_CONNECT_PARAMS_CHANNEL_FAIL testcase. Test case was assuming that secure and unsecure SSID were on different channels. This is not a requirement and it should be OK to run on same channel. Fixed the testcase by using +1 on channel number to get a wrong channel. --- TESTS/network/wifi/wifi_connect_params_channel_fail.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TESTS/network/wifi/wifi_connect_params_channel_fail.cpp b/TESTS/network/wifi/wifi_connect_params_channel_fail.cpp index 9584b93721..e8b010dd63 100644 --- a/TESTS/network/wifi/wifi_connect_params_channel_fail.cpp +++ b/TESTS/network/wifi/wifi_connect_params_channel_fail.cpp @@ -34,7 +34,8 @@ void wifi_connect_params_channel_fail(void) return; } - nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security(), MBED_CONF_APP_WIFI_CH_UNSECURE); + uint8_t wrong_channel = 1 + (MBED_CONF_APP_WIFI_CH_SECURE%10); + nsapi_error_t error = wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, get_security(), wrong_channel); TEST_ASSERT(error == NSAPI_ERROR_CONNECTION_TIMEOUT || error == NSAPI_ERROR_NO_CONNECTION); wifi->set_channel(0);