Author: martin
Date: 2008-02-15 06:58:53 -0500 (Fri, 15 Feb 2008)
New Revision: 95740
Added:
branches/martin/debugger-terrania/debugger/test/src/TestSSE.cs
branches/martin/debugger-terrania/debugger/test/testsuite/TestSSE.cs
Modified:
branches/martin/debugger-terrania/debugger/ChangeLog
branches/martin/debugger-terrania/debugger/test/src/Makefile.am
branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
Log:
2008-02-15 Martin Baulig <[EMAIL PROTECTED]>
* test/{testsuite|src}/TestSSE.cs: New tests.
* test/{testsuite|src}/TestAnonymous.cs: Added new tests here.
Modified: branches/martin/debugger-terrania/debugger/ChangeLog
===================================================================
--- branches/martin/debugger-terrania/debugger/ChangeLog 2008-02-15
11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/ChangeLog 2008-02-15
11:58:53 UTC (rev 95740)
@@ -1,3 +1,16 @@
+2008-02-15 Martin Baulig <[EMAIL PROTECTED]>
+
+ * test/{testsuite|src}/TestSSE.cs: New tests.
+
+ * test/{testsuite|src}/TestAnonymous.cs: Added new tests here.
+
+2008-02-15 Martin Baulig <[EMAIL PROTECTED]>
+
+ * classes/TargetBinaryReader.cs
+ (TargetBinaryReader): Added ReadSByte() and PeekSByte().
+
+ * backend/arch/X86_Instruction.cs: Use ReadSByte(), not ReadByte().
+
2008-02-08 Martin Baulig <[EMAIL PROTECTED]>
* languages/TargetStructType.cs
Modified: branches/martin/debugger-terrania/debugger/test/src/Makefile.am
===================================================================
--- branches/martin/debugger-terrania/debugger/test/src/Makefile.am
2008-02-15 11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/test/src/Makefile.am
2008-02-15 11:58:53 UTC (rev 95740)
@@ -13,7 +13,7 @@
TestRestart.cs TestExec.cs TestChild.cs TestAttach.cs \
TestMethodLookup.cs TestMultiThread.cs TestSession.cs \
TestCCtor.cs TestSimpleGenerics.cs TestRecursiveGenerics.cs \
- TestAnonymous.cs
+ TestAnonymous.cs TestSSE.cs
EXTRA_TEST_SRC = \
TestAppDomain.cs TestAppDomain-Module.cs TestAppDomain-Hello.cs \
Modified: branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
2008-02-15 11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/test/src/TestAnonymous.cs
2008-02-15 11:58:53 UTC (rev 95740)
@@ -51,8 +51,8 @@
{
public U Hello<U> (U u)
{
- return u;
- } // @MDB
BREAKPOINT: test2 hello
+ return u; // @MDB
BREAKPOINT: test2 hello
+ }
public void Test<T> (T t)
{
@@ -115,8 +115,8 @@
{
public static void Hello<S> (T t, S s)
{
- Foo<long> foo = delegate (long r) { // @MDB
LINE: test4 foo
- Console.WriteLine (r);
+ Foo<long> foo = delegate (long r) {
+ Console.WriteLine (r); // @MDB
LINE: test4 foo
Bar<T> bar = delegate (T x) {
Console.WriteLine (r); // @MDB
LINE: test4 bar
Console.WriteLine (t);
Added: branches/martin/debugger-terrania/debugger/test/src/TestSSE.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/src/TestSSE.cs
2008-02-15 11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/test/src/TestSSE.cs
2008-02-15 11:58:53 UTC (rev 95740)
@@ -0,0 +1,51 @@
+using System;
+
+class RunTests
+{
+ static void Main ()
+ {
+ WhileLoop.Run (); // @MDB LINE:
main
+ Foreach.Run ();
+ }
+}
+
+public class WhileLoop
+{
+ static int total;
+
+ static bool Test ()
+ {
+ return total < 50; // @MDB LINE:
while test
+ }
+
+ static object Total {
+ get {
+ return total; // @MDB LINE:
while total
+ }
+ }
+
+ public static int Run ()
+ {
+ total = 4; // @MDB
BREAKPOINT: while run
+
+ while (Test ()) // @MDB LINE:
while loop
+ total += (int) Total; // @MDB LINE:
while statement
+
+ return total; // @MDB
BREAKPOINT: while return
+ }
+}
+
+public class Foreach
+{
+ public static int[] Values {
+ get { return new[] { 3, 9, 16, 25 }; } // @MDB LINE:
foreach values
+ }
+
+ public static int Run ()
+ {
+ int total = 0; // @MDB
BREAKPOINT: foreach run
+ foreach (int value in Values) // @MDB LINE:
foreach loop
+ total += value; // @MDB LINE:
foreach statement
+ return total; // @MDB
BREAKPOINT: foreach return
+ }
+}
Modified:
branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
2008-02-15 11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/test/testsuite/TestAnonymous.cs
2008-02-15 11:58:53 UTC (rev 95740)
@@ -168,10 +168,6 @@
AssertStopped (thread,
"Test4.Test`1/<>c__CompilerGenerated3`1<T,S>.<Hello>c__11(long)",
GetLine ("test4 foo"));
- AssertExecute ("step");
- AssertStopped (thread,
-
"Test4.Test`1/<>c__CompilerGenerated3`1<T,S>.<Hello>c__11(long)",
- GetLine ("test4 foo") + 1);
AssertPrint (thread, "r", "(long) 5");
AssertType (thread, "r", "long");
@@ -184,7 +180,7 @@
AssertTargetOutput ("5");
AssertStopped (thread,
"Test4.Test`1/<>c__CompilerGenerated3`1<T,S>.<Hello>c__11(long)",
- GetLine ("test4 foo") + 2);
+ GetLine ("test4 foo") + 1);
AssertExecute ("next");
AssertStopped (thread,
Added: branches/martin/debugger-terrania/debugger/test/testsuite/TestSSE.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/test/testsuite/TestSSE.cs
2008-02-15 11:58:12 UTC (rev 95739)
+++ branches/martin/debugger-terrania/debugger/test/testsuite/TestSSE.cs
2008-02-15 11:58:53 UTC (rev 95740)
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+
+using Mono.Debugger;
+using Mono.Debugger.Languages;
+using Mono.Debugger.Frontend;
+
+namespace Mono.Debugger.Tests
+{
+ [TestFixture]
+ public class TestSSE : TestSuite
+ {
+ public TestSSE ()
+ : base ("TestSSE")
+ { }
+
+ [Test]
+ [Category("SSE")]
+ public void Main ()
+ {
+ Process process = Start ();
+ Assert.IsTrue (process.IsManaged);
+ Assert.IsTrue (process.MainThread.IsStopped);
+
+ Thread thread = process.MainThread;
+
+ AssertStopped (thread, "RunTests.Main()", GetLine
("main"));
+ AssertExecute ("continue");
+
+ //
+ // While loop
+ //
+
+ AssertHitBreakpoint (thread, "while run",
"WhileLoop.Run()");
+ AssertExecute ("step");
+
+ AssertStopped (thread, "WhileLoop.Run()", GetLine
("while loop"));
+ AssertExecute ("step");
+ AssertStopped (thread, "WhileLoop.Test()", GetLine
("while test"));
+ AssertExecute ("step");
+ AssertStopped (thread, "WhileLoop.Run()", GetLine
("while statement"));
+ AssertExecute ("step");
+ AssertStopped (thread, "WhileLoop.get_Total()", GetLine
("while total"));
+ AssertExecute ("step");
+ AssertStopped (thread, "WhileLoop.Run()", GetLine
("while loop"));
+ AssertExecute ("next");
+ AssertStopped (thread, "WhileLoop.Run()", GetLine
("while statement"));
+ AssertExecute ("next");
+ AssertStopped (thread, "WhileLoop.Run()", GetLine
("while loop"));
+
+ AssertExecute ("continue");
+ AssertHitBreakpoint (thread, "while return",
"WhileLoop.Run()");
+
+ AssertExecute ("continue");
+
+ //
+ // Foreach loop
+ //
+
+ AssertHitBreakpoint (thread, "foreach run",
"Foreach.Run()");
+ AssertExecute ("step");
+
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach loop"));
+ AssertExecute ("step");
+ AssertStopped (thread, "Foreach.get_Values()", GetLine
("foreach values"));
+ AssertExecute ("next");
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach statement"));
+ AssertExecute ("step");
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach loop"));
+ AssertExecute ("step");
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach statement"));
+ AssertExecute ("next");
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach loop"));
+ AssertExecute ("next");
+ AssertStopped (thread, "Foreach.Run()", GetLine
("foreach statement"));
+
+ AssertExecute ("continue");
+ AssertHitBreakpoint (thread, "foreach return",
"Foreach.Run()");
+
+ //
+ // Done
+ //
+
+ AssertExecute ("continue");
+ AssertTargetExited (thread.Process);
+ }
+ }
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches