summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2019-01-08 16:45:04 +0900
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2019-05-06 15:55:01 +0900
commitdf6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e (patch)
tree6356575d4f9e6461769f7b40b72829366feb37b4 /tests
parent4fe69b0927f4c5d0cb3b3ae4fa64500db22b13d0 (diff)
downloadDLT-daemon-df6fc2a1ce9f3a1778e9c8e14c800cd2ad96e96e.tar.gz
POSIX: Replace usleep with nanosleep
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/dlt-test-preregister-context.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/dlt-test-preregister-context.c b/tests/dlt-test-preregister-context.c
index ea70789..bba0eff 100644
--- a/tests/dlt-test-preregister-context.c
+++ b/tests/dlt-test-preregister-context.c
@@ -34,18 +34,22 @@
int main()
{
DltContext mainContext;
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 200000 * 1000;
+
DLT_REGISTER_CONTEXT(mainContext, "CTXP", "main context");
DLT_LOG(mainContext, DLT_LOG_WARN, DLT_STRING("First message before app registered"));
- usleep(200000);
+ nanosleep(&ts, NULL);
DLT_LOG(mainContext, DLT_LOG_WARN, DLT_STRING("Second message before app registered"));
- usleep(200000);
+ nanosleep(&ts, NULL);
DLT_REGISTER_APP("PRNT", "Sample pre-register application");
DLT_LOG(mainContext, DLT_LOG_WARN, DLT_STRING("First message after app registered"));
- usleep(200000);
+ nanosleep(&ts, NULL);
DLT_UNREGISTER_APP()
;