Skip to content

Commit

Permalink
Merge branch 'develop-unit-test' of https://github.com/nanoframework/…
Browse files Browse the repository at this point in the history
…lib-CoreLibrary into develop-unit-test
  • Loading branch information
Ellerbach committed Mar 5, 2021
2 parents 5be81cc + a542381 commit 5e5980b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
2 changes: 0 additions & 2 deletions Tests/NFUnitTestThread/UnitTestInterlocTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public void Interlocked3_Exchange_Boundary_Test()
/// </summary>
///

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

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

Expand Down
5 changes: 1 addition & 4 deletions Tests/NFUnitTestThread/UnitTestMonitorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public void Monitor2_SynchronizationLockException_Test()
/// </summary>
///
Debug.WriteLine("Verify SynchronizationLockException exception is thrown");
Debug.WriteLine("This currently fails, see 20281");
Debug.WriteLine("Calling Monitor.Exit without first calling Monitor.Enter should throw an exception");
Assert.Trows(typeof(Exception), () => { Monitor.Exit(locker1); });
}
Expand All @@ -141,7 +140,6 @@ public void Monitor3_Enter_ArgumentNullException_Test()
///

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

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

Expand Down
15 changes: 2 additions & 13 deletions Tests/NFUnitTestThread/UnitTestThreadTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void Threading_Basic_Test1()
Debug.WriteLine("Starting a thread without explicit declaration of ThreadStart Delegate");
Debug.WriteLine("Starts two threads, waits for them to complete and passes, ");
Debug.WriteLine("this may erroneously fail for extremely slow devices.");
Debug.WriteLine("All other threading tests are dependant on this, if this fails, ");
Debug.WriteLine("All other threading tests are dependent on this, if this fails, ");
Debug.WriteLine("all other results are invalid.");

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

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

[TestMethod]
Expand Down Expand Up @@ -437,7 +435,6 @@ public void Threading_Priority_Test6()

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

threadLowest.Priority = ThreadPriority.Lowest;
threadBelow.Priority = ThreadPriority.BelowNormal;
Expand Down Expand Up @@ -579,7 +576,6 @@ public void Threading_SleepApprox_Test8()
/// </summary>
///
Debug.WriteLine("This test verifies the thread slept at least for the amount of time required");
Debug.WriteLine("This is Fixed, see 20831 for details");
int[] sleepTime = new int[] { 10, 100, 1000, 10000, 60000 };
for (int i = 0; i < sleepTime.Length; i++)
{
Expand All @@ -605,7 +601,6 @@ public void Threading_Suspend_Suspend_Test9()
Debug.WriteLine("Gets the state of the 1st thread");
Debug.WriteLine("Resumes the 1st thread ");
Debug.WriteLine("Verifies that calling Suspend for the 2nd time has no effect");
Debug.WriteLine("This is Fixed, see 20247 for details");
Work.run = true;
Work w1 = new Work();
Thread newThread1 = new Thread(w1.DoWorkThreadState);
Expand Down Expand Up @@ -707,7 +702,6 @@ public void Threading_ThreadState_Suspend_Test11()
Debug.WriteLine("Starts a second thread");
Debug.WriteLine("Gets the state of the 1st thread and Resumes it");
Debug.WriteLine("Verifies that the state of the 1st thread was Suspended");
Debug.WriteLine("This is Fixed, see 20249 for details");
Work.run = true;
Work w1 = new Work();
Thread newThread1 = new Thread(w1.DoWorkThreadState);
Expand Down Expand Up @@ -739,7 +733,6 @@ public void Threading_ThreadState_SuspendRequested_Test12()
/// </summary>
///

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

DateTime t1, t2;
TimeSpan period;
Expand Down Expand Up @@ -857,7 +849,6 @@ public void Threading_Abort_ThreadAbortException_Test15()

Work.hasAborted = false;
Thread newThread1 = new Thread(Work.DoWorkThreadAbortException);
Debug.WriteLine("This is Fixed, see 20743 for details");
Debug.WriteLine("starting a thread and Aborting it immediately");
newThread1.Start();
Thread.Sleep(50);
Expand All @@ -884,7 +875,6 @@ public void Threading_Join_Timeout_Test16()
Debug.WriteLine("Starts two threads");
Debug.WriteLine("Both threads Joins the main thread");
Debug.WriteLine("verify calling thread (main thread) is blocked for millisecondsTimeout");
Debug.WriteLine("This is fixed, see 20739 for details");
Work.run = true;
Work w = new Work();

Expand Down Expand Up @@ -1005,7 +995,6 @@ public void Threading_Sleep_Zero_Test22()

Debug.WriteLine("Starting a thread , Thread.Sleep(0) on the main thread");
Debug.WriteLine("Verify the thread is immediately scheduled to execute");
Debug.WriteLine("This is fixed, see 20753 for details");
sleepZero = true;
Thread t1 = new Thread(new ThreadStart(SleepTest));
t1.Start();
Expand Down Expand Up @@ -1165,7 +1154,7 @@ public void Threading_CurrentThread_Test24()
public void Threading_Thread_CurrentThread_Suspend_Test26()
{
int count = 0;
Debug.WriteLine("This is fixed, see 19911 for details");

Thread newThread = new Thread(new ThreadStart(
delegate
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/NFUnitTestThread/UnitTestTimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ public void Timer_TimerCallback_Null_Test8()

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

0 comments on commit 5e5980b

Please sign in to comment.