diff options
author | Christoph Lipka <clipka@jp.adit-jv.com> | 2016-01-26 16:09:21 +0900 |
---|---|---|
committer | Gernot Wirschal <gernot.wirschal@bmw.de> | 2016-04-28 13:48:00 +0200 |
commit | 6a8919c637b28fab7cc6f8e87cfca6f13bb8cb1d (patch) | |
tree | 560f0dd6be57ad427f41ef36c5785cb11508d0d1 /src/tests/dlt-test-user.c | |
parent | 793f30a629d706bc6d8a47ca90d4627791bc3969 (diff) | |
download | DLT-daemon-6a8919c637b28fab7cc6f8e87cfca6f13bb8cb1d.tar.gz |
DLT_PTR: User macro to print pointers
This macro internally checks the size of a void pointer to decide if the
pointer address is sent with DLT_HEX32 or DLT_HEX64 macro.
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Change-Id: Ie316ac411f2174e0760e09244d04b83c8006f55d
Diffstat (limited to 'src/tests/dlt-test-user.c')
-rw-r--r-- | src/tests/dlt-test-user.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests/dlt-test-user.c b/src/tests/dlt-test-user.c index 80614e0..16479a2 100644 --- a/src/tests/dlt-test-user.c +++ b/src/tests/dlt-test-user.c @@ -479,6 +479,8 @@ int test5m(void) char buffer[32]; int num; + void *ptr = malloc(sizeof(int)); + for(num=0;num<32;num++) { buffer[num] = num; @@ -506,10 +508,13 @@ int test5m(void) DLT_LOG(context_macro_test[4],DLT_LOG_INFO,DLT_STRING("Next line: DLT_LOG_STRING_UINT")); DLT_LOG_STRING_UINT(context_macro_test[4], DLT_LOG_INFO,"String output: ", 42); + DLT_LOG(context_macro_test[4],DLT_LOG_INFO,DLT_STRING("Next line: DLT_LOG_PTR")); + DLT_LOG(context_macro_test[4],DLT_LOG_INFO,DLT_PTR(ptr)); /* wait 2 second before next test */ sleep(2); DLT_LOG(context_info,DLT_LOG_INFO,DLT_STRING("Test5: (Macro IF) finished")); + free(ptr); return 0; } |