Modified wifi_manager_test file for testhub 22/183822/2 accepted/tizen/unified/20180712.092642 submit/tizen/20180711.084813
authortaesub kim <taesub.kim@samsung.com>
Wed, 11 Jul 2018 07:47:11 +0000 (16:47 +0900)
committertaesub kim <taesub.kim@samsung.com>
Wed, 11 Jul 2018 08:42:20 +0000 (17:42 +0900)
Change-Id: If9d99f47a79d3d82686718c7abe6d0c5b5d9cd21
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
test/wifi_manager_test.c

index 4656c72..695104b 100755 (executable)
@@ -1945,37 +1945,22 @@ int test_wifi_manager_forget_ap(void)
        int rv = 0;
        char ap_name[33];
        bool state = false;
-       int use_async;
 
        wifi_manager_is_activated(wifi, &state);
        if (state == false)
                return -1;
 
-       printf("Forget AP using async API? (0/1) : ");
-       rv = scanf("%1d", &use_async);
-
        printf("Input a part of AP name to forget : ");
        rv = scanf("%32s", ap_name);
 
-       if (use_async) {
-               rv = wifi_manager_foreach_found_ap(wifi, __test_found_forget_ap_async_callback, ap_name);
-               if (rv != WIFI_MANAGER_ERROR_NONE) {
-                       printf("Fail to forget (can't get AP list) [%s]\n", __test_convert_error_to_string(rv));
-                       return -1;
-               }
-
-               printf("Forget AP async finished\n");
-
-       } else {
-               rv = wifi_manager_foreach_found_ap(wifi, __test_found_forget_ap_callback, ap_name);
-               if (rv != WIFI_MANAGER_ERROR_NONE) {
-                       printf("Fail to forget (can't get AP list) [%s]\n", __test_convert_error_to_string(rv));
-                       return -1;
-               }
-
-               printf("Forget AP finished\n");
+       rv = wifi_manager_foreach_found_ap(wifi, __test_found_forget_ap_callback, ap_name);
+       if (rv != WIFI_MANAGER_ERROR_NONE) {
+               printf("Fail to forget (can't get AP list) [%s]\n", __test_convert_error_to_string(rv));
+               return -1;
        }
 
+       printf("Forget AP finished\n");
+
        return 1;
 }
 
@@ -2491,6 +2476,30 @@ int test_wifi_manager_get_wps_generated_pin(void)
        return 1;
 }
 
+int test_wifi_manager_forget_ap_async(void)
+{
+       int rv = 0;
+       char ap_name[33];
+       bool state = false;
+
+       wifi_manager_is_activated(wifi, &state);
+       if (state == false)
+               return -1;
+
+       printf("Input a part of AP name to forget : ");
+       rv = scanf("%32s", ap_name);
+
+       rv = wifi_manager_foreach_found_ap(wifi, __test_found_forget_ap_async_callback, ap_name);
+       if (rv != WIFI_MANAGER_ERROR_NONE) {
+               printf("Fail to forget (can't get AP list) [%s]\n", __test_convert_error_to_string(rv));
+               return -1;
+       }
+
+       printf("Forget AP async finished\n");
+
+       return 1;
+}
+
 int test_wifi_manager_set_autoscan_state(void)
 {
        int autoscan = 0;
@@ -3269,22 +3278,23 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
                printf("G   - Get IP conflict detection mode\n");
                printf("H   - Get IP conflict state\n");
                printf("I   - Get generated PIN number\n");
+               printf("J   - Forget an AP(async)\n");
 /* Extension APIs */
                printf(LOG_BLUE "[Extension API]\n" LOG_END);
-               printf("J   - Set Enable or Disable Auto Scan\n");
-               printf("K   - Set Mode of Auto Scan\n");
-               printf("L   - Get Enable or Disable Auto Scan\n");
-               printf("M   - Get Mode of Auto Scan\n");
-               printf("N   - Flush BSS\n");
-               printf("O   - Set enable or disable auto connect\n");
-               printf("P   - Get enable or disable auto connect\n");
-               printf("Q   - Set enable or disable of Wi-Fi profile auto-connect\n");
-               printf("R   - Get enable or disable of Wi-Fi profile auto-connect\n");
-               printf("S   - Set the IP conflict detection period\n");
-               printf("T   - Get the IP conflict detection period\n");
-               printf("U   - Netlink Scan Normal/Specific-AP\n");
-               printf("V   - Get passpoint state\n");
-               printf("W   - Set passpoint on/off\n");
+               printf("K   - Set Enable or Disable Auto Scan\n");
+               printf("L   - Set Mode of Auto Scan\n");
+               printf("M   - Get Enable or Disable Auto Scan\n");
+               printf("N   - Get Mode of Auto Scan\n");
+               printf("O   - Flush BSS\n");
+               printf("P   - Set enable or disable auto connect\n");
+               printf("Q   - Get enable or disable auto connect\n");
+               printf("R   - Set enable or disable of Wi-Fi profile auto-connect\n");
+               printf("S   - Get enable or disable of Wi-Fi profile auto-connect\n");
+               printf("T   - Set the IP conflict detection period\n");
+               printf("U   - Get the IP conflict detection period\n");
+               printf("V   - Netlink Scan Normal/Specific-AP\n");
+               printf("W   - Get passpoint state\n");
+               printf("X   - Set passpoint on/off\n");
                printf(LOG_RED "0   - Exit \n" LOG_END);
 
                printf("ENTER  - Show options menu.......\n");
@@ -3424,48 +3434,51 @@ gboolean test_thread(GIOChannel *source, GIOCondition condition, gpointer data)
        case 'I':
                rv = test_wifi_manager_get_wps_generated_pin();
                break;
+       case 'J':
+               rv = test_wifi_manager_forget_ap_async();
+               break;
 
 /* Extension APIs */
-       case 'J':
+       case 'K':
                rv = test_wifi_manager_set_autoscan_state();
                break;
-       case 'K':
+       case 'L':
                rv = test_wifi_manager_set_autoscan_mode();
                break;
-       case 'L':
+       case 'M':
                rv = test_wifi_manager_get_autoscan_state();
                break;
-       case 'M':
+       case 'N':
                rv = test_wifi_manager_get_autoscan_mode();
                break;
-       case 'N':
+       case 'O':
                rv = test_wifi_manager_flush_bss();
                break;
-       case 'O':
+       case 'P':
                rv = test_wifi_manager_set_auto_connect();
                break;
-       case 'P':
+       case 'Q':
                rv = test_wifi_manager_get_auto_connect();
                break;
-       case 'Q':
+       case 'R':
                rv = test_wifi_manager_set_ap_auto_connect();
                break;
-       case 'R':
+       case 'S':
                rv = test_wifi_manager_get_ap_auto_connect();
                break;
-       case 'S':
+       case 'T':
                rv = test_wifi_manager_set_ip_conflict_period();
                break;
-       case 'T':
+       case 'U':
                rv = test_wifi_manager_get_ip_conflict_period();
                break;
-       case 'U':
+       case 'V':
                rv = test_wifi_manager_netlink_scan();
                break;
-       case 'V':
+       case 'W':
                rv = test_wifi_manager_get_passpoint_state();
                break;
-       case 'W':
+       case 'X':
                rv = test_wifi_manager_set_passpoint_enable();
                break;
        default: