From 231bafdaa4c7005ab1e851f1155824df3a516068 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 5 Mar 2021 02:01:36 +0000 Subject: [PATCH 1/5] Update test framework - Nuget and sub-module. --- Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj | 6 +++--- Tests/NFUnitTestAdpater/packages.config | 2 +- nanoFramework.TestFramework | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj index 8b0afbd7..d5978a37 100644 --- a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj +++ b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj @@ -36,13 +36,13 @@ True True - - ..\..\packages\nanoFramework.TestFramework.1.0.73\lib\nanoFramework.TestFramework.dll + + ..\..\packages\nanoFramework.TestFramework.1.0.77\lib\nanoFramework.TestFramework.dll True True - ..\..\packages\nanoFramework.TestFramework.1.0.73\lib\nanoFramework.UnitTestLauncher.exe + ..\..\packages\nanoFramework.TestFramework.1.0.77\lib\nanoFramework.UnitTestLauncher.exe True True diff --git a/Tests/NFUnitTestAdpater/packages.config b/Tests/NFUnitTestAdpater/packages.config index 04dc8dfa..83c53656 100644 --- a/Tests/NFUnitTestAdpater/packages.config +++ b/Tests/NFUnitTestAdpater/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index 49e25adf..bd687bf0 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit 49e25adfc837c4af433674a982d41ce5f187313b +Subproject commit bd687bf060d500ab597065b34c97e2c6f4556356 From 1e25dcf4142cd472fa271ca46e560dee8bd3b007 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 5 Mar 2021 11:53:51 +0000 Subject: [PATCH 2/5] Update test framework to 1.0.79 --- Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj | 6 +++--- Tests/NFUnitTestAdpater/packages.config | 2 +- nanoFramework.TestFramework | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj index d5978a37..87be69cc 100644 --- a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj +++ b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj @@ -36,13 +36,13 @@ True True - - ..\..\packages\nanoFramework.TestFramework.1.0.77\lib\nanoFramework.TestFramework.dll + + ..\..\packages\nanoFramework.TestFramework.1.0.79\lib\nanoFramework.TestFramework.dll True True - ..\..\packages\nanoFramework.TestFramework.1.0.77\lib\nanoFramework.UnitTestLauncher.exe + ..\..\packages\nanoFramework.TestFramework.1.0.79\lib\nanoFramework.UnitTestLauncher.exe True True diff --git a/Tests/NFUnitTestAdpater/packages.config b/Tests/NFUnitTestAdpater/packages.config index 83c53656..37c0bcb5 100644 --- a/Tests/NFUnitTestAdpater/packages.config +++ b/Tests/NFUnitTestAdpater/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index bd687bf0..3d19d62f 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit bd687bf060d500ab597065b34c97e2c6f4556356 +Subproject commit 3d19d62faa5925d2e17c5ab5815fe977daf158bc From 2ef64fd292c751e22ee6230b80e8faf964a909b4 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 5 Mar 2021 16:03:06 +0000 Subject: [PATCH 3/5] Fix exception type being checked --- Tests/NFUnitTestThread/UnitTestTimeTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/NFUnitTestThread/UnitTestTimeTests.cs b/Tests/NFUnitTestThread/UnitTestTimeTests.cs index 5aa5b1ed..a945df62 100644 --- a/Tests/NFUnitTestThread/UnitTestTimeTests.cs +++ b/Tests/NFUnitTestThread/UnitTestTimeTests.cs @@ -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); From 612c3de17d74aa8e82c03bcec5907966c800bdff Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 5 Mar 2021 16:05:37 +0000 Subject: [PATCH 4/5] Update test framework nuget and sub-module --- Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj | 6 +++--- Tests/NFUnitTestAdpater/packages.config | 2 +- nanoFramework.TestFramework | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj index 87be69cc..208ec9ed 100644 --- a/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj +++ b/Tests/NFUnitTestAdpater/NFUnitTestAdapater.nfproj @@ -36,13 +36,13 @@ True True - - ..\..\packages\nanoFramework.TestFramework.1.0.79\lib\nanoFramework.TestFramework.dll + + ..\..\packages\nanoFramework.TestFramework.1.0.80\lib\nanoFramework.TestFramework.dll True True - ..\..\packages\nanoFramework.TestFramework.1.0.79\lib\nanoFramework.UnitTestLauncher.exe + ..\..\packages\nanoFramework.TestFramework.1.0.80\lib\nanoFramework.UnitTestLauncher.exe True True diff --git a/Tests/NFUnitTestAdpater/packages.config b/Tests/NFUnitTestAdpater/packages.config index 37c0bcb5..ebbccb7e 100644 --- a/Tests/NFUnitTestAdpater/packages.config +++ b/Tests/NFUnitTestAdpater/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/nanoFramework.TestFramework b/nanoFramework.TestFramework index 3d19d62f..f8b6710c 160000 --- a/nanoFramework.TestFramework +++ b/nanoFramework.TestFramework @@ -1 +1 @@ -Subproject commit 3d19d62faa5925d2e17c5ab5815fe977daf158bc +Subproject commit f8b6710c724ce5209c26689b98df5b248e45977b From a542381ba11fda343a665921c35dc5f625adebdf Mon Sep 17 00:00:00 2001 From: josesimoes Date: Fri, 5 Mar 2021 16:21:24 +0000 Subject: [PATCH 5/5] Remove obsolete comemnts from Thread unit tests. --- Tests/NFUnitTestThread/UnitTestInterlocTests.cs | 2 -- Tests/NFUnitTestThread/UnitTestMonitorTests.cs | 5 +---- Tests/NFUnitTestThread/UnitTestThreadTest.cs | 15 ++------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs index aa21def3..e7cebfd8 100644 --- a/Tests/NFUnitTestThread/UnitTestInterlocTests.cs +++ b/Tests/NFUnitTestThread/UnitTestInterlocTests.cs @@ -207,7 +207,6 @@ public void Interlocked3_Exchange_Boundary_Test() /// /// - 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"); @@ -246,7 +245,6 @@ public void Interlocked4_CompareExchange_Boundary_Test() /// /// - Debug.WriteLine("This is Fixed, see 20323 for details"); int[] value = new int[] { -2147483648, 0, 2147483647 }; int temp1, temp2; diff --git a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs index a8f8cecd..f54250bb 100644 --- a/Tests/NFUnitTestThread/UnitTestMonitorTests.cs +++ b/Tests/NFUnitTestThread/UnitTestMonitorTests.cs @@ -126,7 +126,6 @@ public void Monitor2_SynchronizationLockException_Test() /// /// 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); }); } @@ -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); }); @@ -156,8 +154,7 @@ public void Monitor4_Exit_ArgumentNullException_Test() /// /// 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); }); } diff --git a/Tests/NFUnitTestThread/UnitTestThreadTest.cs b/Tests/NFUnitTestThread/UnitTestThreadTest.cs index 14e59cc0..dfa11a2a 100644 --- a/Tests/NFUnitTestThread/UnitTestThreadTest.cs +++ b/Tests/NFUnitTestThread/UnitTestThreadTest.cs @@ -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"); @@ -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); @@ -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] @@ -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; @@ -579,7 +576,6 @@ public void Threading_SleepApprox_Test8() /// /// 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++) { @@ -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); @@ -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); @@ -739,7 +733,6 @@ public void Threading_ThreadState_SuspendRequested_Test12() /// /// - Debug.WriteLine("This currently fails, see 20737 for details"); Debug.WriteLine("Starting 10 Threads"); Thread[] newThread = new Thread[10]; Work[] w = new Work[10]; @@ -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; @@ -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); @@ -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(); @@ -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(); @@ -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 {