*/
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;
}
/**