From ece1ee3aaeb4ef81dd17bf752a0caed9d2fb844d Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Tue, 18 Jun 2013 11:39:00 +0200 Subject: [PATCH] unittest for Thread.priority --- src/core/thread.d | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/thread.d b/src/core/thread.d index ad569c1ed39..7202315b4e5 100644 --- a/src/core/thread.d +++ b/src/core/thread.d @@ -891,6 +891,19 @@ class Thread } + unittest + { + auto thr = Thread.getThis(); + immutable prio = thr.priority(); + scope (exit) thr.priority = prio; + + assert(prio >= PRIORITY_MIN && prio <= PRIORITY_MAX); + thr.priority = PRIORITY_MIN; + assert(thr.priority == PRIORITY_MIN); + thr.priority = PRIORITY_MAX; + assert(thr.priority == PRIORITY_MAX); + } + /////////////////////////////////////////////////////////////////////////// // Actions on Calling Thread ///////////////////////////////////////////////////////////////////////////