return 0;
}
+//& purpose: To get profile connection internet state
+//& type : auto
+/**
+* @testcase ITc_connection_profile_get_internet_state_p
+* @since_tizen 5.5
+* @author SRID(manoj.g2)
+* @reviewer SRID(shobhit.v)
+* @description To get profile connection internet state
+* @apicovered connection_profile_get_internet_state
+* @passcase When connection_profile_get_internet_state return CONNECTION_ERROR_NONE
+* @failcase When connection_profile_get_internet_state not return CONNECTION_ERROR_NONE
+* @precondition None
+* @postcondition None
+*/
+int ITc_connection_profile_get_internet_state_p(void)
+{
+ START_TEST;
+
+ connection_internet_state_e eConectionState = -1;
+ int nRet = connection_profile_get_internet_state(g_hConnectionProfileHandleCellular, &eConectionState);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_profile_get_internet_state", ConnectionGetError(nRet));
+
+ if(eConectionState > CONNECTION_INTERNET_STATE_ONLINE || eConectionState < CONNECTION_INTERNET_STATE_OFFLINE)
+ {
+ FPRINTF("[Line : %d][%s] connection state is invalid=%d\\n", __LINE__, API_NAMESPACE, eConectionState);
+ return 1;
+ }
+ return 0;
+}
return false;
}
+void ConnectionInternetStateChangedCB(connection_internet_state_e state, void* user_data)
+{
+ FPRINTF("[Line : %d][%s]Inside ConnectionInternetStateChangedCB callback\n", __LINE__, API_NAMESPACE);
+}
void test_network_state_changed_cb(connection_type_e state, void* user_data)
{
FPRINTF("[Line : %d][%s]Inside test_network_state_changed_cb\\n", __LINE__, API_NAMESPACE);
return 0;
}
+//& purpose: To check whether internet state changed
+//& type : auto
+/**
+* @testcase ITc_connection_set_unset_internet_state_changed_cb_p
+* @since_tizen 5.5
+* @author SRID(manoj.g2)
+* @reviewer SRID(shobhit.v)
+* @description To check for internet state changed callback .
+* @apicovered connection_set_internet_state_changed_cb, connection_unset_internet_state_changed_cb
+* @passcase When connection_set_internet_state_changed_cb, connection_unset_internet_state_changed_cb return CONNECTION_ERROR_NONE
+* @failcase When connection_set_internet_state_changed_cb, connection_unset_internet_state_changed_cb not return CONNECTION_ERROR_NONE
+* @precondition None
+* @postcondition None
+*/
+
+int ITc_connection_set_unset_internet_state_changed_cb_p(void)
+{
+ START_TEST;
+
+ if (g_nPreconditionError == 1)
+ {
+ FPRINTF("[Line: %d][%s] ITc_connection_set_unset_internet_state_changed_cb_p failed\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ int nRet = -1;
+
+ nRet = connection_set_internet_state_changed_cb(g_hConnection, ConnectionInternetStateChangedCB, NULL);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_set_internet_state_changed_cb", ConnectionGetError(nRet));
+
+ nRet = connection_unset_internet_state_changed_cb(g_hConnection);
+ PRINT_RESULT(CONNECTION_ERROR_NONE, nRet, "connection_unset_internet_state_changed_cb", ConnectionGetError(nRet));
+
+ return 0;
+}
/** @} */
/** @} */
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
+extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
+extern int ITc_connection_profile_get_internet_state_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{NULL, NULL}
};
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
+extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
+extern int ITc_connection_profile_get_internet_state_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{NULL, NULL}
};
extern int ITc_connection_profile_get_dhcp_server_address_p(void);
extern int ITc_connection_profile_get_dhcp_lease_duration_p(void);
extern int ITc_connection_is_metered_network_p(void);
+extern int ITc_connection_set_unset_internet_state_changed_cb_p(void);
+extern int ITc_connection_profile_get_internet_state_p(void);
testcase tc_array[] = {
{"ITc_connection_profile_get_dhcp_server_address_p",ITc_connection_profile_get_dhcp_server_address_p,ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_add_remove_route_entry_p",ITc_connection_add_remove_route_entry_p,ITs_connection_startup,ITs_connection_cleanup},
{"ITc_connection_profile_get_dhcp_lease_duration_p", ITc_connection_profile_get_dhcp_lease_duration_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{"ITc_connection_is_metered_network_p", ITc_connection_is_metered_network_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_set_unset_internet_state_changed_cb_p", ITc_connection_set_unset_internet_state_changed_cb_p, ITs_connection_startup, ITs_connection_cleanup},
+ {"ITc_connection_profile_get_internet_state_p", ITc_connection_profile_get_internet_state_p, ITs_connection_profile_startup, ITs_connection_profile_cleanup},
{NULL, NULL}
};