summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
authorStefan Held <stefan_held@mentor.com>2015-06-18 18:28:32 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2015-07-21 12:46:03 +0200
commite4da5a35e0fc985c22a440e10c0728ed28fcb1a3 (patch)
tree689b1429087f913324784915d97855477f137c06 /src/shared/dlt_common.c
parentc745709ff10493281e5f020b2d76379e440ab9bd (diff)
downloadDLT-daemon-e4da5a35e0fc985c22a440e10c0728ed28fcb1a3.tar.gz
Rework of unit tests
Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/shared/dlt_common.c')
-rwxr-xr-xsrc/shared/dlt_common.c60
1 files changed, 7 insertions, 53 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index f9dee4c..1fa2766 100755
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -1972,11 +1972,6 @@ void dlt_log_set_level(int level)
logging_level = level;
}
-int get_test_dlt_log_set_level()
-{
- return logging_level;
-}
-
void dlt_log_set_filename(const char *filename)
{
// check nullpointer
@@ -1988,11 +1983,6 @@ void dlt_log_set_filename(const char *filename)
}
-char * get_test_dlt_log_set_filename()
-{
- return logging_filename;
-}
-
void dlt_log_init(int mode)
{
logging_mode = mode;
@@ -2009,11 +1999,6 @@ void dlt_log_init(int mode)
}
}
-int get_test_dlt_log_init()
-{
- return logging_mode;
-}
-
void dlt_log_free(void)
{
if(logging_mode == DLT_LOG_TO_FILE) {
@@ -2021,14 +2006,6 @@ void dlt_log_free(void)
}
}
-int get_test_dlt_log_free()
-{
- if(logging_mode == DLT_LOG_TO_FILE)
- return logging_handle;
- else
- return logging_mode;
-}
-
int dlt_log(int prio, char *s)
{
static const char asSeverity[LOG_DEBUG+2][11] = {"EMERGENCY", "ALERT ", "CRITICAL ", "ERROR ", "WARNING ", "NOTICE ", "INFO ", "DEBUG ", " "};
@@ -2430,16 +2407,6 @@ void dlt_buffer_write_block(DltBuffer *buf,int *write, const unsigned char *data
}
}
-int get_test_dlt_buffer_write_block(DltBuffer *buf, int *write, const unsigned char *data, unsigned int size)
-{
- // Get-Method for gtest. Test dlt_buffer_write_block
- dlt_buffer_write_block(buf, write, data, size);
- if (!write)
- return -1;
- else
- return *write;
-}
-
void dlt_buffer_read_block(DltBuffer *buf,int *read,unsigned char *data,unsigned int size)
{
// catch nullpointer
@@ -2458,25 +2425,15 @@ void dlt_buffer_read_block(DltBuffer *buf,int *read,unsigned char *data,unsigned
}
}
-int get_test_dlt_buffer_read_block(DltBuffer *buf, int *read,unsigned char *data,unsigned int size)
-{
- // Get-Method for gtest. Test dlt_buffer_read_block
- dlt_buffer_read_block(buf, read, data, size);
- if(!read)
- return -1;
- else
- return *read;
-}
-
int dlt_buffer_increase_size(DltBuffer *buf)
{
- DltBufferHead *head,*new_head;
- unsigned char *new_ptr;
-
// catch null pointer
if(!buf)
return -1;
+ DltBufferHead *head,*new_head;
+ unsigned char *new_ptr;
+
/* check size */
if(buf->step_size==0) {
/* cannot increase size */
@@ -2798,6 +2755,10 @@ int dlt_buffer_remove(DltBuffer *buf)
void dlt_buffer_info(DltBuffer *buf)
{
+ // check nullpointer
+ if(!buf)
+ return;
+
char str[256];
snprintf(str,sizeof(str),"Buffer: Available size: %d\n",buf->size);
@@ -2809,13 +2770,6 @@ void dlt_buffer_info(DltBuffer *buf)
}
-int get_test_dlt_buffer_info(DltBuffer *buf)
-{
- // Get-Method for gtest. Test dlt_buffer_info
- dlt_buffer_info(buf);
- return 0;
-}
-
void dlt_buffer_status(DltBuffer *buf)
{
int write, read, count;