extern int utc_wifi_scan_n(void);
extern int utc_wifi_deactivate_n(void);
extern int utc_wifi_deactivate_p(void);
-extern int utc_wifi_connect_n1(void);
-extern int utc_wifi_connect_n2(void);
-extern int utc_wifi_connect_p(void);
extern int utc_wifi_disconnect_n1(void);
extern int utc_wifi_disconnect_n2(void);
extern int utc_wifi_disconnect_p(void);
extern int utc_wifi_tdls_set_state_changed_cb_n(void);
extern int utc_wifi_tdls_unset_state_changed_cb_p(void);
extern int utc_wifi_tdls_unset_state_changed_cb_n(void);
+extern int utc_wifi_connect_n1(void);
+extern int utc_wifi_connect_n2(void);
+extern int utc_wifi_connect_p(void);
testcase tc_array[] = {
{"utc_wifi_ap_create_p", utc_wifi_ap_create_p, utc_wifi_ap_startup, utc_wifi_ap_cleanup},
{"utc_wifi_scan_n", utc_wifi_scan_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_n", utc_wifi_deactivate_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_p", utc_wifi_deactivate_p, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n1", utc_wifi_disconnect_n1, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n2", utc_wifi_disconnect_n2, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_p", utc_wifi_disconnect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_tdls_set_state_changed_cb_n", utc_wifi_tdls_set_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_p", utc_wifi_tdls_unset_state_changed_cb_p, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_n", utc_wifi_tdls_unset_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
+ {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{NULL, NULL}
};
extern int utc_wifi_scan_n(void);
extern int utc_wifi_deactivate_n(void);
extern int utc_wifi_deactivate_p(void);
-extern int utc_wifi_connect_n1(void);
-extern int utc_wifi_connect_n2(void);
-extern int utc_wifi_connect_p(void);
extern int utc_wifi_disconnect_n1(void);
extern int utc_wifi_disconnect_n2(void);
extern int utc_wifi_disconnect_p(void);
extern int utc_wifi_tdls_set_state_changed_cb_n(void);
extern int utc_wifi_tdls_unset_state_changed_cb_p(void);
extern int utc_wifi_tdls_unset_state_changed_cb_n(void);
+extern int utc_wifi_connect_n1(void);
+extern int utc_wifi_connect_n2(void);
+extern int utc_wifi_connect_p(void);
testcase tc_array[] = {
{"utc_wifi_ap_create_p", utc_wifi_ap_create_p, utc_wifi_ap_startup, utc_wifi_ap_cleanup},
{"utc_wifi_scan_n", utc_wifi_scan_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_n", utc_wifi_deactivate_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_p", utc_wifi_deactivate_p, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n1", utc_wifi_disconnect_n1, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n2", utc_wifi_disconnect_n2, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_p", utc_wifi_disconnect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_tdls_set_state_changed_cb_n", utc_wifi_tdls_set_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_p", utc_wifi_tdls_unset_state_changed_cb_p, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_n", utc_wifi_tdls_unset_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
+ {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{NULL, NULL}
};
extern int utc_wifi_scan_n(void);
extern int utc_wifi_deactivate_n(void);
extern int utc_wifi_deactivate_p(void);
-extern int utc_wifi_connect_n1(void);
-extern int utc_wifi_connect_n2(void);
-extern int utc_wifi_connect_p(void);
extern int utc_wifi_disconnect_n1(void);
extern int utc_wifi_disconnect_n2(void);
extern int utc_wifi_disconnect_p(void);
extern int utc_wifi_tdls_set_state_changed_cb_n(void);
extern int utc_wifi_tdls_unset_state_changed_cb_p(void);
extern int utc_wifi_tdls_unset_state_changed_cb_n(void);
+extern int utc_wifi_connect_n1(void);
+extern int utc_wifi_connect_n2(void);
+extern int utc_wifi_connect_p(void);
testcase tc_array[] = {
{"utc_wifi_ap_create_p", utc_wifi_ap_create_p, utc_wifi_ap_startup, utc_wifi_ap_cleanup},
{"utc_wifi_scan_n", utc_wifi_scan_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_n", utc_wifi_deactivate_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_p", utc_wifi_deactivate_p, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n1", utc_wifi_disconnect_n1, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n2", utc_wifi_disconnect_n2, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_p", utc_wifi_disconnect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_tdls_set_state_changed_cb_n", utc_wifi_tdls_set_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_p", utc_wifi_tdls_unset_state_changed_cb_p, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_n", utc_wifi_tdls_unset_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
+ {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{NULL, NULL}
};
extern int utc_wifi_scan_n(void);
extern int utc_wifi_deactivate_n(void);
extern int utc_wifi_deactivate_p(void);
-extern int utc_wifi_connect_n1(void);
-extern int utc_wifi_connect_n2(void);
-extern int utc_wifi_connect_p(void);
extern int utc_wifi_disconnect_n1(void);
extern int utc_wifi_disconnect_n2(void);
extern int utc_wifi_disconnect_p(void);
extern int utc_wifi_tdls_set_state_changed_cb_n(void);
extern int utc_wifi_tdls_unset_state_changed_cb_p(void);
extern int utc_wifi_tdls_unset_state_changed_cb_n(void);
+extern int utc_wifi_connect_n1(void);
+extern int utc_wifi_connect_n2(void);
+extern int utc_wifi_connect_p(void);
testcase tc_array[] = {
{"utc_wifi_ap_create_p", utc_wifi_ap_create_p, utc_wifi_ap_startup, utc_wifi_ap_cleanup},
{"utc_wifi_scan_n", utc_wifi_scan_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_n", utc_wifi_deactivate_n, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_deactivate_p", utc_wifi_deactivate_p, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
- {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n1", utc_wifi_disconnect_n1, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_n2", utc_wifi_disconnect_n2, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_disconnect_p", utc_wifi_disconnect_p, utc_wifi_startup, utc_wifi_cleanup},
{"utc_wifi_tdls_set_state_changed_cb_n", utc_wifi_tdls_set_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_p", utc_wifi_tdls_unset_state_changed_cb_p, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
{"utc_wifi_tdls_unset_state_changed_cb_n", utc_wifi_tdls_unset_state_changed_cb_n, utc_wifi_tdls_startup, utc_wifi_tdls_cleanup},
+ {"utc_wifi_connect_n1", utc_wifi_connect_n1, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_n2", utc_wifi_connect_n2, utc_wifi_startup, utc_wifi_cleanup},
+ {"utc_wifi_connect_p", utc_wifi_connect_p, utc_wifi_startup, utc_wifi_cleanup},
{NULL, NULL}
};
return true;
}
+static int wifi_pre_connect(void)
+{
+ bool activated;
+ int ret = WIFI_ERROR_NONE;
+ wifi_ap_h ap_h;
+ wifi_connection_state_e connection_state;
+ char configValue[CONFIG_VALUE_LEN_MAX] = {0,};
+
+ ret = wifi_is_activated(&activated);
+ assert_eq(ret, WIFI_ERROR_NONE);
+ if(activated == false) {
+ wifi_activate(__test_activated_callback, NULL);
+ RUN_GMAIN_LOOP;
+ assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
+ }
+
+ ret = wifi_get_connection_state(&connection_state);
+ assert_eq(ret, WIFI_ERROR_NONE);
+ if(connection_state == WIFI_CONNECTION_STATE_CONNECTED) {
+ ret = wifi_get_connected_ap(&ap_h);
+ assert_eq(ret, WIFI_ERROR_NONE);
+ return WIFI_ERROR_NONE;
+ }
+
+ wifi_scan(__test_scan_request_callback, NULL);
+ RUN_GMAIN_LOOP;
+ assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
+
+ if(_get_value_from_configfile("WIFI_WPSACCESSPOINTNAME", configValue) == false)
+ return WIFI_ERROR_OPERATION_FAILED;
+ if(_get_value_from_configfile("WIFI_ACCESSPOINTPIN", g_passPhrase) == false)
+ return WIFI_ERROR_OPERATION_FAILED;
+
+ wifi_foreach_found_aps(__utc_wifi_foreach_found_aps_callback, configValue);
+ RUN_GMAIN_LOOP;
+ assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
+
+ ret = wifi_get_connected_ap(&ap_h);
+ assert_eq(ret, WIFI_ERROR_NONE);
+
+ return WIFI_ERROR_NONE;
+}
+
/**
* @testcase utc_wifi_initialize_p
* @since_tizen 2.3
}
/**
- * @testcase utc_wifi_connect_n1
- * @since_tizen 2.3
- * @type Negative
- * @description Verify wifi_connect by passing invalid parameters.
- * @scenario Try to connect Wi-Fi before initialization and ensure WIFI_ERROR_INVALID_OPERATION is reported.
- */
-int utc_wifi_connect_n1(void)
-{
- int ret = WIFI_ERROR_NONE;
- if(g_wifi_supported == false) {
- ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
- assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- wifi_deinitialize();
-
- ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
- wifi_initialize();
-
- assert_eq(ret, WIFI_ERROR_INVALID_OPERATION);
-
- return 0;
-}
-
-/**
- * @testcase utc_wifi_connect_n2
- * @since_tizen 2.3
- * @type Negative
- * @description Verify wifi_connect by passing invalid parameters.
- * @scenario Try to connect Wi-Fi with invalid AP handle and ensure WIFI_ERROR_INVALID_PARAMETER is reported.
- */
-int utc_wifi_connect_n2(void)
-{
- int ret = WIFI_ERROR_NONE;
- if(g_wifi_supported == false) {
- ret = wifi_connect(NULL, __test_activated_callback, NULL);
- assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = wifi_connect(NULL, __test_activated_callback, NULL);
-
- assert_eq(ret, WIFI_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_wifi_connect_p
- * @since_tizen 2.3
- * @type Positive
- * @description Connects the access point asynchronously..
- * @scenario Create AP handle and activate Wi-Fi. On acivattion Wi-Fi connection will
- * be initiated to the AP.
- */
-int utc_wifi_connect_p(void)
-{
- bool activated;
- int ret = WIFI_ERROR_NONE;
- wifi_ap_h ap_h;
- wifi_connection_state_e connection_state;
- char configValue[CONFIG_VALUE_LEN_MAX] = {0,};
-
- if(g_wifi_supported == false) {
- ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
- assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
- ret = wifi_is_activated(&activated);
- assert_eq(ret, WIFI_ERROR_NONE);
- if(activated == false) {
- wifi_activate(__test_activated_callback, NULL);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
- }
-
- ret = wifi_get_connection_state(&connection_state);
- assert_eq(ret, WIFI_ERROR_NONE);
- if(connection_state == WIFI_CONNECTION_STATE_CONNECTED) {
- ret = wifi_get_connected_ap(&ap_h);
- assert_eq(ret, WIFI_ERROR_NONE);
- return 0;
- }
-
- wifi_scan(__test_scan_request_callback, NULL);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
-
- if(_get_value_from_configfile("WIFI_WPSACCESSPOINTNAME", configValue) == false)
- return -1;
- if(_get_value_from_configfile("WIFI_ACCESSPOINTPIN", g_passPhrase) == false)
- return -1;
-
- wifi_foreach_found_aps(__utc_wifi_foreach_found_aps_callback, configValue);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
-
- return 0;
-}
-
-/**
* @testcase utc_wifi_disconnect_n1
* @since_tizen 2.3
* @type Negative
return 0;
}
+ ret = wifi_pre_connect();
+ assert_eq(ret, WIFI_ERROR_NONE);
+
ret = wifi_get_connected_ap(&g_hAp);
assert_eq(ret, WIFI_ERROR_NONE);
int utc_wifi_get_connected_ap_p(void)
{
int ret = 0;
- bool activated;
- wifi_ap_h ap_h;
- wifi_connection_state_e connection_state;
- char configValue[CONFIG_VALUE_LEN_MAX] = {0,};
if(g_wifi_supported == false) {
- ret = WIFI_ERROR_NONE;
- ret = wifi_get_connected_ap(&ap_h);
+ ret = wifi_get_connected_ap(&g_hAp);
assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
return 0;
}
- ret = wifi_is_activated(&activated);
- assert_eq(ret, WIFI_ERROR_NONE);
- if(activated == false) {
- wifi_activate(__test_activated_callback, NULL);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
- }
-
- ret = wifi_get_connection_state(&connection_state);
- assert_eq(ret, WIFI_ERROR_NONE);
- if(connection_state == WIFI_CONNECTION_STATE_CONNECTED) {
- ret = wifi_get_connected_ap(&ap_h);
- assert_eq(ret, WIFI_ERROR_NONE);
- return 0;
- }
-
- wifi_scan(__test_scan_request_callback, NULL);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
-
- if(_get_value_from_configfile("WIFI_WPSACCESSPOINTNAME", configValue) == false)
- return -1;
- if(_get_value_from_configfile("WIFI_ACCESSPOINTPIN", g_passPhrase) == false)
- return -1;
-
- wifi_foreach_found_aps(__utc_wifi_foreach_found_aps_callback, configValue);
- RUN_GMAIN_LOOP;
- assert_eq(g_CallbackRet, WIFI_ERROR_NONE);
-
- ret = wifi_get_connected_ap(&ap_h);
+ ret = wifi_pre_connect();
assert_eq(ret, WIFI_ERROR_NONE);
return 0;
return 0;
}
+ ret = wifi_pre_connect();
+ assert_eq(ret, WIFI_ERROR_NONE);
+
ret = wifi_get_connected_ap(&g_hAp);
assert_eq(ret, WIFI_ERROR_NONE);
return 0;
}
+
+/**
+ * @testcase utc_wifi_connect_n1
+ * @since_tizen 2.3
+ * @type Negative
+ * @description Verify wifi_connect by passing invalid parameters.
+ * @scenario Try to connect Wi-Fi before initialization and ensure WIFI_ERROR_INVALID_OPERATION is reported.
+ */
+int utc_wifi_connect_n1(void)
+{
+ int ret = WIFI_ERROR_NONE;
+ if(g_wifi_supported == false) {
+ ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ wifi_deinitialize();
+
+ ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
+ wifi_initialize();
+
+ assert_eq(ret, WIFI_ERROR_INVALID_OPERATION);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_wifi_connect_n2
+ * @since_tizen 2.3
+ * @type Negative
+ * @description Verify wifi_connect by passing invalid parameters.
+ * @scenario Try to connect Wi-Fi with invalid AP handle and ensure WIFI_ERROR_INVALID_PARAMETER is reported.
+ */
+int utc_wifi_connect_n2(void)
+{
+ int ret = WIFI_ERROR_NONE;
+ if(g_wifi_supported == false) {
+ ret = wifi_connect(NULL, __test_activated_callback, NULL);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = wifi_connect(NULL, __test_activated_callback, NULL);
+
+ assert_eq(ret, WIFI_ERROR_INVALID_PARAMETER);
+
+ return 0;
+}
+
+/**
+ * @testcase utc_wifi_connect_p
+ * @since_tizen 2.3
+ * @type Positive
+ * @description Connects the access point asynchronously..
+ * @scenario Create AP handle and activate Wi-Fi. On acivattion Wi-Fi connection will
+ * be initiated to the AP.
+ */
+int utc_wifi_connect_p(void)
+{
+ int ret = WIFI_ERROR_NONE;
+
+ if(g_wifi_supported == false) {
+ ret = wifi_connect(g_hAp, __test_activated_callback, NULL);
+ assert_eq(ret, TIZEN_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
+ ret = wifi_pre_connect();
+ assert_eq(ret, WIFI_ERROR_NONE);
+
+ return 0;
+}