Modify some test code 74/69674/4
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 16 May 2016 09:51:44 +0000 (18:51 +0900)
committertaesubkim <taesub.kim@samsung.com>
Tue, 17 May 2016 05:28:20 +0000 (14:28 +0900)
Change-Id: I213bdb7ba5721ea575585a94aebc9cd887c1569a
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/capi-network-connection.spec
test/connection_test.c

index 1633425..02347ae 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-connection
 Summary:       Network Connection library in TIZEN C API
-Version:       1.0.84
+Version:       1.0.85
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index ec4cfcb..7d6007f 100755 (executable)
@@ -167,6 +167,32 @@ static const char *test_print_cellular_service_type(connection_cellular_service_
        }
 }
 
+static const char* test_print_cellular_auth_type(connection_cellular_auth_type_e type)
+{
+       switch (type) {
+       case CONNECTION_CELLULAR_AUTH_TYPE_NONE:
+               return "None";
+       case CONNECTION_CELLULAR_AUTH_TYPE_PAP:
+               return "PAP";
+       case CONNECTION_CELLULAR_AUTH_TYPE_CHAP:
+               return "CHAP";
+       }
+}
+
+static const char* test_print_cellular_pdn_type(connection_cellular_pdn_type_e type)
+{
+       switch (type) {
+       case CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN:
+               return "Unknown";
+       case CONNECTION_CELLULAR_PDN_TYPE_IPV4:
+               return "IPv4";
+       case CONNECTION_CELLULAR_PDN_TYPE_IPV6:
+               return "IPv6";
+       case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6:
+               return "Dual";
+       }
+}
+
 static const char *test_print_error(connection_error_e error)
 {
        switch (error) {
@@ -666,17 +692,17 @@ static void test_print_cellular_info(connection_profile_h profile)
        if (connection_profile_get_cellular_service_type(profile, &service_type) != CONNECTION_ERROR_NONE)
                printf("Fail to get cellular service type!\n");
        else
-               printf("Cellular service type : %d\n", service_type);
+               printf("Cellular service type : %s\n", test_print_cellular_service_type(service_type));
 
        if (connection_profile_get_cellular_pdn_type(profile, &pdn_type) != CONNECTION_ERROR_NONE)
                printf("Fail to get cellular pdn type!\n");
        else
-               printf("Cellular pdn type : %d\n", pdn_type);
+               printf("Cellular pdn type : %s\n", test_print_cellular_pdn_type(pdn_type));
 
        if (connection_profile_get_cellular_roam_pdn_type(profile, &roam_pdn_type) != CONNECTION_ERROR_NONE)
                printf("Fail to get cellular roam pdn type!\n");
        else
-               printf("Cellular roam pdn type : %d\n", roam_pdn_type);
+               printf("Cellular roam pdn type : %s\n", test_print_cellular_pdn_type(roam_pdn_type));
 
        if (connection_profile_get_cellular_apn(profile, &apn) != CONNECTION_ERROR_NONE)
                printf("Fail to get cellular APN!\n");
@@ -688,7 +714,7 @@ static void test_print_cellular_info(connection_profile_h profile)
        if (connection_profile_get_cellular_auth_info(profile, &auth_type, &user_name, &password) != CONNECTION_ERROR_NONE)
                printf("Fail to get auth info!\n");
        else {
-               printf("Cellular auth type : %d\n", auth_type);
+               printf("Cellular auth type : %s\n", test_print_cellular_auth_type(auth_type));
                printf("Cellular user_name : %s\n", user_name);
                printf("Cellular password : %s\n", password);
                g_free(user_name);