From: hyunuktak Date: Tue, 29 Nov 2016 05:25:28 +0000 (+0900) Subject: [UTC][connection][Non-ACR][Add to check telephony service state] X-Git-Tag: Public_Final_RC6~41^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3892b95974431714a1380ff3ccb8df8ae69b10b9;p=test%2Ftct%2Fnative%2Fapi.git [UTC][connection][Non-ACR][Add to check telephony service state] Change-Id: I49b4016ef874c23b9d88dcdab5ff13d9fc14999c Signed-off-by: hyunuktak --- diff --git a/src/utc/connection/utc-network-connection.c b/src/utc/connection/utc-network-connection.c index ab23db94c..7ecb5ecea 100755 --- a/src/utc/connection/utc-network-connection.c +++ b/src/utc/connection/utc-network-connection.c @@ -2153,21 +2153,28 @@ int utc_connection_open_profile_n(void) */ int utc_connection_close_profile_p(void) { - connection_profile_h profile_h = NULL; - int ret = test_get_any_profile(&profile_h); + connection_profile_h profile_h = NULL; + connection_cellular_state_e state; + int ret = connection_get_cellular_state(connection, &state); + assert_eq(ret, CONNECTION_ERROR_NONE); + if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE) { + fprintf(stderr, "Cellular state is out of service at %s:%d", __FILE__, __LINE__); + return 0; + } + + ret = test_get_any_profile(&profile_h); if(!telephony_supported && !wifi_supported && !bt_tethering_supported){ ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL); - assert_eq(ret, CONNECTION_ERROR_NOT_SUPPORTED); + assert_eq(ret, CONNECTION_ERROR_NOT_SUPPORTED); return 0; } - assert(profile_h); - profile_temp = profile_h; - ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL); - assert_eq(ret, CONNECTION_ERROR_NONE); - - return 0; + assert(profile_h); + profile_temp = profile_h; + ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL); + assert_eq(ret, CONNECTION_ERROR_NONE); + return 0; } /**