Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kliger <aleksey@xamarin.com>2016-07-19 02:53:50 +0300
committerAleksey Kliger <aleksey@xamarin.com>2016-07-19 03:22:15 +0300
commitcf94a6fcd4e5f7c1fe065ceb3d8852e7a2f19e60 (patch)
tree50cb5b06cd2fcd82be9ea7f9052cb0f2af0a7e1a /mcs/class/Mono.Debugger.Soft
parent853500ac4cf56a0b909b01058f77bfdada7f7a3b (diff)
[test] Mono.Debugger.Soft test for async I/O tasks
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs19
-rw-r--r--mcs/class/Mono.Debugger.Soft/Test/dtest.cs24
2 files changed, 43 insertions, 0 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
index 4b9d569b1ad..f9d5df5af7f 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
@@ -9,6 +9,7 @@ using System.Reflection;
using System.Reflection.Emit;
using System.Diagnostics;
using System.Threading;
+using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
@@ -311,6 +312,10 @@ public class Tests : TestsBase, ITest2
wait_one ();
return 0;
}
+ if (args.Length >0 && args [0] == "threadpool-io") {
+ threadpool_io ();
+ return 0;
+ }
breakpoints ();
single_stepping ();
arguments ();
@@ -1541,6 +1546,20 @@ public class Tests : TestsBase, ITest2
public override string virtual_method () {
return "V2";
}
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void threadpool_io () {
+ Task<int> t = Task.Run (async () => {
+ var wc = new System.Net.WebClient ();
+ string filename = System.IO.Path.GetTempFileName ();
+
+ var dl = wc.DownloadFileTaskAsync ("http://www.mono-project.com/", filename);
+ await dl;
+ System.IO.File.Delete (filename);
+ return 1;
+ });
+ var n = t.Result;
+ }
}
class TypeLoadClass {
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
index c0af12cb38a..6407b9eae71 100644
--- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
+++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs
@@ -4035,6 +4035,30 @@ public class DebuggerTests
// Make sure we are still in the cctor
Assert.AreEqual (".cctor", e.Thread.GetFrames ()[0].Location.Method.Name);
}
+
+ [Test]
+ public void ThreadpoolIOsinglestep () {
+ // This is a regression test for #42625.
+ // It tests the interaction (particularly in coop GC of
+ // the threadpool I/O mechanism and the soft debugger.
+ Start (new string [] { "dtest-app.exe", "threadpool-io" });
+
+ Event e = run_until ("threadpool_io");
+ var req = create_step (e);
+ req.Enable ();
+
+ // step to start the task
+ e = step_once ();
+
+ req.Disable ();
+
+ // run until completion of the test method
+ e = step_out ();
+
+ vm.Resume ();
+
+ vm.Suspend ();
+ }
}
}