From: Anjali Nijhara Date: Fri, 25 Aug 2023 10:33:54 +0000 (+0530) Subject: [UTC][connection][ACR-1769] Add TCs for getting DHCP state X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6af6670c132ea3884a508775aff7b7f9bd4745ac;p=test%2Ftct%2Fnative%2Fapi.git [UTC][connection][ACR-1769] Add TCs for getting DHCP state Change-Id: Idf7dc2ab39e8849ed9c3103c71b33f4ad80bb48f --- diff --git a/src/utc/connection/tct-connection-core_mobile.h b/src/utc/connection/tct-connection-core_mobile.h index f0e25734c..21657dcf4 100755 --- a/src/utc/connection/tct-connection-core_mobile.h +++ b/src/utc/connection/tct-connection-core_mobile.h @@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void); extern int utc_connection_get_cellular_state_p(void); extern int utc_connection_get_ethernet_state_n(void); extern int utc_connection_get_ethernet_state_p(void); +extern int utc_connection_get_dhcp_state_n(void); +extern int utc_connection_get_dhcp_state_p(void); extern int utc_connection_get_wifi_state_n(void); extern int utc_connection_get_wifi_state_p(void); extern int utc_connection_get_bt_state_n(void); @@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(void); extern int utc_connection_set_internet_state_changed_cb_n2(void); extern int utc_connection_unset_internet_state_changed_cb_p(void); extern int utc_connection_unset_internet_state_changed_cb_n(void); +extern int utc_connection_set_dhcp_state_changed_cb_p(void); +extern int utc_connection_set_dhcp_state_changed_cb_n1(void); +extern int utc_connection_set_dhcp_state_changed_cb_n2(void); +extern int utc_connection_unset_dhcp_state_changed_cb_p(void); +extern int utc_connection_unset_dhcp_state_changed_cb_n(void); extern int utc_connection_profile_get_internet_state_p(void); extern int utc_connection_profile_get_internet_state_n1(void); extern int utc_connection_profile_get_internet_state_n2(void); @@ -366,6 +373,8 @@ testcase tc_array[] = { {"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, @@ -441,6 +450,11 @@ testcase tc_array[] = { {"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup}, diff --git a/src/utc/connection/tct-connection-core_tizeniot.h b/src/utc/connection/tct-connection-core_tizeniot.h index f0e25734c..21657dcf4 100755 --- a/src/utc/connection/tct-connection-core_tizeniot.h +++ b/src/utc/connection/tct-connection-core_tizeniot.h @@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void); extern int utc_connection_get_cellular_state_p(void); extern int utc_connection_get_ethernet_state_n(void); extern int utc_connection_get_ethernet_state_p(void); +extern int utc_connection_get_dhcp_state_n(void); +extern int utc_connection_get_dhcp_state_p(void); extern int utc_connection_get_wifi_state_n(void); extern int utc_connection_get_wifi_state_p(void); extern int utc_connection_get_bt_state_n(void); @@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(void); extern int utc_connection_set_internet_state_changed_cb_n2(void); extern int utc_connection_unset_internet_state_changed_cb_p(void); extern int utc_connection_unset_internet_state_changed_cb_n(void); +extern int utc_connection_set_dhcp_state_changed_cb_p(void); +extern int utc_connection_set_dhcp_state_changed_cb_n1(void); +extern int utc_connection_set_dhcp_state_changed_cb_n2(void); +extern int utc_connection_unset_dhcp_state_changed_cb_p(void); +extern int utc_connection_unset_dhcp_state_changed_cb_n(void); extern int utc_connection_profile_get_internet_state_p(void); extern int utc_connection_profile_get_internet_state_n1(void); extern int utc_connection_profile_get_internet_state_n2(void); @@ -366,6 +373,8 @@ testcase tc_array[] = { {"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, @@ -441,6 +450,11 @@ testcase tc_array[] = { {"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup}, diff --git a/src/utc/connection/tct-connection-core_tv.h b/src/utc/connection/tct-connection-core_tv.h index 8b08bfdda..c9b5d2831 100755 --- a/src/utc/connection/tct-connection-core_tv.h +++ b/src/utc/connection/tct-connection-core_tv.h @@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void); extern int utc_connection_get_cellular_state_p(void); extern int utc_connection_get_ethernet_state_n(void); extern int utc_connection_get_ethernet_state_p(void); +extern int utc_connection_get_dhcp_state_n(void); +extern int utc_connection_get_dhcp_state_p(void); extern int utc_connection_get_wifi_state_n(void); extern int utc_connection_get_wifi_state_p(void); extern int utc_connection_get_bt_state_n(void); @@ -224,6 +226,11 @@ extern int utc_connection_foreach_ipv6_address_p(void); extern int utc_connection_foreach_ipv6_address_n(void); extern int utc_connection_set_ethernet_cable_state_changed_cb_n(void); extern int utc_connection_unset_ethernet_cable_state_changed_cb_n(void); +extern int utc_connection_set_dhcp_state_changed_cb_p(void); +extern int utc_connection_set_dhcp_state_changed_cb_n1(void); +extern int utc_connection_set_dhcp_state_changed_cb_n2(void); +extern int utc_connection_unset_dhcp_state_changed_cb_p(void); +extern int utc_connection_unset_dhcp_state_changed_cb_n(void); extern int utc_connection_destroy_p(void); extern int utc_connection_destroy_n(void); @@ -358,6 +365,8 @@ testcase tc_array[] = { {"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, @@ -428,6 +437,11 @@ testcase tc_array[] = { {"utc_connection_foreach_ipv6_address_n", utc_connection_foreach_ipv6_address_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_set_ethernet_cable_state_changed_cb_n", utc_connection_set_ethernet_cable_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_ethernet_cable_state_changed_cb_n", utc_connection_unset_ethernet_cable_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_destroy_p", utc_connection_destroy_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_destroy_n", utc_connection_destroy_n, utc_network_connection_startup, utc_network_connection_cleanup}, {NULL, NULL} diff --git a/src/utc/connection/tct-connection-core_wearable.h b/src/utc/connection/tct-connection-core_wearable.h index f0e25734c..21657dcf4 100755 --- a/src/utc/connection/tct-connection-core_wearable.h +++ b/src/utc/connection/tct-connection-core_wearable.h @@ -154,6 +154,8 @@ extern int utc_connection_get_cellular_state_n(void); extern int utc_connection_get_cellular_state_p(void); extern int utc_connection_get_ethernet_state_n(void); extern int utc_connection_get_ethernet_state_p(void); +extern int utc_connection_get_dhcp_state_n(void); +extern int utc_connection_get_dhcp_state_p(void); extern int utc_connection_get_wifi_state_n(void); extern int utc_connection_get_wifi_state_p(void); extern int utc_connection_get_bt_state_n(void); @@ -229,6 +231,11 @@ extern int utc_connection_set_internet_state_changed_cb_n1(void); extern int utc_connection_set_internet_state_changed_cb_n2(void); extern int utc_connection_unset_internet_state_changed_cb_p(void); extern int utc_connection_unset_internet_state_changed_cb_n(void); +extern int utc_connection_set_dhcp_state_changed_cb_p(void); +extern int utc_connection_set_dhcp_state_changed_cb_n1(void); +extern int utc_connection_set_dhcp_state_changed_cb_n2(void); +extern int utc_connection_unset_dhcp_state_changed_cb_p(void); +extern int utc_connection_unset_dhcp_state_changed_cb_n(void); extern int utc_connection_profile_get_internet_state_p(void); extern int utc_connection_profile_get_internet_state_n1(void); extern int utc_connection_profile_get_internet_state_n2(void); @@ -366,6 +373,8 @@ testcase tc_array[] = { {"utc_connection_get_cellular_state_p", utc_connection_get_cellular_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_n", utc_connection_get_ethernet_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_ethernet_state_p", utc_connection_get_ethernet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_n", utc_connection_get_dhcp_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_get_dhcp_state_p", utc_connection_get_dhcp_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_n", utc_connection_get_wifi_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_wifi_state_p", utc_connection_get_wifi_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_get_bt_state_n", utc_connection_get_bt_state_n, utc_network_connection_startup, utc_network_connection_cleanup}, @@ -441,6 +450,11 @@ testcase tc_array[] = { {"utc_connection_set_internet_state_changed_cb_n2", utc_connection_set_internet_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_p", utc_connection_unset_internet_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_unset_internet_state_changed_cb_n", utc_connection_unset_internet_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_p", utc_connection_set_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n1", utc_connection_set_dhcp_state_changed_cb_n1, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_set_dhcp_state_changed_cb_n2", utc_connection_set_dhcp_state_changed_cb_n2, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_p", utc_connection_unset_dhcp_state_changed_cb_p, utc_network_connection_startup, utc_network_connection_cleanup}, + {"utc_connection_unset_dhcp_state_changed_cb_n", utc_connection_unset_dhcp_state_changed_cb_n, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_p", utc_connection_profile_get_internet_state_p, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n1", utc_connection_profile_get_internet_state_n1, utc_network_connection_startup, utc_network_connection_cleanup}, {"utc_connection_profile_get_internet_state_n2", utc_connection_profile_get_internet_state_n2, utc_network_connection_startup, utc_network_connection_cleanup}, diff --git a/src/utc/connection/utc-network-connection.c b/src/utc/connection/utc-network-connection.c index 45e4cbabe..6d244fc21 100755 --- a/src/utc/connection/utc-network-connection.c +++ b/src/utc/connection/utc-network-connection.c @@ -73,6 +73,12 @@ static void test_connection_internet_state_changed_callback(connection_internet_ PRINT_RETURN("test_connection_internet_state_changed_callback", CONNECTION_ERROR_NONE); } +static void test_connection_dhcp_state_changed_callback(connection_dhcp_state_e state, + const char *interface_name, connection_error_e result, void *user_data) +{ + PRINT_RETURN("test_connection_dhcp_state_changed_callback", CONNECTION_ERROR_NONE); +} + static int test_get_profile_by_name(connection_profile_h *profile, char *name) { connection_profile_h profile_h; @@ -562,6 +568,64 @@ int utc_connection_get_ethernet_state_p(void) return 0; } +/** + * @testcase utc_connection_get_dhcp_state_n + * @since_tizen 8.0 + * @type Negative + * @description connection_get_dhcp_state should fail with invalid parameter. + * @scenario Verify connection_get_dhcp_state by passing invalid parameter. + */ +int utc_connection_get_dhcp_state_n(void) +{ + int ret; + connection_dhcp_state_e state; + + if(all_features_not_supported) { + ret = connection_get_dhcp_state(NULL, NULL, NULL); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NOT_SUPPORTED); + return 0; + } + + ret = connection_get_dhcp_state(NULL, NULL, &state); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + ret = connection_get_dhcp_state(NULL, "wlan0", NULL); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + ret = connection_get_dhcp_state(NULL, "wlan0", &state); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + ret = connection_get_dhcp_state(connection, NULL, NULL); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + ret = connection_get_dhcp_state(connection, "wlan0", NULL); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + ret = connection_get_dhcp_state(connection, NULL, &state); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_INVALID_PARAMETER); + + return 0; +} + +/** + * @testcase utc_connection_get_dhcp_state_p + * @since_tizen 8.0 + * @type Positive + * @description Gets the DHCP state of the interface + * @scenario Invoking connection_get_dhcp_state with valid parameter. + */ +int utc_connection_get_dhcp_state_p(void) +{ + int ret; + connection_dhcp_state_e state; + + if (all_features_not_supported) { + ret = connection_get_dhcp_state(connection, NULL, &state); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NOT_SUPPORTED); + return 0; + } + + ret = connection_get_dhcp_state(connection, "wlan0", &state); + CHECK_RETURN("connection_get_dhcp_state", ret, CONNECTION_ERROR_NONE); + + return 0; +} + /** * @testcase utc_connection_get_wifi_state_n * @since_tizen 2.3 @@ -2612,6 +2676,93 @@ int utc_connection_unset_internet_state_changed_cb_n(void) return 0; } +/** + * @testcase utc_connection_set_dhcp_state_changed_cb_p + * @since_tizen 8.0 + * @type Positive + * @description Set DHCP state changed callback. + * @scenario Verify connection_set_dhcp_state_changed_cb by passing valid parameter. + */ +int utc_connection_set_dhcp_state_changed_cb_p(void) +{ + int ret; + ret = connection_set_dhcp_state_changed_cb(connection, + test_connection_dhcp_state_changed_callback, NULL); + + CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_NONE); + + return 0; +} + +/** + * @testcase utc_connection_set_dhcp_state_changed_cb_n1 + * @since_tizen 8.0 + * @type Negative + * @description connection_set_dhcp_state_changed_cb should fail when connection is NULL. + * @scenario Verify connection_set_dhcp_state_changed_cb by passing connection as NULL. + */ +int utc_connection_set_dhcp_state_changed_cb_n1(void) +{ + int ret; + ret = connection_set_dhcp_state_changed_cb(NULL, + test_connection_dhcp_state_changed_callback, NULL); + + CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER); + + return 0; +} + +/** + * @testcase utc_connection_set_internet_state_changed_cb_n2 + * @since_tizen 8.0 + * @type Negative + * @description connection_set_dhcp_state_changed_cb should fail when callback is NULL. + * @scenario Verify connection_set_dhcp_state_changed_cb by passing callback as NULL. + */ +int utc_connection_set_dhcp_state_changed_cb_n2(void) +{ + int ret; + ret = connection_set_dhcp_state_changed_cb(connection, NULL, NULL); + + CHECK_RETURN("connection_set_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER); + + return 0; +} + +/** + * @testcase utc_connection_unset_dhcp_state_changed_cb_p + * @since_tizen 8.0 + * @type Positive + * @description Unset DHCP state changed callback. + * @scenario Verify connection_unset_dhcp_state_changed_cb by passing valid parameter. + */ +int utc_connection_unset_dhcp_state_changed_cb_p(void) +{ + int ret; + ret = connection_unset_dhcp_state_changed_cb(connection); + + CHECK_RETURN("connection_unset_dhcp_state_changed_cb", ret, CONNECTION_ERROR_NONE); + + return 0; +} + +/** + * @testcase utc_connection_unset_dhcp_state_changed_cb_n + * @since_tizen 8.0 + * @type Negative + * @description connection_unset_dhcp_state_changed_cb should fail when connection is NULL. + * @scenario Verify connection_unset_dhcp_state_changed_cb by passing connection as NULL. + */ +int utc_connection_unset_dhcp_state_changed_cb_n(void) +{ + int ret; + ret = connection_unset_dhcp_state_changed_cb(NULL); + + CHECK_RETURN("connection_unset_dhcp_state_changed_cb", ret, CONNECTION_ERROR_INVALID_PARAMETER); + + return 0; +} + /** * @testcase utc_connection_destroy_p * @since_tizen 2.3