summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2016-05-13 15:58:50 +0200
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2016-05-13 16:26:22 +0200
commit28bad999160b9db9bfe464567a3f98f870b663b0 (patch)
treef0f5798a4f8da11aa5ec1dd6699237975dd7a0dc
parentb591c082d9aa0e604ab5d5039d6343b2e855e875 (diff)
downloadDLT-daemon-28bad999160b9db9bfe464567a3f98f870b663b0.tar.gz
Fixed D-Bus tracing not working anymore
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> Topic: GENDLT-425 Change-Id: I4ec56d714804d9ee4fa904b71c58dafd00990b4f
-rw-r--r--src/lib/dlt_user.c2
-rw-r--r--tests/gtest_dlt_user.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index dbe8595..ef0f36f 100644
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -1416,7 +1416,7 @@ DltReturnValue dlt_user_log_write_raw_formatted(DltContextData *log, void *data,
uint32_t type_info = 0;
// check nullpointer
- if (log == NULL || data == NULL)
+ if (log == NULL || (data == NULL && length!=0))
return DLT_RETURN_WRONG_PARAMETER;
// Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning
diff --git a/tests/gtest_dlt_user.cpp b/tests/gtest_dlt_user.cpp
index 697834e..d4a44bc 100644
--- a/tests/gtest_dlt_user.cpp
+++ b/tests/gtest_dlt_user.cpp
@@ -1651,7 +1651,7 @@ TEST(t_dlt_user_log_write_raw, nullpointer)
EXPECT_LE(DLT_RETURN_OK,dlt_user_log_write_start(&context, &contextData, DLT_LOG_DEFAULT));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw(NULL, text1, 6));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw(NULL, NULL, 0));
- EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw(&contextData, NULL, 0));
+ EXPECT_GE(DLT_RETURN_OK,dlt_user_log_write_raw(&contextData, NULL, 0));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw(&contextData, NULL, 1));
EXPECT_LE(DLT_RETURN_OK,dlt_user_log_write_finish(&contextData));
@@ -1740,7 +1740,7 @@ TEST(t_dlt_user_log_write_raw_formatted, nullpointer)
EXPECT_LE(DLT_RETURN_OK,dlt_user_log_write_start(&context, &contextData, DLT_LOG_DEFAULT));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw_formatted(NULL, text1, 6, DLT_FORMAT_DEFAULT));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw_formatted(NULL, NULL, 0, DLT_FORMAT_DEFAULT));
- EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw_formatted(&contextData, NULL, 0, DLT_FORMAT_DEFAULT));
+ EXPECT_GE(DLT_RETURN_OK,dlt_user_log_write_raw_formatted(&contextData, NULL, 0, DLT_FORMAT_DEFAULT));
EXPECT_GE(DLT_RETURN_ERROR,dlt_user_log_write_raw_formatted(&contextData, NULL, 1, DLT_FORMAT_DEFAULT));
EXPECT_LE(DLT_RETURN_OK,dlt_user_log_write_finish(&contextData));