Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
unittest for Thread.priority
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Jun 18, 2013
1 parent 04bdce2 commit ece1ee3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/thread.d
Expand Up @@ -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
///////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ece1ee3

Please sign in to comment.