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

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Karlaš <david.karlas@xamarin.com>2015-01-27 23:24:30 +0300
committerDavid Karlaš <david.karlas@xamarin.com>2015-01-27 23:25:58 +0300
commitc8b2b1ceeb856e07aa3cc946bfc6b4549171eaab (patch)
treeeba6c639aff71d0bae943eccda64a92795cedf57 /main/src/addins/MonoDevelop.Debugger
parentdf9a3ff329b48fb53c3a8baa7173c1284eedec5d (diff)
[DebuggerTests] Added tests for virtual method calls and debugger-libs bump
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger')
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs65
1 files changed, 47 insertions, 18 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
index bfff7d35fe..373fd3e542 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
@@ -700,6 +700,18 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("string", richChildren [7].TypeName);
Assert.AreEqual ("\"stringB\"", richChildren [7].Value);
}
+
+ val = Eval ("numbers.GetLength(0)");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("3", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
}
[Test]
@@ -1430,11 +1442,6 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("int", val.TypeName);
//When fixed put into Inheriting test
- val = Eval ("b.TestMethod (\"23\")");
- Assert.AreEqual ("25", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
- //When fixed put into Inheriting test
val = Eval ("b.TestMethod (42)");
Assert.AreEqual ("44", val.Value);
Assert.AreEqual ("int", val.TypeName);
@@ -1456,19 +1463,6 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("1", val.Value);
Assert.AreEqual ("int", val.TypeName);
- //When fixed put into MemberReference
- val = Eval ("numbers.GetLength(0)");
- if (!AllowTargetInvokes) {
- var options = Session.Options.EvaluationOptions.Clone ();
- options.AllowTargetInvoke = true;
-
- Assert.IsTrue (val.IsNotSupported);
- val.Refresh (options);
- val = val.Sync ();
- }
- Assert.AreEqual ("3", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
//When fixed put into TypeReferenceGeneric
val = Eval ("Dictionary<string,NestedClass>");
Assert.AreEqual ("System.Collections.Generic.Dictionary<string,MonoDevelop.Debugger.Tests.TestApp.TestEvaluation.NestedClass>", val.Value);
@@ -1778,6 +1772,41 @@ namespace MonoDevelop.Debugger.Tests
}
Assert.AreEqual ("1", val.Value);
Assert.AreEqual ("int", val.TypeName);
+
+ if (soft != null && soft.ProtocolVersion < new Version (2, 40))
+ Assert.Ignore ("A newer version of the Mono runtime is required.");
+
+ val = Eval ("b.TestMethod (\"23\")");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("25", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
+
+ if (Session is SoftDebuggerSession) {
+ val = Eval ("System.Text.Encoding.UTF8.GetPreamble ()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("byte[]", val.TypeName);
+ Assert.AreEqual ("{byte[3]}", val.Value);
+ var bytes = ((RawValueArray)val.GetRawValue ()).ToArray ();
+ Assert.AreEqual (239, bytes.GetValue (0));
+ Assert.AreEqual (187, bytes.GetValue (1));
+ Assert.AreEqual (191, bytes.GetValue (2));
+ } else {
+ Assert.Ignore ("Not working on CorDebugger");
+ }
}
[Test]