From 74e945d1674d21d641acd691e7f82825a0c6ba9f Mon Sep 17 00:00:00 2001 From: Saurav Babu Date: Thu, 7 Jul 2016 11:45:22 +0530 Subject: [PATCH] [connection] Modified test code to print ethernet information correctly 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 --- test/connection_test.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/test/connection_test.c b/test/connection_test.c index 332b1f2..1c53099 100755 --- a/test/connection_test.c +++ b/test/connection_test.c @@ -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) -- 2.7.4