summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/dlt_common.c')
-rwxr-xr-xsrc/shared/dlt_common.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index dce48c6..8672c03 100755
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -1960,6 +1960,11 @@ 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)
{
strncpy(logging_filename,filename,NAME_MAX);
@@ -1967,6 +1972,11 @@ 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;
@@ -1983,6 +1993,11 @@ 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) {
@@ -1990,6 +2005,14 @@ 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 ", " "};
@@ -2377,6 +2400,13 @@ 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);
+ return *write;
+}
+
void dlt_buffer_read_block(DltBuffer *buf,int *read,unsigned char *data,unsigned int size)
{
if((int)(*read+size) <= buf->size) {
@@ -2390,7 +2420,14 @@ void dlt_buffer_read_block(DltBuffer *buf,int *read,unsigned char *data,unsigned
memcpy(data+buf->size-*read, buf->mem, size-buf->size+*read);
*read += size-buf->size;
}
-}
+}
+
+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);
+ return *read;
+}
int dlt_buffer_increase_size(DltBuffer *buf)
{
@@ -2713,6 +2750,13 @@ 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;
@@ -2734,6 +2778,13 @@ void dlt_buffer_status(DltBuffer *buf)
dlt_log(LOG_DEBUG, str);
}
+int get_test_dlt_buffer_status(DltBuffer *buf)
+{
+ // Get-Method for gtest. Test dlt_buffer_status
+ dlt_buffer_status(buf);
+ return 0;
+}
+
int dlt_buffer_get_total_size(DltBuffer *buf)
{
return buf->max_size;