Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mcs / class / Mono.Debugger.Soft / Test / dtest.cs
index e32317b71fe3880ed54f914d07d787ca342da916..e51cdc061a0accf8d07308fa4bbf81ffa194a440 100644 (file)
@@ -526,7 +526,11 @@ public class DebuggerTests
                e = step_over ();
                assert_location (e, "ss_nested");
                e = step_into ();
-               assert_location (e, "ss_nested_3");
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested_1");
+               e = step_into ();
+               assert_location (e, "ss_nested");
                req.Disable ();
 
                // Check DebuggerStepThrough support
@@ -1138,6 +1142,10 @@ public class DebuggerTests
                Assert.IsTrue (t.IsEnum);
                Assert.AreEqual ("Int32", t.EnumUnderlyingType.Name);
 
+               // TypedReferences
+               t = frame.Method.GetParameters ()[11].ParameterType;
+               Assert.AreEqual ("TypedReference", t.Name);
+
                // properties
                t = frame.Method.GetParameters ()[7].ParameterType;
 
@@ -1429,6 +1437,10 @@ public class DebuggerTests
                AssertValue (2, s ["i"]);
                AssertValue ("S2", s ["s"]);
 
+               // typedbyref
+               var typedref = frame.GetArgument (2) as StructMirror;
+               Assert.IsTrue (typedref is StructMirror);
+
                // Argument checking
                s = frame.GetArgument (0) as StructMirror;
                AssertThrows<ArgumentException> (delegate () {
@@ -1507,8 +1519,8 @@ public class DebuggerTests
                StackFrame frame = e.Thread.GetFrames () [0];
 
                var locals = frame.Method.GetLocals ();
-               Assert.AreEqual (8, locals.Length);
-               for (int i = 0; i < 8; ++i) {
+               Assert.AreEqual (9, locals.Length);
+               for (int i = 0; i < 9; ++i) {
                        if (locals [i].Name == "args") {
                                Assert.IsTrue (locals [i].IsArg);
                                Assert.AreEqual ("String[]", locals [i].Type.Name);
@@ -1532,6 +1544,7 @@ public class DebuggerTests
                                Assert.IsTrue (locals [i].IsArg);
                                Assert.AreEqual ("String", locals [i].Type.Name);
                        } else if (locals [i].Name == "astruct") {
+                       } else if (locals [i].Name == "alist") {
                        } else {
                                Assert.Fail ();
                        }
@@ -1616,6 +1629,8 @@ public class DebuggerTests
                                AssertValue ("AB", vals [i]);
                        if (locals [i].Name == "t")
                                AssertValue ("ABC", vals [i]);
+                       if (locals [i].Name == "alist") {
+                       }
                }
 
                // Argument checking
@@ -2258,6 +2273,17 @@ public class DebuggerTests
                task = s.InvokeMethodAsyncWithResult (e.Thread, m, null);
                out_this = task.Result.OutThis as StructMirror;
                Assert.AreEqual (null, out_this);
+
+               // interface method
+               var cl1 = frame.Method.DeclaringType.Assembly.GetType ("ITest2");
+               m = cl1.GetMethod ("invoke_iface");
+               v = s.InvokeMethod (e.Thread, m, null);
+               AssertValue (42, v);
+
+               // virtual method
+               m = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString");
+               v = s.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
+               AssertValue ("42", v);
 #endif
        }
 
@@ -3584,13 +3610,11 @@ public class DebuggerTests
                var prev_loc = locs.First (l => (l.LineNumber == frames [0].Location.LineNumber - 3));
                AssertValue (2, frames [0].GetValue (frames [0].Method.GetLocal ("i")));
 
-               Console.WriteLine ("X: " + frames [0].Location.LineNumber);
                // Set back the ip to the first i ++; line
                e.Thread.SetIP (prev_loc);
 
                e = step_over ();
                var f = e.Thread.GetFrames ()[0];
-               Console.WriteLine (f.GetValue (f.Method.GetLocal ("i")));
                AssertValue (3, f.GetValue (f.Method.GetLocal ("i")));
        }