From: Wootak Jung Date: Wed, 13 Feb 2019 06:48:25 +0000 (+0900) Subject: Exclude coverage for internal APIs X-Git-Tag: submit/tizen/20190311.071331~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F199588%2F1;p=platform%2Fcore%2Fapi%2Fbluetooth.git Exclude coverage for internal APIs Change-Id: I365d83a0a761e0694004016e47fc14f0ac3e3ab2 --- diff --git a/src/bluetooth-adapter.c b/src/bluetooth-adapter.c index 875a855..0eee5e7 100644 --- a/src/bluetooth-adapter.c +++ b/src/bluetooth-adapter.c @@ -688,13 +688,13 @@ int bt_adapter_get_bonded_device_info(const char *remote_address, if (ret != BT_ERROR_NONE) { BT_ERR("%s(0x%08x) : Failed to run function", _bt_convert_error_to_string(ret), - ret); /* LCOV_EXCL_LINE */ + ret); } else { ret = _bt_get_bt_device_info_s(device_info, info); if (ret != BT_ERROR_NONE) { BT_ERR("%s(0x%08x) : Failed to get device info", _bt_convert_error_to_string(ret), - ret); /* LCOV_EXCL_LINE */ + ret); } } @@ -806,7 +806,8 @@ int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid, g_ptr_array_free(addr_list, TRUE); return ret; -} /* LCOV_EXCL_STOP */ +} +/* LCOV_EXCL_STOP */ int bt_adapter_set_state_changed_cb(bt_adapter_state_changed_cb callback, void *user_data) @@ -1063,12 +1064,12 @@ int bt_adapter_set_remote_oob_data(const char *remote_address, ret = _bt_get_error_code(bluetooth_oob_add_remote_data(&addr_hex, BLUETOOTH_BDADDR_BREDR, - &oob_data)); /* LCOV_EXCL_STOP */ - if (BT_ERROR_NONE != ret) { /* LCOV_EXCL_LINE */ + &oob_data)); + if (BT_ERROR_NONE != ret) { BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), - ret); /* LCOV_EXCL_LINE */ - } /* LCOV_EXCL_LINE */ - return ret; + ret); + } + return ret; /* LCOV_EXCL_STOP */ } int bt_adapter_get_local_oob_ext_data(unsigned char **hash192, unsigned char **randomizer192, @@ -1173,9 +1174,10 @@ int bt_adapter_set_remote_oob_ext_data(const char *remote_address, if (BT_ERROR_NONE != ret) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); - return ret; + return ret; /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ int bt_adapter_le_set_remote_oob_ext_data(const char *remote_address, bt_device_address_type_e address_type, const unsigned char *hash256, const unsigned char *randomizer256, @@ -1218,7 +1220,7 @@ int bt_adapter_le_set_remote_oob_ext_data(const char *remote_address, return ret; } -/* LCOV_EXCL_START */ +/* LCOV_EXCL_STOP */ int bt_adapter_remove_remote_oob_data(const char *remote_address) { @@ -1262,10 +1264,10 @@ int bt_adapter_set_manufacturer_data(char *data, int len) memcpy(&m_data.data[2], data, len); ret = _bt_get_error_code(bluetooth_set_manufacturer_data(&m_data)); - if (ret != BT_ERROR_NONE) { /* LCOV_EXCL_LINE */ + if (ret != BT_ERROR_NONE) { BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), - ret); /* LCOV_EXCL_LINE */ - } /* LCOV_EXCL_LINE */ + ret); + } return ret; } @@ -1463,6 +1465,7 @@ int bt_adapter_le_remove_white_list(const char *address, bt_device_address_type_ return error_code; } +/* LCOV_EXCL_STOP */ int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode) { @@ -1494,6 +1497,7 @@ int bt_adapter_le_set_scan_mode(bt_adapter_le_scan_mode_e scan_mode) return ret; } +/* LCOV_EXCL_START */ int bt_adapter_le_set_customized_scan_mode(float scan_interval, float scan_window) { int ret = BT_ERROR_NONE; @@ -1510,7 +1514,8 @@ int bt_adapter_le_set_customized_scan_mode(float scan_interval, float scan_windo BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); return ret; -} /* LCOV_EXCL_STOP */ +} +/* LCOV_EXCL_STOP */ int bt_adapter_le_create_advertiser(bt_advertiser_h *advertiser) { @@ -1589,11 +1594,11 @@ static int __bt_remove_ad_data_by_type(char *in_data, unsigned int in_len, int type = 0; char *p; - for (i = 0; i < in_len; i++) { /* LCOV_EXCL_LINE */ + for (i = 0; i < in_len; i++) { len = in_data[i]; if (len <= 0 || i + 1 >= in_len) { - BT_ERR("Invalid advertising data"); /* LCOV_EXCL_LINE */ - return BT_ERROR_OPERATION_FAILED; /* LCOV_EXCL_LINE */ + BT_ERR("Invalid advertising data"); + return BT_ERROR_OPERATION_FAILED; } type = in_data[i + 1]; @@ -1603,13 +1608,13 @@ static int __bt_remove_ad_data_by_type(char *in_data, unsigned int in_len, break; } - i += len; /* LCOV_EXCL_LINE */ - len = 0; /* LCOV_EXCL_LINE */ + i += len; + len = 0; } if (i + len > in_len) { - BT_ERR("Invalid advertising data"); /* LCOV_EXCL_LINE */ - return BT_ERROR_OPERATION_FAILED; /* LCOV_EXCL_LINE */ + BT_ERR("Invalid advertising data"); + return BT_ERROR_OPERATION_FAILED; } else if (len == 0) { BT_INFO("AD Type 0x%02x data is not set", in_type); return BT_ERROR_OPERATION_FAILED; @@ -1723,15 +1728,15 @@ static int bt_adapter_le_remove_advertising_data(bt_advertiser_h advertiser, break; case BT_ADAPTER_LE_PACKET_SCAN_RESPONSE: - p = &__adv->scan_rsp_data; /* LCOV_EXCL_LINE */ - len = &__adv->scan_rsp_data_len; /* LCOV_EXCL_LINE */ - system_data_len = &__adv->scan_rsp_system_data_len; /* LCOV_EXCL_LINE */ - break; /* LCOV_EXCL_LINE */ + p = &__adv->scan_rsp_data; + len = &__adv->scan_rsp_data_len; + system_data_len = &__adv->scan_rsp_system_data_len; + break; default: BT_ERR("Unknown LE packet type : %d", - pkt_type); /* LCOV_EXCL_LINE */ - return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */ + pkt_type); + return BT_ERROR_INVALID_PARAMETER; } ret = __bt_remove_ad_data_by_type(*p, *len, data_type, &new_p, &new_len); @@ -1744,7 +1749,7 @@ static int bt_adapter_le_remove_advertising_data(bt_advertiser_h advertiser, if (data_type == BT_ADAPTER_LE_ADVERTISING_DATA_LOCAL_NAME || data_type == BT_ADAPTER_LE_ADVERTISING_DATA_TX_POWER_LEVEL) - *system_data_len -= 1; /* LCOV_EXCL_LINE */ + *system_data_len -= 1; return ret; } @@ -1767,8 +1772,8 @@ static int __bt_convert_string_to_uuid(const char *string, } else if (strlen(string) == 36) { /* 128 bit uuid */ if (string[8] != '-' || string[13] != '-' || string[18] != '-' || string[23] != '-') { - BT_ERR("Invalid UUID"); /* LCOV_EXCL_LINE */ - return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */ + BT_ERR("Invalid UUID"); + return BT_ERROR_INVALID_PARAMETER; } char str_ptr[37] = { 0 }; @@ -1825,8 +1830,8 @@ static int __bt_convert_string_to_uuid(const char *string, g_free(ptr[5]); g_free(ptr[6]); } else { - BT_ERR("Invalid UUID"); /* LCOV_EXCL_LINE */ - return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */ + BT_ERR("Invalid UUID"); + return BT_ERROR_INVALID_PARAMETER; } return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ @@ -1924,13 +1929,13 @@ static int __bt_append_adv_type_data(bt_advertiser_h advertiser, dest_type = data_ptr[1]; if (data_type != dest_type) { - BT_ERR("Invalid data type"); /* LCOV_EXCL_LINE */ - return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */ + BT_ERR("Invalid data type"); + return BT_ERROR_INVALID_PARAMETER; } if (adv_flag_len + adv_len + system_data_len + new_data_len > 31) { - BT_ERR("Quota exceeded"); /* LCOV_EXCL_LINE */ - return BT_ERROR_QUOTA_EXCEEDED; /* LCOV_EXCL_LINE */ + BT_ERR("Quota exceeded"); + return BT_ERROR_QUOTA_EXCEEDED; } new_adv = g_malloc0(adv_len + new_data_len); @@ -2449,7 +2454,7 @@ int bt_adapter_le_set_advertising_filter_policy(bt_advertiser_h advertiser, error_code = _bt_get_error_code(bluetooth_check_privilege_advertising_parameter()); if (error_code != BT_ERROR_NONE) { BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), - error_code); /* LCOV_EXCL_LINE */ + error_code); return BT_ERROR_PERMISSION_DENIED; } @@ -2501,7 +2506,7 @@ int bt_adapter_le_enable_privacy(bool enable_privacy) if (error_code != BT_ERROR_NONE) { BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), - error_code); /* LCOV_EXCL_LINE */ + error_code); } return error_code; } @@ -3229,11 +3234,9 @@ int bt_adapter_le_get_scan_result_ibeacon_report(const bt_adapter_le_device_scan g_free(manufacturer_data); - return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ + return BT_ERROR_NONE; } - -/* LCOV_EXCL_START */ int bt_adapter_le_scan_filter_create(bt_scan_filter_h *scan_filter) { bt_le_scan_filter_s *__filter = NULL; @@ -3302,7 +3305,7 @@ int bt_adapter_le_scan_filter_set_device_name(bt_scan_filter_h scan_filter, cons if (strlen(name) > 29) { BT_ERR("INVALID_PARAMETER(0x%08x)", - BT_ERROR_INVALID_PARAMETER); /* LCOV_EXCL_LINE */ + BT_ERROR_INVALID_PARAMETER); return BT_ERROR_INVALID_PARAMETER; } @@ -3626,7 +3629,7 @@ int bt_adapter_le_scan_filter_unregister_all(void) return error_code; } - +/* LCOV_EXCL_START */ int bt_adapter_le_read_maximum_data_length( int *max_tx_octets, int *max_tx_time, int *max_rx_octets, int *max_rx_time) @@ -3896,6 +3899,7 @@ int bt_adapter_le_scan_filter_set_type(bt_scan_filter_h scan_filter, return BT_ERROR_INVALID_PARAMETER; } +/* LCOV_EXCL_START */ int bt_adapter_passkey_reply(char *passkey, bool authentication_reply) { BT_CHECK_INIT_STATUS(); @@ -3919,6 +3923,7 @@ int bt_adapter_passkey_confirmation_reply(bool confirmation_reply) return error_code; } +/* LCOV_EXCL_STOP */ int bt_adapter_le_is_2m_phy_supported(bool *is_supported) { diff --git a/src/bluetooth-audio.c b/src/bluetooth-audio.c index a76c7ec..9c305d2 100644 --- a/src/bluetooth-audio.c +++ b/src/bluetooth-audio.c @@ -475,7 +475,6 @@ int bt_ag_unset_speaker_gain_changed_cb(void) _bt_unset_cb(BT_EVENT_AG_SPEAKER_GAIN_CHANGE); return BT_ERROR_NONE; } -/* LCOV_EXCL_STOP */ int bt_ag_open_sco(void) { @@ -483,13 +482,13 @@ int bt_ag_open_sco(void) BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); error = bluetooth_telephony_audio_open(); error = _bt_convert_telephony_error_code(error); if (error != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - return error; /* LCOV_EXCL_STOP */ + return error; } int bt_ag_close_sco(void) @@ -498,25 +497,25 @@ int bt_ag_close_sco(void) BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); error = bluetooth_telephony_audio_close(); error = _bt_convert_telephony_error_code(error); if (error != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - return error; /* LCOV_EXCL_STOP */ + return error; } int bt_ag_is_sco_opened(bool *opened) { BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(opened); if (bluetooth_telephony_is_sco_connected()) *opened = true; else - *opened = false; /* LCOV_EXCL_STOP */ + *opened = false; return BT_ERROR_NONE; } @@ -525,23 +524,22 @@ int bt_ag_set_sco_state_changed_cb(bt_ag_sco_state_changed_cb callback, { BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(callback); _bt_set_cb(BT_EVENT_AG_SCO_CONNECTION_STATUS, callback, user_data); - return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ + return BT_ERROR_NONE; } int bt_ag_unset_sco_state_changed_cb(void) { BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); if (_bt_check_cb(BT_EVENT_AG_SCO_CONNECTION_STATUS) == true) _bt_unset_cb(BT_EVENT_AG_SCO_CONNECTION_STATUS); - return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ + return BT_ERROR_NONE; } -/* LCOV_EXCL_START */ int bt_ag_notify_call_event(bt_ag_call_event_e event, unsigned int call_id, const char *phone_number) { int error; @@ -628,7 +626,7 @@ int bt_ag_notify_vendor_cmd(const char *command) if (error != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); return error; -} /* LCOV_EXCL_STOP */ +} int bt_ag_notify_voice_recognition_state(bool state) { @@ -636,7 +634,7 @@ int bt_ag_notify_voice_recognition_state(bool state) BT_CHECK_HFP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_AG_INIT_STATUS(); /* LCOV_EXCL_START */ + BT_CHECK_AG_INIT_STATUS(); if (state) error = bluetooth_telephony_start_voice_recognition(); else @@ -645,10 +643,9 @@ int bt_ag_notify_voice_recognition_state(bool state) if (error != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); - return error; /* LCOV_EXCL_STOP */ + return error; } -/* LCOV_EXCL_START */ int bt_ag_set_call_handling_event_cb(bt_ag_call_handling_event_cb callback, void *user_data) { diff --git a/src/bluetooth-avrcp.c b/src/bluetooth-avrcp.c index 607dad6..fd8ce89 100644 --- a/src/bluetooth-avrcp.c +++ b/src/bluetooth-avrcp.c @@ -147,7 +147,8 @@ int bt_avrcp_target_disconnect(const char *remote_address) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error); return error; -} /* LCOV_EXCL_STOP */ +} +/* LCOV_EXCL_STOP */ int bt_avrcp_target_deinitialize(void) { @@ -390,7 +391,6 @@ int bt_avrcp_control_send_player_command(bt_avrcp_player_command_e cmd) return error; } -/* LCOV_EXCL_START */ int bt_avrcp_control_send_player_command_to(bt_avrcp_player_command_e cmd, char *remote_address) { int error; @@ -410,7 +410,6 @@ int bt_avrcp_control_send_player_command_to(bt_avrcp_player_command_e cmd, char return error; } -/* LCOV_EXCL_STOP */ int bt_avrcp_control_set_absolute_volume(unsigned int value) { diff --git a/src/bluetooth-device.c b/src/bluetooth-device.c index 18f5392..408b733 100644 --- a/src/bluetooth-device.c +++ b/src/bluetooth-device.c @@ -68,7 +68,7 @@ static bt_uuid2svc_table_t uuid2svc_mask[] = { { 0, BT_SC_NONE } }; - +/* LCOV_EXCL_START */ int bt_device_disconnect(const char *remote_address) { bluetooth_device_address_t addr_hex = { {0,} }; @@ -78,13 +78,14 @@ int bt_device_disconnect(const char *remote_address) BT_CHECK_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(remote_address); - _bt_convert_address_to_hex(&addr_hex, remote_address); /* LCOV_EXCL_START */ + _bt_convert_address_to_hex(&addr_hex, remote_address); error_code = _bt_get_error_code(bluetooth_disconnect_device(&addr_hex)); if (error_code != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; } +/* LCOV_EXCL_STOP */ int bt_device_create_bond(const char *device_address) { @@ -95,7 +96,7 @@ int bt_device_create_bond(const char *device_address) BT_CHECK_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(device_address); - _bt_convert_address_to_hex(&addr_hex, device_address); /* LCOV_EXCL_START */ + _bt_convert_address_to_hex(&addr_hex, device_address); /* LCOV_EXCL_LINE */ error_code = _bt_get_error_code(bluetooth_bond_device(&addr_hex)); if (error_code != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); @@ -103,6 +104,7 @@ int bt_device_create_bond(const char *device_address) return error_code; } +/* LCOV_EXCL_START */ int bt_device_create_bond_by_type(const char *device_address, bt_device_connection_link_type_e conn_type) { @@ -119,7 +121,8 @@ int bt_device_create_bond_by_type(const char *device_address, BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; -} /* LCOV_EXCL_STOP */ +} +/* LCOV_EXCL_STOP */ int bt_device_cancel_bonding(void) { @@ -201,7 +204,7 @@ int bt_device_start_service_search(const char *device_address) BT_CHECK_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(device_address); - _bt_convert_address_to_hex(&addr_hex, device_address); /* LCOV_EXCL_START */ + _bt_convert_address_to_hex(&addr_hex, device_address); /* LCOV_EXCL_LINE */ ret = _bt_get_error_code(bluetooth_search_service(&addr_hex)); /* In service search, BT_ERROR_SERVICE_SEARCH_FAILED is returned instead of BT_ERROR_OPERATION_FAILED. */ @@ -214,6 +217,7 @@ int bt_device_start_service_search(const char *device_address) return ret; } +/* LCOV_EXCL_START */ int bt_device_cancel_service_search(void) { int ret = 0; @@ -224,8 +228,9 @@ int bt_device_cancel_service_search(void) if (ret != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret); - return ret; /* LCOV_EXCL_STOP */ + return ret; } +/* LCOV_EXCL_STOP */ int bt_device_foreach_connected_profiles(const char *remote_address, bt_device_connected_profile callback, void *user_data) { @@ -334,6 +339,7 @@ int bt_device_set_service_searched_cb(bt_device_service_searched_cb callback, vo return BT_ERROR_NONE; } + /* LCOV_EXCL_START */ int bt_device_get_connection_state(const char *remote_address, bt_device_connection_link_type_e link_type, bool *connected) @@ -384,6 +390,7 @@ int bt_device_get_connection_state(const char *remote_address, return BT_ERROR_NONE; } + /* LCOV_EXCL_STOP */ int bt_device_set_connection_state_changed_cb(bt_device_connection_state_changed_cb callback, void *user_data) { @@ -461,9 +468,7 @@ int bt_device_unset_rssi_alert_cb(void) _bt_unset_cb(BT_EVENT_RSSI_ALERT_EVENT); return BT_ERROR_NONE; } -/* LCOV_EXCL_STOP */ -/* LCOV_EXCL_START */ int bt_device_unset_att_mtu_changed_cb(void) { BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); @@ -471,9 +476,7 @@ int bt_device_unset_att_mtu_changed_cb(void) _bt_unset_cb(BT_EVENT_GATT_ATT_MTU_CHANGE_STATUS); return BT_ERROR_NONE; } -/* LCOV_EXCL_STOP */ -/* LCOV_EXCL_START */ int bt_device_enable_rssi_monitor(const char *remote_address, bt_device_connection_link_type_e link_type, int low_threshold, int in_range_threshold, diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index 115a750..8cadcd5 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -2320,6 +2320,7 @@ int bt_gatt_characteristic_get_properties(bt_gatt_h characteristic, int *propert return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ } +/* LCOV_EXCL_START */ int bt_gatt_characteristic_set_properties(bt_gatt_h characteristic, int properties) { @@ -2332,14 +2333,15 @@ int bt_gatt_characteristic_set_properties(bt_gatt_h characteristic, if (chr->type != BT_GATT_TYPE_CHARACTERISTIC) { BT_ERR("Wrong type of GATT handle : %d", - chr->type); /* LCOV_EXCL_LINE */ - return BT_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */ + chr->type); + return BT_ERROR_INVALID_PARAMETER; } - chr->properties = properties; /* LCOV_EXCL_LINE */ + chr->properties = properties; - return BT_ERROR_NONE; /* LCOV_EXCL_LINE */ + return BT_ERROR_NONE; } +/* LCOV_EXCL_STOP */ int bt_gatt_characteristic_get_write_type(bt_gatt_h characteristic, bt_gatt_write_type_e *write_type) @@ -2817,7 +2819,7 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service) return ret; } - for (char_l = svc->characteristics; char_l; char_l = g_slist_next(char_l)) { + for (char_l = svc->characteristics; char_l; char_l = g_slist_next(char_l)) { /* LCOV_EXCL_START */ GSList *desc_l; bt_gatt_characteristic_s *chr = char_l->data; @@ -2860,7 +2862,7 @@ int bt_gatt_server_register_service(bt_gatt_server_h server, bt_gatt_h service) } } - } + } /* LCOV_EXCL_STOP */ serv->services = g_slist_append(serv->services, svc); svc->parent = (void *)server; @@ -3163,7 +3165,7 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic, else BT_INFO("Indication to be Unicasted.. [%s]", device_address); - if (chr->value_length > 0 && chr->value) { + if (chr->value_length > 0 && chr->value) { /* LCOV_EXCL_START */ if (handle->role == BT_GATT_ROLE_SERVER) { /* DEBUG */ @@ -3195,7 +3197,7 @@ int bt_gatt_server_notify_characteristic_changed_value(bt_gatt_h characteristic, return BT_ERROR_OPERATION_FAILED; } } - } + } /* LCOV_EXCL_STOP */ /* Save the Remote GATT client address to be used for notification later on */ memcpy(&chr->address.addr, &addr_hex.addr, BLUETOOTH_ADDRESS_LENGTH); @@ -3964,6 +3966,7 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle, } #endif +/* LCOV_EXCL_START */ static bt_gatt_client_h __find_gatt_client(const char *remote_address) { GSList *l = NULL; @@ -3977,6 +3980,7 @@ static bt_gatt_client_h __find_gatt_client(const char *remote_address) return NULL; } +/* LCOV_EXCL_STOP */ #ifndef TIZEN_GATT_CLIENT static gboolean __get_bdaddr_from_path(const char *path, char *addr) @@ -4008,6 +4012,7 @@ static gboolean __get_bdaddr_from_path(const char *path, char *addr) #endif #ifdef TIZEN_GATT_CLIENT +/* LCOV_EXCL_START */ void __uuid_hex_to_string(unsigned char *uuid, char *str) { uint32_t uuid0, uuid4; @@ -4027,7 +4032,6 @@ void __uuid_hex_to_string(unsigned char *uuid, char *str) return; } -/* LCOV_EXCL_START */ static bt_gatt_characteristic_s* __gatt_get_characteristic_handle( unsigned char *svc_uuid, int svc_inst, diff --git a/src/bluetooth-otp.c b/src/bluetooth-otp.c index 2935897..82ff057 100644 --- a/src/bluetooth-otp.c +++ b/src/bluetooth-otp.c @@ -273,6 +273,7 @@ static void _bt_otp_client_send_delete_object_callback(int result, static void _bt_otp_send_callback(int result, char *file_path, uint64_t id, unsigned int length, bt_otp_client_s *otp_client_s); +/* LCOV_EXCL_START */ int __bt_check_otp_server_init_status(void) { if (is_otp_server_initialized != true) { @@ -283,7 +284,6 @@ int __bt_check_otp_server_init_status(void) return BT_ERROR_NONE; } -/* LCOV_EXCL_START */ int bt_otp_server_initialize(const char *directory) { int error_code = BT_ERROR_NONE; @@ -316,9 +316,9 @@ int bt_otp_server_deinitialize() error_code = _bt_get_error_code(bluetooth_otp_server_deinit()); if (error_code != BT_ERROR_NONE) { - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), /* LCOV_EXCL_LINE */ + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); - return error_code; /* LCOV_EXCL_LINE */ + return error_code; } is_otp_server_initialized = false; diff --git a/src/bluetooth-proximity.c b/src/bluetooth-proximity.c index 6ca3990..ffb8803 100644 --- a/src/bluetooth-proximity.c +++ b/src/bluetooth-proximity.c @@ -67,6 +67,7 @@ static bt_proximity_reporter_s *reporter_s = NULL; BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_LE); \ } +/* LCOV_EXCL_START */ int bt_proximity_reporter_create(bt_proximity_reporter_h *reporter) { int error_code = BT_ERROR_NONE; @@ -123,7 +124,7 @@ int bt_proximity_reporter_destroy(bt_proximity_reporter_h reporter) return BT_ERROR_NOT_INITIALIZED; /* Unregister Reporter Role Here */ - error_code = _bt_get_error_code(bluetooth_proximity_reporter_unregister()); /* LCOV_EXCL_START */ + error_code = _bt_get_error_code(bluetooth_proximity_reporter_unregister()); if (error_code != BT_ERROR_NONE) BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); else @@ -152,7 +153,7 @@ int _bt_check_proximity_is_initialized(bool *is_initialized) return BT_ERROR_NONE; } -/* LCOV_EXCL_STOP */ + static bt_proximity_monitor_s *_bt_proximity_monitor_find(const char *remote_address) { GSList *l; @@ -169,7 +170,7 @@ static bt_proximity_monitor_s *_bt_proximity_monitor_find(const char *remote_add } return NULL; } -/* LCOV_EXCL_START */ + int _bt_proximity_connection_set_state_changed(int result, const char *remote_address, bool connected) { int service_type = 0; @@ -206,7 +207,7 @@ int _bt_proximity_connection_set_state_changed(int result, const char *remote_ad } return error_code; } -/* LCOV_EXCL_STOP */ + int bt_proximity_monitor_create(const char *remote_address, bt_proximity_monitor_h *monitor) { int error_code = BT_ERROR_NONE; @@ -218,8 +219,8 @@ int bt_proximity_monitor_create(const char *remote_address, bt_proximity_monitor BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); /* LCOV_EXCL_START */ - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_START */ + BT_CHECK_INPUT_PARAMETER(remote_address); + BT_CHECK_INPUT_PARAMETER(monitor); for (l = proximity_monitor_list; l; l = g_slist_next(l)) { bt_proximity_monitor_s *c = (bt_proximity_monitor_s *)l->data; @@ -277,7 +278,7 @@ int bt_proximity_monitor_destroy(bt_proximity_monitor_h monitor) BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_START */ + BT_CHECK_INPUT_PARAMETER(monitor); if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; @@ -292,7 +293,7 @@ int bt_proximity_monitor_destroy(bt_proximity_monitor_h monitor) proximity_monitor_list = g_slist_remove(proximity_monitor_list, monitor_s); g_free(monitor_s); - return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ + return BT_ERROR_NONE; } int bt_proximity_monitor_connect(bt_proximity_monitor_h monitor) @@ -302,7 +303,7 @@ int bt_proximity_monitor_connect(bt_proximity_monitor_h monitor) BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor_s);/* LCOV_EXCL_START */ + BT_CHECK_INPUT_PARAMETER(monitor_s); if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_NOT_INITIALIZED; @@ -314,7 +315,7 @@ int bt_proximity_monitor_connect(bt_proximity_monitor_h monitor) return error_code; } -/* LCOV_EXCL_STOP */ + int bt_proximity_monitor_disconnect(bt_proximity_monitor_h monitor) { int error_code; @@ -323,7 +324,7 @@ int bt_proximity_monitor_disconnect(bt_proximity_monitor_h monitor) BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); BT_CHECK_INPUT_PARAMETER(monitor_s); -/* LCOV_EXCL_START */ + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; @@ -334,7 +335,7 @@ int bt_proximity_monitor_disconnect(bt_proximity_monitor_h monitor) return error_code; } -/* LCOV_EXCL_STOP */ + int bt_proximity_monitor_set_connection_state_changed_cb(bt_proximity_monitor_h monitor, bt_proximity_monitor_connection_state_changed_cb callback, void *user_data) { @@ -443,8 +444,8 @@ int bt_proximity_monitor_set_linkloss_alert(bt_proximity_monitor_h monitor, int BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_LINE */ -/* LCOV_EXCL_START */ + BT_CHECK_INPUT_PARAMETER(monitor); + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; @@ -460,7 +461,7 @@ int bt_proximity_monitor_set_linkloss_alert(bt_proximity_monitor_h monitor, int return error_code; } -/* LCOV_EXCL_STOP */ + int bt_proximity_monitor_set_immediate_alert(bt_proximity_monitor_h monitor, int value) { int error_code = BT_ERROR_NONE; @@ -469,8 +470,8 @@ int bt_proximity_monitor_set_immediate_alert(bt_proximity_monitor_h monitor, int BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_LINE */ -/* LCOV_EXCL_START */ + BT_CHECK_INPUT_PARAMETER(monitor); + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; @@ -486,7 +487,7 @@ int bt_proximity_monitor_set_immediate_alert(bt_proximity_monitor_h monitor, int return error_code; } -/* LCOV_EXCL_STOP */ + int bt_proximity_monitor_get_linkloss_alert(bt_proximity_monitor_h monitor, int *value) { int error_code = BT_ERROR_NONE; @@ -495,21 +496,21 @@ int bt_proximity_monitor_get_linkloss_alert(bt_proximity_monitor_h monitor, int BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_LINE */ + BT_CHECK_INPUT_PARAMETER(monitor); - if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) /* LCOV_EXCL_LINE */ + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; - if (!(pxp_monitor_supported_services & BT_PROXIMITY_LINKLOSS_ALERT)) /* LCOV_EXCL_LINE */ + if (!(pxp_monitor_supported_services & BT_PROXIMITY_LINKLOSS_ALERT)) return BT_ERROR_NOT_SUPPORTED; - _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); /* LCOV_EXCL_LINE */ + _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); - error_code = _bt_get_error_code(bluetooth_proximity_monitor_get_property(&addr_hex, /* LCOV_EXCL_LINE */ + error_code = _bt_get_error_code(bluetooth_proximity_monitor_get_property(&addr_hex, BT_PROXIMITY_LINKLOSS_ALERT, value)); - if (error_code != BT_ERROR_NONE) /* LCOV_EXCL_LINE */ - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + if (error_code != BT_ERROR_NONE) + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; } @@ -522,21 +523,21 @@ int bt_proximity_monitor_get_immediate_alert(bt_proximity_monitor_h monitor, int BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_LINE */ + BT_CHECK_INPUT_PARAMETER(monitor); - if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) /* LCOV_EXCL_LINE */ + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; - if (!(pxp_monitor_supported_services & BT_PROXIMITY_IMMEDIATE_ALERT)) /* LCOV_EXCL_LINE */ + if (!(pxp_monitor_supported_services & BT_PROXIMITY_IMMEDIATE_ALERT)) return BT_ERROR_NOT_SUPPORTED; - _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); /* LCOV_EXCL_LINE */ + _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); - error_code = _bt_get_error_code(bluetooth_proximity_monitor_get_property(&addr_hex, /* LCOV_EXCL_LINE */ + error_code = _bt_get_error_code(bluetooth_proximity_monitor_get_property(&addr_hex, BT_PROXIMITY_IMMEDIATE_ALERT, value)); - if (error_code != BT_ERROR_NONE) /* LCOV_EXCL_LINE */ - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + if (error_code != BT_ERROR_NONE) + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; } @@ -549,21 +550,21 @@ int bt_proximity_monitor_get_signal_level(bt_proximity_monitor_h monitor, int *v BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(monitor); /* LCOV_EXCL_LINE */ + BT_CHECK_INPUT_PARAMETER(monitor); - if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) /* LCOV_EXCL_LINE */ + if (_bt_proximity_monitor_find(monitor_s->remote_address) == NULL) return BT_ERROR_REMOTE_DEVICE_NOT_CONNECTED; - if (!(pxp_monitor_supported_services & BT_PROXIMITY_TX_POWER)) /* LCOV_EXCL_LINE */ + if (!(pxp_monitor_supported_services & BT_PROXIMITY_TX_POWER)) return BT_ERROR_NOT_SUPPORTED; - _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); /* LCOV_EXCL_LINE */ + _bt_convert_address_to_hex(&addr_hex, monitor_s->remote_address); error_code = _bt_get_error_code(bluetooth_proximity_monitor_get_property(&addr_hex, BT_PROXIMITY_TX_POWER, value)); - if (error_code != BT_ERROR_NONE) /* LCOV_EXCL_LINE */ - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + if (error_code != BT_ERROR_NONE) + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; } @@ -575,7 +576,7 @@ int bt_proximity_reporter_get_linkloss_alert(const char *remote_address, int *va BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); /* LCOV_EXCL_LINE */ + BT_CHECK_INPUT_PARAMETER(remote_address); if (reporter_s == NULL) return BT_ERROR_NOT_INITIALIZED; @@ -583,13 +584,13 @@ int bt_proximity_reporter_get_linkloss_alert(const char *remote_address, int *va if (!(reporter_s->services_supported & BT_PROXIMITY_LINKLOSS_ALERT)) return BT_ERROR_NOT_SUPPORTED; - _bt_convert_address_to_hex(&addr_hex, remote_address); /* LCOV_EXCL_LINE */ + _bt_convert_address_to_hex(&addr_hex, remote_address); error_code = _bt_get_error_code(bluetooth_proximity_reporter_get_property(&addr_hex, BT_PROXIMITY_LINKLOSS_ALERT, value)); - if (error_code != BT_ERROR_NONE) /* LCOV_EXCL_LINE */ - BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); /* LCOV_EXCL_LINE */ + if (error_code != BT_ERROR_NONE) + BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code); return error_code; @@ -602,7 +603,7 @@ int bt_proximity_reporter_get_immediate_alert(const char *remote_address, int *v BT_CHECK_GATT_PXP_SUPPORT(); BT_CHECK_INIT_STATUS(); - BT_CHECK_INPUT_PARAMETER(remote_address); /* LCOV_EXCL_LINE */ + BT_CHECK_INPUT_PARAMETER(remote_address); if (reporter_s == NULL) return BT_ERROR_NOT_INITIALIZED; @@ -610,7 +611,7 @@ int bt_proximity_reporter_get_immediate_alert(const char *remote_address, int *v if (!(reporter_s->services_supported & BT_PROXIMITY_IMMEDIATE_ALERT)) return BT_ERROR_NOT_SUPPORTED; - _bt_convert_address_to_hex(&addr_hex, remote_address); /* LCOV_EXCL_LINE */ + _bt_convert_address_to_hex(&addr_hex, remote_address); error_code = _bt_get_error_code(bluetooth_proximity_reporter_get_property(&addr_hex, BT_PROXIMITY_IMMEDIATE_ALERT, value)); @@ -620,3 +621,4 @@ int bt_proximity_reporter_get_immediate_alert(const char *remote_address, int *v return error_code; } +/* LCOV_EXCL_STOP */ diff --git a/src/bluetooth-socket.c b/src/bluetooth-socket.c index 9ead77d..3973b7f 100644 --- a/src/bluetooth-socket.c +++ b/src/bluetooth-socket.c @@ -57,6 +57,7 @@ int bt_socket_destroy_rfcomm(int socket_fd) return error_code; } + /* LCOV_EXCL_START */ int bt_socket_is_service_used(const char *service_uuid, bool *used) { @@ -67,8 +68,9 @@ int bt_socket_is_service_used(const char *service_uuid, bool *used) *used = bluetooth_rfcomm_is_server_uuid_available(service_uuid); - return BT_ERROR_NONE; /* LCOV_EXCL_STOP */ + return BT_ERROR_NONE; } +/* LCOV_EXCL_STOP */ int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connections) { @@ -84,6 +86,7 @@ int bt_socket_listen_and_accept_rfcomm(int socket_fd, int max_pending_connection return error_code; } + /* LCOV_EXCL_START */ int bt_socket_listen(int socket_fd, int max_pending_connections) { @@ -187,6 +190,7 @@ int bt_socket_listen_and_accept_rfcomm_ex(const char *uuid, int max_pending_conn return error_code; } + /* LCOV_EXCL_STOP */ int bt_socket_connect_rfcomm(const char *remote_address, const char *remote_port_uuid) {