[mono/monodevelop] 4b54ee25: [Debugger] Source analysis cleanup on debugger tests.

"Therzok ([email protected])" <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141eb8cd16d-06f44305-7e17-4bf2-a6b4-ad554199936e-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/monodevelop
  Compare: https://github.com/mono/monodevelop/compare/c4a1ce124190...4b54ee252ebc

   Commit: 4b54ee252ebcef1b859ca513b88f84534ca37750
   Author: Therzok <[email protected]> (Therzok)
     Date: 2013-10-24 17:37:37 GMT
      URL: https://github.com/mono/monodevelop/commit/4b54ee252ebcef1b859ca513b88f84534ca37750

[Debugger] Source analysis cleanup on debugger tests.

Changed paths:
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/Main.cs
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/SdbEvaluationTests.cs
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/SdbStackFrameTests.cs
  M main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/StackFrameTests.cs

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/Main.cs
===================================================================
@@ -43,13 +43,13 @@ public static void Main (string[] args)
 
 		static string staticString = "some static";
 		string someString = "hi";
-		string[] numbers = new string[] { "one","two","three" };
+		string[] numbers = { "one","two","three" };
 		
 		public void TestEvaluation ()
 		{
 			int n = 32;
 			decimal dec = 123.456m;
-			ArrayList alist = new ArrayList ();
+			var alist = new ArrayList ();
 			alist.Add (1);
 			alist.Add ("two");
 			alist.Add (3);
@@ -58,12 +58,12 @@ public void TestEvaluation ()
 			A b = new B ();
 			A a = new A ();
 			
-			WithDisplayString withDisplayString = new WithDisplayString ();
-			WithProxy withProxy = new WithProxy ();
-			WithToString withToString = new WithToString ();
+			var withDisplayString = new WithDisplayString ();
+			var withProxy = new WithProxy ();
+			var withToString = new WithToString ();
 			
-			int[][] numbersArrays = new int [2][];
-			int[,,] numbersMulti = new int [3,4,5];
+			var numbersArrays = new int [2][];
+			var numbersMulti = new int [3,4,5];
 			
 			var dict = new Dictionary<int, string[]> ();
 			var dictArray = new Dictionary<int, string[]> [2,3];

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs
===================================================================
@@ -25,7 +25,6 @@
 // THE SOFTWARE.
 
 using System;
-using NUnit.Framework;
 using UnitTests;
 using Mono.Debugging.Client;
 using MonoDevelop.Core;
@@ -38,10 +37,10 @@ namespace MonoDevelop.Debugger.Tests
 {
 	public abstract class DebugTests: TestBase
 	{
-		string eid;
+		readonly string eid;
 		DebuggerEngine engine;
 		
-		public DebugTests (string engineId)
+		protected DebugTests (string engineId)
 		{
 			eid = engineId;
 		}
@@ -60,23 +59,23 @@ public override void Setup ()
 		
 		protected DebuggerSession Start (string test)
 		{
-			DotNetExecutionCommand cmd = new DotNetExecutionCommand ();
+			var cmd = new DotNetExecutionCommand ();
 			cmd.Command = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), "MonoDevelop.Debugger.Tests.TestApp.exe");
 			cmd.Arguments = test;
 			
 			DebuggerStartInfo si = engine.CreateDebuggerStartInfo (cmd);
 			DebuggerSession session = engine.CreateSession ();
-			DebuggerSessionOptions ops = new DebuggerSessionOptions ();
+			var ops = new DebuggerSessionOptions ();
 			ops.EvaluationOptions = EvaluationOptions.DefaultOptions;
 			ops.EvaluationOptions.EvaluationTimeout = 100000;
 
 			FilePath path = Util.TestsRootDir;
 			path = path.ParentDirectory.Combine ("src","addins","MonoDevelop.Debugger","MonoDevelop.Debugger.Tests.TestApp","Main.cs").FullPath;
 			TextFile file = TextFile.ReadFile (path);
-			int i = file.Text.IndexOf ("void " + test);
+			int i = file.Text.IndexOf ("void " + test, StringComparison.Ordinal);
 			if (i == -1)
 				throw new Exception ("Test not found: " + test);
-			i = file.Text.IndexOf ("/*break*/", i);
+			i = file.Text.IndexOf ("/*break*/", i, StringComparison.Ordinal);
 			if (i == -1)
 				throw new Exception ("Break marker not found: " + test);
 			int line, col;
@@ -84,11 +83,9 @@ protected DebuggerSession Start (string test)
 			Breakpoint bp = session.Breakpoints.Add (path, line);
 			bp.Enabled = true;
 			
-			ManualResetEvent done = new ManualResetEvent (false);
+			var done = new ManualResetEvent (false);
 			
-			session.OutputWriter = delegate (bool isStderr, string text) {
-				Console.WriteLine ("PROC:" + text);
-			};
+			session.OutputWriter = (isStderr, text) => Console.WriteLine ("PROC:" + text);
 			
 			session.TargetHitBreakpoint += delegate {
 				done.Set ();

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
===================================================================
@@ -24,7 +24,6 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-using System;
 using Mono.Debugging.Client;
 using NUnit.Framework;
 
@@ -35,7 +34,7 @@ public abstract class EvaluationTests: DebugTests
 		DebuggerSession ds;
 		StackFrame frame;
 		
-		public EvaluationTests (string de): base (de)
+		protected EvaluationTests (string de): base (de)
 		{
 		}
 		
@@ -59,7 +58,7 @@ ObjectValue Eval (string exp)
 			return frame.GetExpressionValue (exp, true).Sync ();
 		}
 		
-		[Test()]
+		[Test]
 		public void This ()
 		{
 			ObjectValue val = Eval ("this");
@@ -67,7 +66,7 @@ public void This ()
 			Assert.AreEqual ("MonoDevelop.Debugger.Tests.TestApp.MainClass", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void UnaryOperators ()
 		{
 			ObjectValue val = Eval ("~1234");
@@ -91,7 +90,7 @@ public void UnaryOperators ()
 			Assert.AreEqual ("int", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void TypeReference ()
 		{
 			ObjectValue val = Eval ("System.String");
@@ -110,7 +109,7 @@ public void TypeReference ()
 			Assert.AreEqual (ObjectValueFlags.Type, val.Flags & ObjectValueFlags.OriginMask);
 		}
 		
-		[Test()]
+		[Test]
 		public virtual void TypeReferenceGeneric ()
 		{
 			ObjectValue val = Eval ("System.Collections.Generic.Dictionary<string,int>");
@@ -119,7 +118,7 @@ public virtual void TypeReferenceGeneric ()
 			Assert.AreEqual (ObjectValueFlags.Type, val.Flags & ObjectValueFlags.OriginMask);
 		}
 		
-		[Test()]
+		[Test]
 		public virtual void Typeof ()
 		{
 			ObjectValue val = Eval ("typeof(System.Console)");
@@ -127,7 +126,7 @@ public virtual void Typeof ()
 			Assert.AreEqual ("{System.Console}", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public void MethodInvoke ()
 		{
 			ObjectValue val;
@@ -168,7 +167,7 @@ public void MethodInvoke ()
 			Assert.AreEqual ("string", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void Indexers ()
 		{
 			ObjectValue val = Eval ("numbers[0]");
@@ -200,7 +199,7 @@ public void Indexers ()
 			Assert.AreEqual ("int", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void MemberReference ()
 		{
 			ObjectValue val = Eval ("alist.Count");
@@ -226,7 +225,7 @@ public void MemberReference ()
 			Assert.AreEqual ("string", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void ConditionalExpression ()
 		{
 			ObjectValue val = Eval ("true ? \"yes\" : \"no\"");
@@ -238,7 +237,7 @@ public void ConditionalExpression ()
 			Assert.AreEqual ("string", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void Cast ()
 		{
 			ObjectValue val;
@@ -364,7 +363,7 @@ public void Cast ()
 			Assert.AreEqual ("SomeEnum", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void BinaryOperators ()
 		{
 			ObjectValue val;
@@ -457,7 +456,7 @@ public void BinaryOperators ()
 			Assert.AreEqual ("bool", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public virtual void Assignment ()
 		{
 			ObjectValue val;
@@ -494,7 +493,7 @@ public virtual void Assignment ()
 			Assert.AreEqual ("1", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public virtual void AssignmentStatic ()
 		{
 			ObjectValue val;
@@ -508,7 +507,7 @@ public virtual void AssignmentStatic ()
 			Assert.AreEqual ("\"some static\"", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatBool ()
 		{
 			ObjectValue val;
@@ -518,7 +517,7 @@ public void FormatBool ()
 			Assert.AreEqual ("false", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatNumber ()
 		{
 			ObjectValue val;
@@ -545,7 +544,7 @@ public void FormatNumber ()
 			Assert.AreEqual ("123.456", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatString ()
 		{
 			ObjectValue val;
@@ -559,7 +558,7 @@ public void FormatString ()
 			Assert.AreEqual ("\" \\\" \\\\ \\a \\b \\f \\v \\n \\r \\t\"", val.Value);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatChar ()
 		{
 			ObjectValue val;
@@ -612,7 +611,7 @@ public void FormatChar ()
 			Assert.AreEqual ("9 '\\t'", val.DisplayValue);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatObject ()
 		{
 			ObjectValue val;
@@ -634,7 +633,7 @@ public void FormatObject ()
 			Assert.AreEqual ("WithToString", val.TypeName);*/
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatArray ()
 		{
 			ObjectValue val;
@@ -652,7 +651,7 @@ public void FormatArray ()
 			Assert.AreEqual ("int[,,]", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatGeneric ()
 		{
 			ObjectValue val;
@@ -678,7 +677,7 @@ public void FormatGeneric ()
 			Assert.AreEqual ("Thing<string>.Done<int>", val.TypeName);
 		}
 		
-		[Test()]
+		[Test]
 		public void FormatEnum ()
 		{
 			ObjectValue val;

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/SdbEvaluationTests.cs
===================================================================
@@ -24,12 +24,11 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-using System;
 using NUnit.Framework;
 
 namespace MonoDevelop.Debugger.Tests.Soft
 {
-	[TestFixture()]
+	[TestFixture]
 	public class SdbEvaluationTests: EvaluationTests
 	{
 		public SdbEvaluationTests (): base ("Mono.Debugger.Soft")

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/SdbStackFrameTests.cs
===================================================================
@@ -24,12 +24,11 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-using System;
 using NUnit.Framework;
 
 namespace MonoDevelop.Debugger.Tests.Soft
 {
-	[TestFixture()]
+	[TestFixture]
 	public class SdbStackFrameTests: StackFrameTests
 	{
 		public SdbStackFrameTests (): base ("Mono.Debugger.Soft")

Modified: main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/StackFrameTests.cs
===================================================================
@@ -24,7 +24,6 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-using System;
 using Mono.Debugging.Client;
 using NUnit.Framework;
 
@@ -35,7 +34,7 @@ public abstract class StackFrameTests: DebugTests
 		DebuggerSession ds;
 		StackFrame frame;
 		
-		public StackFrameTests (string de): base (de)
+		protected StackFrameTests (string de): base (de)
 		{
 		}
 		


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.