summaryrefslogtreecommitdiff
path: root/test/semaphoretest.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-09-19 15:12:08 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-09-19 15:14:24 +0200
commit62e577cee9e199692d15cf741c0e29ae28f25c52 (patch)
tree3cfe20ce434b986e58efbc9bececcda41502ed33 /test/semaphoretest.cc
parent19ac4649f16621430b7d34635410fd67fd8ef49e (diff)
Make use of uUnit as a submodule (dgunit renamed).
Diffstat (limited to 'test/semaphoretest.cc')
-rw-r--r--test/semaphoretest.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/semaphoretest.cc b/test/semaphoretest.cc
index 470b5a0..807b619 100644
--- a/test/semaphoretest.cc
+++ b/test/semaphoretest.cc
@@ -24,7 +24,7 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "dgunit.h"
+#include <uunit.h>
#include <cassert>
@@ -45,12 +45,12 @@ std::chrono::nanoseconds dist(const std::chrono::duration<float>& a,
}
class SemaphoreTest
- : public DGUnit
+ : public uUnit
{
public:
SemaphoreTest()
{
- DGUNIT_TEST(SemaphoreTest::timeoutTest);
+ uUNIT_TEST(SemaphoreTest::timeoutTest);
}
public:
@@ -61,22 +61,22 @@ public:
{ // 1000ms timeout
auto start = std::chrono::steady_clock::now();
bool res = sem.wait(std::chrono::milliseconds(1000));
- DGUNIT_ASSERT(!res); // false means timeout
+ uUNIT_ASSERT(!res); // false means timeout
auto stop = std::chrono::steady_clock::now();
// Allow +/-1ms skew
- DGUNIT_ASSERT(dist((stop - start), std::chrono::milliseconds(1000))
+ uUNIT_ASSERT(dist((stop - start), std::chrono::milliseconds(1000))
< std::chrono::milliseconds(60));
}
{ // 100ms timeout
auto start = std::chrono::steady_clock::now();
bool res = sem.wait(std::chrono::milliseconds(100));
- DGUNIT_ASSERT(!res); // false means timeout
+ uUNIT_ASSERT(!res); // false means timeout
auto stop = std::chrono::steady_clock::now();
// Allow +/-1ms skew
- DGUNIT_ASSERT(dist((stop - start), std::chrono::milliseconds(100))
+ uUNIT_ASSERT(dist((stop - start), std::chrono::milliseconds(100))
< std::chrono::milliseconds(60));
}
}