CanGetProcessThreadForManagedThread() test now only runs on Windows systems; removed unused variable from expression tree cloner; removed unused variable from unit test of weak collection; fixed test issue parsing command lines relying on current platform being windows; removed unused variable from Semaphore class
git-svn-id: file:///srv/devel/repo-conversion/nusu@251 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
48e016d956
commit
61c858cb1c
5 changed files with 28 additions and 16 deletions
|
|
@ -235,18 +235,19 @@ namespace Nuclex.Support {
|
|||
/// be determined using the GetProcessThread() method
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetProcessThread() {
|
||||
Thread.BeginThreadAffinity();
|
||||
try {
|
||||
int threadId = AffineThreadPool.GetCurrentThreadId();
|
||||
public void CanGetProcessThreadForManagedThread() {
|
||||
if(Environment.OSVersion.Platform == PlatformID.Win32NT) {
|
||||
Thread.BeginThreadAffinity();
|
||||
try {
|
||||
int threadId = AffineThreadPool.GetCurrentThreadId();
|
||||
|
||||
Assert.IsNotNull(AffineThreadPool.GetProcessThread(threadId));
|
||||
Assert.IsNull(AffineThreadPool.GetProcessThread(0));
|
||||
Assert.IsNotNull(AffineThreadPool.GetProcessThread(threadId));
|
||||
Assert.IsNull(AffineThreadPool.GetProcessThread(0));
|
||||
}
|
||||
finally {
|
||||
Thread.EndThreadAffinity();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Thread.EndThreadAffinity();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -299,7 +300,7 @@ namespace Nuclex.Support {
|
|||
"Task " + index.ToString() + " was started"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// All Thread should now be active and no work items should be waiting
|
||||
Assert.AreEqual(
|
||||
createdTasks, AffineThreadPool.ActiveThreads,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue