summaryrefslogtreecommitdiff
path: root/tests/gtest_dlt_user.cpp
Commit message (Collapse)AuthorAgeFilesLines
* libdlt: truncate the log message if it is too long (#156) (#157)Vo Trung Chi2019-09-021-5/+1314
| | | | | | | | | | | | Change the behavior of dlt_user_log_write_string, dlt_user_log_write_constant_string and dlt_user_log_write_utf8_string so that they truncate the incoming message if it is too big and add "Message truncated, too long" at the end of it. These function should anyway still return an DLT_RETURN_USER_BUFFER_FULL error in this case. Signed-off-by: Nguyen Dinh Thi (RBVH/ENG2) <Thi.NguyenDinh@vn.bosch.com> Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* doxygen: Align variable for apid and ctidSaya Sugiura2019-07-191-1/+1
| | | | | | | The variables used for application id and context id are aligned with "apid" and "ctid". Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Remove licenceSaya Sugiura2019-07-191-2/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-211-1540/+1642
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Add dlt_user_is_logLevel_enabled APIChristoph Lipka2016-09-231-0/+28
| | | | | | | | | | This function allows an application developer to check if the DLT LogLevel is enabled before starting any log string creation. It can be used in application specific logging wrapper functions. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I4c269b12bfdeae29a4e795385cdbc54a579ba621
* Fixed D-Bus tracing not working anymoreAlexander Wenzel2016-05-131-2/+2
| | | | | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> Topic: GENDLT-425 Change-Id: I4ec56d714804d9ee4fa904b71c58dafd00990b4f
* Added abnormal unit tests to check DLT_RETURN_USER_BUFFER_FULLLutz Helwing2016-04-221-29/+68
| | | | Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Fix bug with truncation of string or raw blockLutz Helwing2016-02-251-1/+1
| | | | | | | | With commit d319ebf4d2d449d70befae0eebbdd82c19c5315f a bug was introduces which lead to some messages getting not transmitted. Change-Id: I9f20177fbc7db9d7caf527e14159444b5fec168a Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Truncate of string or raw block, if length exceeds maximum message lengthLutz Helwing2016-02-191-2/+2
| | | | | | | | | | | | | Previously if messages containing strings or raw data were exceeding the maximum message size (DLT_USER_BUF_MAX_SIZE, currently set to 1390) they were discarded completely. This behaviour is changed so that too large data is truncated and sent anyway. Commented out part of unit test for dlt_log_raw abnormal where negative values for unsigned length were passed. Change-Id: I4f6bf152e7125924717c941ad7ebb8fd79787715 Signed-off-by: Lutz Helwing <lutz_helwing@mentor.com>
* Added core dump handler codeLutz Helwing2015-10-281-3/+2
| | | | | | | | | | | | | | | | | | | | Fixed author Doxygen tag Added licence headers Moved return value definition to new header Converted all DOS line endings to Unix Solution for CPU dependency by using CMAKE_SYSTEM_PROCESSOR cmake variable CPU specific stuff is implemented in own implementation file for each CPU architecture Added config file for sysctl. Fixed wrong parameters to open call for lockfile Added mechanism to overwrite TARGET_CPU_NAME with command line option Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-071-1130/+1130
| | | | | | | | | | DLT daemon improvement - parameter value range check Adapt unit tests to check for enum return values Changed C version to gnu99 and C++ version to gnu++0c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Cleanup masterStefan Vacek2015-10-071-2/+2
| | | | | | | - remove compiler warnings - fix file permissions Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* workaround for unit test dlt_get_log_stateStefan Held2015-07-301-2/+3
| | | | | Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Removed all trailing whitespacesLutz Helwing2015-07-211-160/+160
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Rework of unit testsStefan Held2015-07-211-238/+29
| | | | | Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added licence and Doxygen headersLutz Helwing2015-07-211-0/+28
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Rework of unit tests in gtest_dlt_userStefan Held2015-07-211-75/+285
| | | | | | | Fix all nullpointer errors in dlt_user.c Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Adding unit tests for following functions:Jens Bocklage2015-06-171-840/+1277
| | | | | | | | | | | | | | | | | | | | int dlt_register_injection_callback(DltContext *handle, uint32_t service_id, int (*dlt_injection_callback)(uint32_t service_id, void *data, uint32_t length)); int dlt_register_log_level_changed_callback(DltContext *handle, void (*dlt_log_level_changed_callback)(char context_id[DLT_ID_SIZE],uint8_t log_level, uint8_t trace_status)); int dlt_user_trace_network(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload); int dlt_user_trace_network_truncated(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload, int allow_truncate); int dlt_user_trace_network_segmented(DltContext *handle, DltNetworkTraceType nw_trace_type, uint16_t header_len, void *header, uint16_t payload_len, void *payload); int dlt_set_log_mode(DltUserLogMode mode); int dlt_get_log_state(); int dlt_verbose_mode(void); int dlt_nonverbose_mode(void); Commented out the functions that fail with the comment // TODO: Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixing MIN and MAX defines for base integer typesJens Bocklage2015-06-171-17/+99
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Adding unit tests for:Jens Bocklage2015-06-171-41/+329
| | | | | | | | | | int dlt_register_app(const char *appid, const char * description); int dlt_unregister_app(void); int dlt_register_context(DltContext *handle, const char *contextid, const char * description); int dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char * description, int loglevel, int tracestatus); int dlt_unregister_context(DltContext *handle); Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Adding unit tests for:Jens Bocklage2015-06-171-0/+2142
int dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel); int dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid); int dlt_user_log_write_finish(DltContextData *log); int dlt_user_log_write_bool(DltContextData *log, uint8_t data); int dlt_user_log_write_float32(DltContextData *log, float32_t data); int dlt_user_log_write_float64(DltContextData *log, double data); int dlt_user_log_write_uint(DltContextData *log, unsigned int data); int dlt_user_log_write_uint8(DltContextData *log, uint8_t data); int dlt_user_log_write_uint16(DltContextData *log, uint16_t data); int dlt_user_log_write_uint32(DltContextData *log, uint32_t data); int dlt_user_log_write_uint64(DltContextData *log, uint64_t data); int dlt_user_log_write_uint8_formatted(DltContextData *log, uint8_t data, DltFormatType type); int dlt_user_log_write_uint16_formatted(DltContextData *log, uint16_t data, DltFormatType type); int dlt_user_log_write_uint32_formatted(DltContextData *log, uint32_t data, DltFormatType type); int dlt_user_log_write_uint64_formatted(DltContextData *log, uint64_t data, DltFormatType type); int dlt_user_log_write_int(DltContextData *log, int data); int dlt_user_log_write_int8(DltContextData *log, int8_t data); int dlt_user_log_write_int16(DltContextData *log, int16_t data); int dlt_user_log_write_int32(DltContextData *log, int32_t data); int dlt_user_log_write_int64(DltContextData *log, int64_t data); int dlt_user_log_write_string( DltContextData *log, const char *text); int dlt_user_log_write_constant_string( DltContextData *log, const char *text); int dlt_user_log_write_utf8_string(DltContextData *log, const char *text); int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length); int dlt_user_log_write_raw_formatted(DltContextData *log,void *data,uint16_t length,DltFormatType type); int dlt_log_string(DltContext *handle,DltLogLevelType loglevel, const char *text); int dlt_log_string_int(DltContext *handle,DltLogLevelType loglevel, const char *text, int data); int dlt_log_string_uint(DltContext *handle,DltLogLevelType loglevel, const char *text, unsigned int data); int dlt_log_int(DltContext *handle,DltLogLevelType loglevel, int data); int dlt_log_uint(DltContext *handle,DltLogLevelType loglevel, unsigned int data); int dlt_log_raw(DltContext *handle,DltLogLevelType loglevel, void *data,uint16_t length); int dlt_log_marker(); Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>