From 080d1df3e1de328efc71bd2b82deb61e50c192e3 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Wed, 22 Mar 2023 19:06:18 +0100 Subject: [PATCH] Remove _DEFAULT_SOURCE from tests --- test/rt/nosv/attach.c | 5 ++--- test/rt/nosv/several-tasks.c | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/rt/nosv/attach.c b/test/rt/nosv/attach.c index db49b8a..755f4c1 100644 --- a/test/rt/nosv/attach.c +++ b/test/rt/nosv/attach.c @@ -1,12 +1,11 @@ /* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ -#define _DEFAULT_SOURCE - #include #include #include "common.h" +#include "compat.h" int main(void) @@ -23,7 +22,7 @@ main(void) if (nosv_attach(&task, type, 0, NULL, 0) != 0) die("nosv_attach failed"); - usleep(100); + sleep_us(100); if (nosv_detach(0) != 0) die("nosv_detach failed"); diff --git a/test/rt/nosv/several-tasks.c b/test/rt/nosv/several-tasks.c index 20293d6..bb9514a 100644 --- a/test/rt/nosv/several-tasks.c +++ b/test/rt/nosv/several-tasks.c @@ -1,13 +1,13 @@ /* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ -#define _DEFAULT_SOURCE - #include #include #include #include "common.h" +#include "compat.h" +#include "emu/emu_stat.h" #define NTASKS 200 atomic_int ncompleted = 0; @@ -18,7 +18,7 @@ static void task_body(nosv_task_t task) { UNUSED(task); - usleep(500); + sleep_us(500); atomic_fetch_add(&ncompleted, 1); } @@ -37,7 +37,7 @@ main(void) nosv_submit(tasks[i], 0); while (atomic_load(&ncompleted) != NTASKS) - usleep(1000); + sleep_us(1000); for (int i = 0; i < NTASKS; i++) nosv_destroy(tasks[i], 0);