summaryrefslogtreecommitdiffstats
path: root/test/sem_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-02-27 11:36:02 +0100
committerDavid Robillard <d@drobilla.net>2017-02-27 20:41:47 +0100
commitd348561aaf77f96aaa8c2454bce9b13b87f3cd29 (patch)
treed052ffd0355595c03dd81d8f5c485653cfeacc96 /test/sem_test.cpp
parent808b1de00e29421b542fa8ef781979351dc0fcf7 (diff)
downloadraul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.tar.gz
raul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.tar.bz2
raul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.zip
Use std::chrono::duration in Semaphore API
Diffstat (limited to 'test/sem_test.cpp')
-rw-r--r--test/sem_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sem_test.cpp b/test/sem_test.cpp
index 0400e38..453ba07 100644
--- a/test/sem_test.cpp
+++ b/test/sem_test.cpp
@@ -31,7 +31,7 @@ wait_for_sem(Raul::Semaphore* sem)
static void
timed_wait_for_sem(Raul::Semaphore* sem)
{
- while (!sem->timed_wait(100)) {}
+ while (!sem->timed_wait(std::chrono::milliseconds(100))) {}
}
int
@@ -54,13 +54,13 @@ main()
// Check that timed_wait actually waits
const auto start = std::chrono::steady_clock::now();
- sem.timed_wait(100);
+ sem.timed_wait(std::chrono::milliseconds(100));
const auto end = std::chrono::steady_clock::now();
assert(end - start > std::chrono::milliseconds(100));
assert(end - start < std::chrono::milliseconds(200));
// Check that we can't successfully wait on a zero semaphore
- assert(!sem.timed_wait(100));
+ assert(!sem.timed_wait(std::chrono::milliseconds(100)));
// Check that initial value works correctly
sem = Raul::Semaphore(2);