This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
svn path=/trunk/debugger/; revision=59155
- Loading branch information
Martin Baulig
committed
Apr 6, 2006
1 parent
de5894f
commit 137207d
Showing
4 changed files
with
130 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
using System; | ||
using NUnit.Framework; | ||
|
||
using Mono.Debugger; | ||
using Mono.Debugger.Languages; | ||
using Mono.Debugger.Frontend; | ||
|
||
namespace Mono.Debugger.Tests | ||
{ | ||
[TestFixture] | ||
public class TestAbort : TestSuite | ||
{ | ||
public TestAbort () | ||
: base ("TestAbort") | ||
{ } | ||
|
||
[Test] | ||
public void Main () | ||
{ | ||
Process process = Interpreter.Start (); | ||
Assert.IsTrue (process.IsManaged); | ||
Assert.IsTrue (process.MainThread.IsStopped); | ||
Thread thread = process.MainThread; | ||
|
||
const int line_main = 33; | ||
const int line_hello = 13; | ||
const int line_hello_2 = 20; | ||
const int line_hello_3 = 22; | ||
const int line_hello_4 = 23; | ||
|
||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
AssertExecute ("call Hello()"); | ||
AssertStopped (thread, "X.Hello()", line_hello); | ||
|
||
Backtrace bt = thread.GetBacktrace (-1); | ||
if (bt.Count != 3) | ||
Assert.Fail ("Backtrace has {0} frames, but expected {1}.", | ||
bt.Count, 3); | ||
|
||
AssertFrame (bt [0], 0, "X.Hello()", line_hello); | ||
AssertInternalFrame (bt [1], 1); | ||
AssertFrame (bt [2], 2, "X.Main()", line_main); | ||
|
||
AssertExecute ("continue"); | ||
AssertTargetOutput ("Hello World"); | ||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
AssertExecute ("call Hello()"); | ||
AssertStopped (thread, "X.Hello()", line_hello); | ||
|
||
AssertExecute ("return -yes"); | ||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
AssertExecute ("call Hello (8)"); | ||
AssertStopped (thread, "X.Hello(System.Int32)", line_hello_2); | ||
AssertExecute ("return -yes"); | ||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
AssertExecute ("call Hello (9)"); | ||
AssertStopped (thread, "X.Hello(System.Int32)", line_hello_2); | ||
AssertExecute ("step"); | ||
AssertStopped (thread, "X.Hello(System.Int32)", line_hello_3); | ||
AssertExecute ("return -yes"); | ||
AssertTargetOutput ("Done: 9 18 1"); | ||
AssertNoTargetOutput (); | ||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
bt = thread.GetBacktrace (-1); | ||
if (bt.Count != 1) | ||
Assert.Fail ("Backtrace has {0} frames, but expected {1}.", | ||
bt.Count, 1); | ||
|
||
AssertFrame (bt [0], 0, "X.Main()", line_main); | ||
|
||
AssertExecute ("call Hello (7)"); | ||
AssertStopped (thread, "X.Hello(System.Int32)", line_hello_2); | ||
AssertExecute ("step"); | ||
AssertStopped (thread, "X.Hello(System.Int32)", line_hello_3); | ||
AssertExecute ("step"); | ||
AssertStopped (thread, "X.Hello()", line_hello); | ||
|
||
bt = thread.GetBacktrace (-1); | ||
if (bt.Count != 4) | ||
Assert.Fail ("Backtrace has {0} frames, but expected {1}.", | ||
bt.Count, 4); | ||
|
||
AssertFrame (bt [0], 0, "X.Hello()", line_hello); | ||
AssertFrame (bt [1], 1, "X.Hello(System.Int32)", line_hello_4); | ||
AssertInternalFrame (bt [2], 2); | ||
AssertFrame (bt [3], 3, "X.Main()", line_main); | ||
|
||
AssertExecute ("return -yes -invocation"); | ||
AssertTargetOutput ("Done: 7 14 2"); | ||
AssertNoTargetOutput (); | ||
|
||
AssertStopped (thread, "X.Main()", line_main); | ||
|
||
bt = thread.GetBacktrace (-1); | ||
if (bt.Count != 1) | ||
Assert.Fail ("Backtrace has {0} frames, but expected {1}.", | ||
bt.Count, 1); | ||
|
||
AssertFrame (bt [0], 0, "X.Main()", line_main); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters