[connection] Modified test code to print ethernet information correctly 48/78848/1 accepted/tizen/common/20160805.125931 accepted/tizen/ivi/20160809.010542 accepted/tizen/mobile/20160809.010454 accepted/tizen/tv/20160809.010507 accepted/tizen/wearable/20160809.010525 submit/tizen/20160805.043033
authorSaurav Babu <saurav.babu@samsung.com>
Thu, 7 Jul 2016 06:15:22 +0000 (11:45 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Thu, 7 Jul 2016 06:15:22 +0000 (11:45 +0530)
This patch has below changes:
1. Print ethernet information correctly in
test_get_user_selected_profile(), earlier ethernet was treated as
cellular profiles.
2. For WiFi profile_name and essid are same so no need to print both.
3. Print cellular service type only for cellular profiles.

Change-Id: I560fbb5dddd8a6534de6637b2ce450bca0fd2424
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
test/connection_test.c

index 332b1f2..1c53099 100755 (executable)
@@ -350,28 +350,22 @@ static bool test_get_user_selected_profile(connection_profile_h *profile, bool s
                        return false;
                }
 
-               if (profile_type == CONNECTION_PROFILE_TYPE_WIFI) {
-                       char *essid;
-                       connection_profile_get_wifi_essid(profile_h, &essid);
-                       printf("%d. state:[%s], profile name:%s, essid:%s\n",
-                               profile_count, test_print_state(profile_state),
-                               profile_name, (essid) ? essid : "");
-                       g_free(essid);
-
-                       profile_list[profile_count] = profile_h;
-                       profile_count++;
-               } else {
+               printf("%d. state:[%s], profile name:%s", profile_count,
+                               test_print_state(profile_state), profile_name);
+               if (profile_type == CONNECTION_PROFILE_TYPE_CELLULAR) {
                        connection_cellular_service_type_e service_type;
-                       if (connection_profile_get_cellular_service_type(profile_h, &service_type) != CONNECTION_ERROR_NONE)
+                       if (connection_profile_get_cellular_service_type(
+                               profile_h, &service_type) !=
+                               CONNECTION_ERROR_NONE)
                                printf("Fail to get cellular service type!\n");
 
-                       printf("%d. state:[%s], profile name:%s[%s]\n",
-                               profile_count, test_print_state(profile_state),
-                               profile_name, test_print_cellular_service_type(service_type));
-
-                       profile_list[profile_count] = profile_h;
-                       profile_count++;
+                       printf("[%s]",
+                               test_print_cellular_service_type(service_type));
                }
+               printf("\n");
+
+               profile_list[profile_count] = profile_h;
+               profile_count++;
 
                g_free(profile_name);
                if (profile_count >= 100)