From: wchang kim Date: Fri, 30 Jun 2023 01:43:06 +0000 (+0900) Subject: Fixed the build error using gcc 13 X-Git-Tag: accepted/tizen/unified/20230705.063701^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ca7c94f8b35a4825ff6ba43034fcfb6b98557c9;p=platform%2Fcore%2Fapi%2Fconnection.git Fixed the build error using gcc 13 Change-Id: I2f2fdb223eafd5ebf0ebabd3654a0801efb26000 --- diff --git a/test/connection_test.c b/test/connection_test.c index 417c1d6..dc3d86b 100755 --- a/test/connection_test.c +++ b/test/connection_test.c @@ -2304,7 +2304,7 @@ static bool test_get_ipv6_address_callback(char *ipv6_address, void* user_data) int test_foreach_ipv6_address(void) { int rv = 0; - int type; + int type = 0; connection_type_e conn_type; test_get_user_int("Input Connection Type(1: WiFi 2: Ethernet) :", &type); diff --git a/unittest/mock/connection-mock.c b/unittest/mock/connection-mock.c index 691aa86..28d8ead 100755 --- a/unittest/mock/connection-mock.c +++ b/unittest/mock/connection-mock.c @@ -563,9 +563,9 @@ static void __net_add_profile_wifi(net_profile_info_t **profile_info, int *profi Wlan->security_info.enc_mode = wifi_profile[i].enc_mode; Wlan->passpoint = wifi_profile[i].passpoint; Wlan->strength = wifi_profile[i].strength; - if (wifi_profile[i].essid) + if (strlen(wifi_profile[i].essid) != 0) g_strlcpy(Wlan->essid, wifi_profile[i].essid, NET_WLAN_ESSID_LEN); - if (wifi_profile[i].bssid) + if (strlen(wifi_profile[i].bssid) != 0) g_strlcpy(Wlan->bssid, wifi_profile[i].bssid, NET_MAX_MAC_ADDR_LEN); Wlan->max_rate = wifi_profile[i].max_rate; Wlan->frequency = wifi_profile[i].frequency; diff --git a/unittest/utc-connection-common.c b/unittest/utc-connection-common.c index 12c8446..95ee2ee 100755 --- a/unittest/utc-connection-common.c +++ b/unittest/utc-connection-common.c @@ -16,6 +16,22 @@ #include "utc-connection-common.h" +GMainLoop *g_pMainLoop; +guint g_nTimeoutId; +int g_CallbackRet; + +bool wifi_supported; +bool telephony_supported; +bool bt_tethering_supported; +bool ethernet_supported; +bool route_supported; +bool all_features_not_supported; + +connection_profile_h profile_cellular; +connection_profile_h profile_wifi; +connection_profile_h profile_temp; +connection_h connection; + gboolean test_connection_timeout_callback(gpointer data) { g_CallbackRet = CONNECTION_ERROR_OPERATION_FAILED; diff --git a/unittest/utc-connection-common.h b/unittest/utc-connection-common.h index 4361a2c..c87641f 100755 --- a/unittest/utc-connection-common.h +++ b/unittest/utc-connection-common.h @@ -43,21 +43,21 @@ #define FEATURE_ROUTE "http://tizen.org/feature/network.route" #define CALLBACK_RETURN "callback return" -GMainLoop *g_pMainLoop; -guint g_nTimeoutId; -int g_CallbackRet; - -bool wifi_supported; -bool telephony_supported; -bool bt_tethering_supported; -bool ethernet_supported; -bool route_supported; -bool all_features_not_supported; - -connection_profile_h profile_cellular; -connection_profile_h profile_wifi; -connection_profile_h profile_temp; -connection_h connection; +extern GMainLoop *g_pMainLoop; +extern guint g_nTimeoutId; +extern int g_CallbackRet; + +extern bool wifi_supported; +extern bool telephony_supported; +extern bool bt_tethering_supported; +extern bool ethernet_supported; +extern bool route_supported; +extern bool all_features_not_supported; + +extern connection_profile_h profile_cellular; +extern connection_profile_h profile_wifi; +extern connection_profile_h profile_temp; +extern connection_h connection; #define RUN_GMAIN_LOOP { \ g_pMainLoop = g_main_loop_new(NULL, false); \