diff options
author | Manikandan C <mchockalingam@de.adit-jv.com> | 2018-12-19 16:10:41 +0100 |
---|---|---|
committer | Christoph Lipka <clipka@users.noreply.github.com> | 2018-12-21 10:16:46 +0100 |
commit | ab105d1671789fc9bd649f7e9ce3e6af22d30f0e (patch) | |
tree | 1cb0a74e08cad0723cd3c601f0fa1842be9d96f2 /src/gateway | |
parent | d34dc8fd10ff4dec56d5a221443f91fc26d10d11 (diff) | |
download | DLT-daemon-ab105d1671789fc9bd649f7e9ce3e6af22d30f0e.tar.gz |
Cleanup of unit test fixes
Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
Diffstat (limited to 'src/gateway')
-rw-r--r-- | src/gateway/dlt_gateway.c | 67 | ||||
-rw-r--r-- | src/gateway/dlt_gateway.h | 3 | ||||
-rw-r--r-- | src/gateway/dlt_gateway_internal.h | 51 |
3 files changed, 64 insertions, 57 deletions
diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 7597b70..2bc535e 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -54,7 +54,7 @@ * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ DLT_STATIC DltReturnValue dlt_gateway_check_ip(DltGatewayConnection *con, char *value) { @@ -95,9 +95,10 @@ DLT_STATIC DltReturnValue dlt_gateway_check_ip(DltGatewayConnection *con, char * * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_port(DltGatewayConnection *con, char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_port(DltGatewayConnection *con, + char *value) { int tmp = -1; @@ -128,9 +129,10 @@ DLT_STATIC int dlt_gateway_check_port(DltGatewayConnection *con, char *value) * * @param con DltGatewayConnection to be updated * @param value string to be used as ECU identifier - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_ecu(DltGatewayConnection *con, char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_ecu(DltGatewayConnection *con, + char *value) { if ((con == NULL) || (value == NULL)) { @@ -153,10 +155,10 @@ DLT_STATIC int dlt_gateway_check_ecu(DltGatewayConnection *con, char *value) * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_connect_trigger(DltGatewayConnection *con, - char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_connect_trigger(DltGatewayConnection *con, + char *value) { if ((con == NULL) || (value == NULL)) { @@ -187,9 +189,10 @@ DLT_STATIC int dlt_gateway_check_connect_trigger(DltGatewayConnection *con, * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_timeout(DltGatewayConnection *con, char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_timeout(DltGatewayConnection *con, + char *value) { if ((con == NULL) || (value == NULL)) { @@ -212,9 +215,10 @@ DLT_STATIC int dlt_gateway_check_timeout(DltGatewayConnection *con, char *value) * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_send_serial(DltGatewayConnection *con, char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_send_serial(DltGatewayConnection *con, + char *value) { if ((con == NULL) || (value == NULL)) { @@ -231,9 +235,9 @@ DLT_STATIC int dlt_gateway_check_send_serial(DltGatewayConnection *con, char *va * Allocate passive control messages * * @param con DltGatewayConnection to be updated - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_allocate_control_messages(DltGatewayConnection *con) +DLT_STATIC DltReturnValue dlt_gateway_allocate_control_messages(DltGatewayConnection *con) { if (con == NULL) { @@ -274,10 +278,10 @@ DLT_STATIC int dlt_gateway_allocate_control_messages(DltGatewayConnection *con) * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_control_messages(DltGatewayConnection *con, - char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_control_messages(DltGatewayConnection *con, + char *value) { /* list of allowed clients given */ char *token = NULL; @@ -349,10 +353,11 @@ DLT_STATIC int dlt_gateway_check_control_messages(DltGatewayConnection *con, * * @param con DltGatewayConnection to be updated * @param value string to be tested - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_periodic_control_messages(DltGatewayConnection *con, - char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_periodic_control_messages( + DltGatewayConnection *con, + char *value) { char *token = NULL; char *rest = NULL; @@ -530,12 +535,12 @@ DLT_STATIC DltGatewayConf configuration_entries[GW_CONF_COUNT] = * @param c DltGatewayConnection * @param key DltGatwayConnection property * @param value specified property value from configuration file - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_check_param(DltGateway *gateway, - DltGatewayConnection *con, - DltGatewayConfType ctype, - char *value) +DLT_STATIC DltReturnValue dlt_gateway_check_param(DltGateway *gateway, + DltGatewayConnection *con, + DltGatewayConfType ctype, + char *value) { if ((gateway == NULL) || (con == NULL) || (value == NULL)) { @@ -1030,13 +1035,13 @@ DltReceiver *dlt_gateway_get_connection_receiver(DltGateway *gateway, int fd) * @param msg DltMessage * @param req 1 if requested from gateway, 0 otherwise * @param verbose verbose flag - * @return 0 on success, -1 otherwise + * @return Value from DltReturnValue enum */ -DLT_STATIC int dlt_gateway_parse_get_log_info(DltDaemon *daemon, - char *ecu, - DltMessage *msg, - int req, - int verbose) +DLT_STATIC DltReturnValue dlt_gateway_parse_get_log_info(DltDaemon *daemon, + char *ecu, + DltMessage *msg, + int req, + int verbose) { char resp_text[DLT_RECEIVE_BUFSIZE] = {'\0'}; DltServiceGetLogInfoResponse *resp = NULL; diff --git a/src/gateway/dlt_gateway.h b/src/gateway/dlt_gateway.h index 7108253..553b9b1 100644 --- a/src/gateway/dlt_gateway.h +++ b/src/gateway/dlt_gateway.h @@ -188,7 +188,4 @@ DltGatewayConnection *dlt_gateway_get_connection(DltGateway *g, char *ecu, int verbose); -/* _ONLY_ for development purposes */ -void print_gateway_connection_details(const DltGateway *g); - #endif diff --git a/src/gateway/dlt_gateway_internal.h b/src/gateway/dlt_gateway_internal.h index 3b665e1..c0f9241 100644 --- a/src/gateway/dlt_gateway_internal.h +++ b/src/gateway/dlt_gateway_internal.h @@ -2,7 +2,7 @@ * @licence app begin@ * SPDX license identifier: MPL-2.0 * - * Copyright (C) 2017 Advanced Driver Information Technology. + * Copyright (C) 2018 Advanced Driver Information Technology. * This code is developed by Advanced Driver Information Technology. * Copyright of Advanced Driver Information Technology, Bosch and DENSO. * @@ -21,7 +21,7 @@ * \author * Aditya Paluri <venkataaditya.paluri@in.bosch.com> * - * \copyright Copyright © 2017 Advanced Driver Information Technology. \n + * \copyright Copyright © 2018 Advanced Driver Information Technology. \n * License MPL-2.0: Mozilla Public License version 2.0 http://mozilla.org/MPL/2.0/. * * \file dlt_gateway_internal.h @@ -58,31 +58,36 @@ #ifndef DLT_GATEWAY_INTERNAL_H_ #define DLT_GATEWAY_INTERNAL_H_ -DLT_STATIC int dlt_gateway_check_ip(DltGatewayConnection *con, char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_ip(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_port(DltGatewayConnection *con, char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_port(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_ecu(DltGatewayConnection *con, char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_ecu(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_connect_trigger(DltGatewayConnection *con, - char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_connect_trigger(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_timeout(DltGatewayConnection *con, char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_timeout(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_send_serial(DltGatewayConnection *con, char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_send_serial(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_allocate_control_messages(DltGatewayConnection *con); +DLT_STATIC DltReturnValue dlt_gateway_allocate_control_messages(DltGatewayConnection *con); -DLT_STATIC int dlt_gateway_check_control_messages(DltGatewayConnection *con, - char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_control_messages(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_periodic_control_messages(DltGatewayConnection *con, - char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_periodic_control_messages(DltGatewayConnection *con, + char *value); -DLT_STATIC int dlt_gateway_check_param(DltGateway *gateway, - DltGatewayConnection *con, - DltGatewayConfType ctype, - char *value); +DLT_STATIC DltReturnValue dlt_gateway_check_param(DltGateway *gateway, + DltGatewayConnection *con, + DltGatewayConfType ctype, + char *value); int dlt_gateway_configure(DltGateway *gateway, char *config_file, int verbose); @@ -90,10 +95,10 @@ int dlt_gateway_store_connection(DltGateway *gateway, DltGatewayConnection *tmp, int verbose); -DLT_STATIC int dlt_gateway_parse_get_log_info(DltDaemon *daemon, - char *ecu, - DltMessage *msg, - int req, - int verbose); +DLT_STATIC DltReturnValue dlt_gateway_parse_get_log_info(DltDaemon *daemon, + char *ecu, + DltMessage *msg, + int req, + int verbose); #endif |