From d35e2f449a27e14f33c38827c31d88d1154a7beb Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 23 Mar 2024 17:35:21 +0000 Subject: [PATCH] Fix MainLoopTests. --- UnitTests/Application/MainLoopTests.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/UnitTests/Application/MainLoopTests.cs b/UnitTests/Application/MainLoopTests.cs index 043927478..0b4b63f85 100644 --- a/UnitTests/Application/MainLoopTests.cs +++ b/UnitTests/Application/MainLoopTests.cs @@ -625,7 +625,8 @@ public class MainLoopTests { Random r = new (); TextField tf = new (); - Application.Top.Add (tf); + var top = new Toplevel (); + top.Add (tf); const int numPasses = 5; const int numIncrements = 500; @@ -634,7 +635,7 @@ public class MainLoopTests Task task = Task.Run (() => RunTest (r, tf, numPasses, numIncrements, pollMs)); // blocks here until the RequestStop is processed at the end of the test - Application.Run (); + Application.Run (top); await task; // Propagate exception if any occurred @@ -672,7 +673,8 @@ public class MainLoopTests btnLaunch.Accept += (s, e) => action (); - Application.Top.Add (btnLaunch); + var top = new Toplevel (); + top.Add (btnLaunch); int iterations = -1; @@ -711,7 +713,7 @@ public class MainLoopTests } }; - Application.Run (); + Application.Run (top); Assert.True (taskCompleted); Assert.Equal (clickMe, btn.Text);