*/
int utc_connection_close_profile_p(void)
{
+ int ret;
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);
return 0;
}
+ if (telephony_supported) {
+ 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);
+
assert(profile_h);
profile_temp = profile_h;
ret = connection_close_profile(connection, profile_temp, test_connection_closed_callback, NULL);