Skip to content

Commit 5e5980b

Browse files
committed
Merge branch 'develop-unit-test' of https://github.com/nanoframework/lib-CoreLibrary into develop-unit-test
2 parents 5be81cc + a542381 commit 5e5980b

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

Tests/NFUnitTestThread/UnitTestInterlocTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ public void Interlocked3_Exchange_Boundary_Test()
207207
/// </summary>
208208
///
209209

210-
Debug.WriteLine("This is Fixed, see 20323 for details");
211210
int[] value = new int[] { -2147483648, 0, 2147483647 };
212211
int temp1, temp2;
213212
Debug.WriteLine("Verification of original value returned needs temp1 = temp2");
@@ -246,7 +245,6 @@ public void Interlocked4_CompareExchange_Boundary_Test()
246245
/// </summary>
247246
///
248247

249-
Debug.WriteLine("This is Fixed, see 20323 for details");
250248
int[] value = new int[] { -2147483648, 0, 2147483647 };
251249
int temp1, temp2;
252250

Tests/NFUnitTestThread/UnitTestMonitorTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ public void Monitor2_SynchronizationLockException_Test()
126126
/// </summary>
127127
///
128128
Debug.WriteLine("Verify SynchronizationLockException exception is thrown");
129-
Debug.WriteLine("This currently fails, see 20281");
130129
Debug.WriteLine("Calling Monitor.Exit without first calling Monitor.Enter should throw an exception");
131130
Assert.Trows(typeof(Exception), () => { Monitor.Exit(locker1); });
132131
}
@@ -141,7 +140,6 @@ public void Monitor3_Enter_ArgumentNullException_Test()
141140
///
142141

143142
Debug.WriteLine("verify ArgumentNullException exception is thrown ");
144-
Debug.WriteLine("This is fixed, see 20730 for details");
145143
Debug.WriteLine("Calling Monitor.Enter passing null reference parameter should throw exception");
146144
Assert.Trows(typeof(ArgumentNullException), () => { Monitor.Enter(null); });
147145

@@ -156,8 +154,7 @@ public void Monitor4_Exit_ArgumentNullException_Test()
156154
/// </summary>
157155
///
158156
Debug.WriteLine("verify ArgumentNullException exception is thrown ");
159-
Debug.WriteLine("This is fixed, see 20731 for details");
160-
Debug.WriteLine("Calling Monitor.Exit passing null reference parameter should throw exception");
157+
Debug.WriteLine("Calling Monitor.Exit passing 'null' reference parameter should throw exception");
161158
Assert.Trows(typeof(ArgumentNullException), () => { Monitor.Exit(null); });
162159
}
163160

Tests/NFUnitTestThread/UnitTestThreadTest.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void Threading_Basic_Test1()
7979
Debug.WriteLine("Starting a thread without explicit declaration of ThreadStart Delegate");
8080
Debug.WriteLine("Starts two threads, waits for them to complete and passes, ");
8181
Debug.WriteLine("this may erroneously fail for extremely slow devices.");
82-
Debug.WriteLine("All other threading tests are dependant on this, if this fails, ");
82+
Debug.WriteLine("All other threading tests are dependent on this, if this fails, ");
8383
Debug.WriteLine("all other results are invalid.");
8484

8585
Debug.WriteLine("Starting thread 1");
@@ -120,7 +120,6 @@ public void Threading_ThreadStart_Test2()
120120
Debug.WriteLine("Starts two threads with ThreadStart Delegate,");
121121
Debug.WriteLine("waits for them to complete and passes, ");
122122
Debug.WriteLine("this may erroneously fail for extremely slow devices.");
123-
Debug.WriteLine("This explicit declaration is not necessary as of .Net 2.0");
124123

125124
ThreadStart threadDelegate = new ThreadStart(Work.DoWork);
126125
Thread newThread1 = new Thread(threadDelegate);
@@ -199,7 +198,6 @@ public void Threading_Abort_Test3()
199198
throw new Exception("Expected both threads in Stopped state '" + ThreadState.Stopped +
200199
"' but got Thread1 in '" + tState1 + "' and Thread2 in '" + tState2 + "'");
201200
}
202-
Debug.WriteLine("This is Fixed, see 17343 for details");
203201
}
204202

205203
[TestMethod]
@@ -437,7 +435,6 @@ public void Threading_Priority_Test6()
437435

438436
Debug.WriteLine("Starts five threads of increasing priority and a control thread, priority not set ");
439437
Debug.WriteLine("verifies that they get increasing amounts of attention");
440-
Debug.WriteLine("This is Fixed, see 17201 for details");
441438

442439
threadLowest.Priority = ThreadPriority.Lowest;
443440
threadBelow.Priority = ThreadPriority.BelowNormal;
@@ -579,7 +576,6 @@ public void Threading_SleepApprox_Test8()
579576
/// </summary>
580577
///
581578
Debug.WriteLine("This test verifies the thread slept at least for the amount of time required");
582-
Debug.WriteLine("This is Fixed, see 20831 for details");
583579
int[] sleepTime = new int[] { 10, 100, 1000, 10000, 60000 };
584580
for (int i = 0; i < sleepTime.Length; i++)
585581
{
@@ -605,7 +601,6 @@ public void Threading_Suspend_Suspend_Test9()
605601
Debug.WriteLine("Gets the state of the 1st thread");
606602
Debug.WriteLine("Resumes the 1st thread ");
607603
Debug.WriteLine("Verifies that calling Suspend for the 2nd time has no effect");
608-
Debug.WriteLine("This is Fixed, see 20247 for details");
609604
Work.run = true;
610605
Work w1 = new Work();
611606
Thread newThread1 = new Thread(w1.DoWorkThreadState);
@@ -707,7 +702,6 @@ public void Threading_ThreadState_Suspend_Test11()
707702
Debug.WriteLine("Starts a second thread");
708703
Debug.WriteLine("Gets the state of the 1st thread and Resumes it");
709704
Debug.WriteLine("Verifies that the state of the 1st thread was Suspended");
710-
Debug.WriteLine("This is Fixed, see 20249 for details");
711705
Work.run = true;
712706
Work w1 = new Work();
713707
Thread newThread1 = new Thread(w1.DoWorkThreadState);
@@ -739,7 +733,6 @@ public void Threading_ThreadState_SuspendRequested_Test12()
739733
/// </summary>
740734
///
741735

742-
Debug.WriteLine("This currently fails, see 20737 for details");
743736
Debug.WriteLine("Starting 10 Threads");
744737
Thread[] newThread = new Thread[10];
745738
Work[] w = new Work[10];
@@ -792,7 +785,6 @@ public void Threading_ThreadState_Abort_Stopped_Test13()
792785
Debug.WriteLine("Starts a second thread");
793786
Debug.WriteLine("Gets the state of the 1st thread");
794787
Debug.WriteLine("Verifies the state of the 1st thread is Aborted");
795-
Debug.WriteLine("This is Fixed, see 20495 for details");
796788

797789
DateTime t1, t2;
798790
TimeSpan period;
@@ -857,7 +849,6 @@ public void Threading_Abort_ThreadAbortException_Test15()
857849

858850
Work.hasAborted = false;
859851
Thread newThread1 = new Thread(Work.DoWorkThreadAbortException);
860-
Debug.WriteLine("This is Fixed, see 20743 for details");
861852
Debug.WriteLine("starting a thread and Aborting it immediately");
862853
newThread1.Start();
863854
Thread.Sleep(50);
@@ -884,7 +875,6 @@ public void Threading_Join_Timeout_Test16()
884875
Debug.WriteLine("Starts two threads");
885876
Debug.WriteLine("Both threads Joins the main thread");
886877
Debug.WriteLine("verify calling thread (main thread) is blocked for millisecondsTimeout");
887-
Debug.WriteLine("This is fixed, see 20739 for details");
888878
Work.run = true;
889879
Work w = new Work();
890880

@@ -1005,7 +995,6 @@ public void Threading_Sleep_Zero_Test22()
1005995

1006996
Debug.WriteLine("Starting a thread , Thread.Sleep(0) on the main thread");
1007997
Debug.WriteLine("Verify the thread is immediately scheduled to execute");
1008-
Debug.WriteLine("This is fixed, see 20753 for details");
1009998
sleepZero = true;
1010999
Thread t1 = new Thread(new ThreadStart(SleepTest));
10111000
t1.Start();
@@ -1165,7 +1154,7 @@ public void Threading_CurrentThread_Test24()
11651154
public void Threading_Thread_CurrentThread_Suspend_Test26()
11661155
{
11671156
int count = 0;
1168-
Debug.WriteLine("This is fixed, see 19911 for details");
1157+
11691158
Thread newThread = new Thread(new ThreadStart(
11701159
delegate
11711160
{

Tests/NFUnitTestThread/UnitTestTimeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ public void Timer_TimerCallback_Null_Test8()
433433

434434
Debug.WriteLine("Creating timer: " +
435435
DateTime.UtcNow.ToString());
436-
Assert.Trows(typeof(Exception), () =>
436+
Assert.Trows(typeof(ArgumentNullException), () =>
437437
{
438-
Debug.WriteLine("Passing callback parameter to a timer should throw exception");
438+
Debug.WriteLine("Passing a 'null' callback parameter to a timer should throw exception");
439439
Timer stateTimer = new Timer(null, autoEvent, 1000, 250);
440440
Debug.WriteLine("Waiting and verifying");
441441
autoEvent.WaitOne(7500, false);

0 commit comments

Comments
 (0)