summaryrefslogtreecommitdiffstats
path: root/test/sem_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-14 04:47:15 +0000
committerDavid Robillard <d@drobilla.net>2012-08-14 04:47:15 +0000
commit37223c88b3c34833bf23136d1b884044bc7feaaa (patch)
treebdf5bb3079950153dbfb1a3df9ce8b4e1a9b3473 /test/sem_test.cpp
parent7014fc38dafb9a31cb6ab71b66ee9f64f3eb3c65 (diff)
downloadraul-37223c88b3c34833bf23136d1b884044bc7feaaa.tar.gz
raul-37223c88b3c34833bf23136d1b884044bc7feaaa.tar.bz2
raul-37223c88b3c34833bf23136d1b884044bc7feaaa.zip
100% test coverage for RingBuffer.
Improve test coverage for Semaphore (as much as is feasibly possible). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4689 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'test/sem_test.cpp')
-rw-r--r--test/sem_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sem_test.cpp b/test/sem_test.cpp
index f8b0741..7e06693 100644
--- a/test/sem_test.cpp
+++ b/test/sem_test.cpp
@@ -15,7 +15,9 @@
*/
#include <iostream>
+#include <limits.h>
#include <unistd.h>
+
#include "raul/Thread.hpp"
#include "raul/Semaphore.hpp"
@@ -46,7 +48,18 @@ private:
int
main()
{
+ try {
+ Semaphore fail(UINT_MAX);
+ } catch (...) {
+ }
+
Semaphore sem(0);
+
+ if (sem.try_wait()) {
+ cerr << "Successfully try-waited a 0 Semaphore" << endl;
+ return 1;
+ }
+
Waiter waiter(sem);
waiter.start();