diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2021-04-01 09:16:58 +0000 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2021-10-05 11:19:26 +0900 |
commit | 4c0a4a267e66fb31f5ddfc44ba5e5f34b586b952 (patch) | |
tree | 3dd13a1f1d6d00fdc734133e5c69eeb995c528a9 /src/tests/dlt-test-stress-user.c | |
parent | 3c3ead84aa51abc8d95c5ee974182194949f63c9 (diff) | |
download | DLT-daemon-4c0a4a267e66fb31f5ddfc44ba5e5f34b586b952.tar.gz |
tests: Enable macro disabling
This commit introduces new cmake option "WITH_DLT_DISABLE_MACRO" to
disable macro usage in case it is not allowed. Currently this is adapted
to src/tests and src/examples only. for dlt-test-non-verbose, the build itself is
currently disabled if WITH_DLT_DISABLE_MACRO is set; this needs to be
enabled again in future by replacing or adding function usage.
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/tests/dlt-test-stress-user.c')
-rw-r--r-- | src/tests/dlt-test-stress-user.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/tests/dlt-test-stress-user.c b/src/tests/dlt-test-stress-user.c index 0a01d54..06abbfd 100644 --- a/src/tests/dlt-test-stress-user.c +++ b/src/tests/dlt-test-stress-user.c @@ -81,15 +81,7 @@ int testall(int count, int repeat, int delay, int size); /* Context declaration.. */ -DLT_DECLARE_CONTEXT(context_info) - -/* for macro interface */ -DLT_DECLARE_CONTEXT(context_macro_callback) -DLT_DECLARE_CONTEXT(context_macro_test[DLT_TEST_NUM_CONTEXT]) - -/* for function interface */ -DltContext context_function_callback; -DltContext context_function_test[DLT_TEST_NUM_CONTEXT]; +DltContext context_info; DltContextData context_data; @@ -192,10 +184,10 @@ int main(int argc, char *argv[]) } /* Register APP */ - DLT_REGISTER_APP("DIFT", "DLT Interface Test"); + dlt_register_app("DIFT", "DLT Interface Test"); /* Register CONTEXTS... */ - DLT_REGISTER_CONTEXT(context_info, "INFO", "Information context"); + dlt_register_context(&context_info, "INFO", "Information context"); /* Tests starting */ printf("Tests starting\n"); @@ -214,10 +206,10 @@ int main(int argc, char *argv[]) /*sleep(3); */ /* Unregister CONTEXTS... */ - DLT_UNREGISTER_CONTEXT(context_info); + dlt_unregister_context(&context_info); /* Unregister APP */ - DLT_UNREGISTER_APP(); + dlt_unregister_app(); return 0; } @@ -241,7 +233,11 @@ int testall(int count, int repeat, int delay, int size) for (rnum = 0; rnum < repeat; rnum++) for (num = 1; num <= count; num++) { - DLT_LOG(context_info, DLT_LOG_INFO, DLT_INT(num), DLT_RAW(buffer, size)); + if (dlt_user_log_write_start(&context_info, &context_data, DLT_LOG_INFO) > 0) { + dlt_user_log_write_int(&context_data, num); + dlt_user_log_write_raw(&context_data, buffer, size); + dlt_user_log_write_finish(&context_data); + } ts.tv_sec = (delay * 1000) / 1000000000; ts.tv_nsec = (delay * 1000) % 1000000000; nanosleep(&ts, NULL); |