Browse Source

Updated Stepping test

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2856 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
2b2b1a35ee
  1. 12
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs
  2. 126
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.cs

12
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs

@ -169,6 +169,18 @@ namespace Debugger.Tests @@ -169,6 +169,18 @@ namespace Debugger.Tests
Serialize(dumpNode, obj, 16, new List<object>());
}
public void ObjectDumpToString(string name, object obj)
{
XmlElement dumpNode = testDoc.CreateElement("Object");
if (name != null) dumpNode.SetAttribute("name", name);
testNode.AppendChild(dumpNode);
if (obj == null) {
dumpNode.AppendChild(dumpNode.OwnerDocument.CreateTextNode("null"));
} else {
dumpNode.AppendChild(dumpNode.OwnerDocument.CreateTextNode(obj.ToString()));
}
}
List<string> expandProperties;
protected void ExpandProperties(params string[] props)

126
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Stepping.cs

@ -42,39 +42,39 @@ namespace Debugger.Tests { @@ -42,39 +42,39 @@ namespace Debugger.Tests {
{
StartTest("Stepping.cs");
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Debugger.Break
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Debug.WriteLine 1
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // Method Sub
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // '{'
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepInto(); // Debug.WriteLine 2
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOut(); // Method Sub
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Method Sub
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.StepOver(); // Method Sub2
WaitForPause();
ObjectDump("SelectedStackFrame", process.SelectedStackFrame);
ObjectDumpToString("NextStatement", process.SelectedStackFrame.NextStatement);
process.Continue();
process.WaitForExit();
@ -93,120 +93,30 @@ namespace Debugger.Tests { @@ -93,120 +93,30 @@ namespace Debugger.Tests {
<ModuleLoaded symbols="True">Stepping.exe</ModuleLoaded>
<ModuleLoaded symbols="False">System.dll</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=16,4 End=16,40</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=16,4 End=16,40</Object>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=17,4 End=17,44</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=17,4 End=17,44</Object>
<ModuleLoaded symbols="False">System.Configuration.dll</ModuleLoaded>
<ModuleLoaded symbols="False">System.Xml.dll</ModuleLoaded>
<LogMessage>1\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=18,4 End=18,10</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=18,4 End=18,10</Object>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Sub">
<MethodInfo>Sub</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=23,3 End=23,4</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=23,3 End=23,4</Object>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Sub">
<MethodInfo>Sub</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=24,4 End=24,44</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=24,4 End=24,44</Object>
<LogMessage>2\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Sub">
<MethodInfo>Sub</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=25,4 End=25,44</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=25,4 End=25,44</Object>
<LogMessage>3\r\n</LogMessage>
<LogMessage>4\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=18,4 End=18,10</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=18,4 End=18,10</Object>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=19,4 End=19,11</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=19,4 End=19,11</Object>
<LogMessage>5\r\n</LogMessage>
<DebuggingPaused>StepComplete</DebuggingPaused>
<Object name="SelectedStackFrame" Type="StackFrame" ToString="Debugger.Tests.TestPrograms.Stepping.Main">
<MethodInfo>Main</MethodInfo>
<HasSymbols>True</HasSymbols>
<HasExpired>False</HasExpired>
<NextStatement>Start=20,3 End=20,4</NextStatement>
<ThisValue exception="Static method does not have 'this'." />
<ContaingClassVariables>[ValueCollection Count=0]</ContaingClassVariables>
<ArgumentCount>0</ArgumentCount>
<Arguments>[ValueCollection Count=0]</Arguments>
<LocalVariables>[ValueCollection Count=0]</LocalVariables>
</Object>
<Object name="NextStatement">Start=20,3 End=20,4</Object>
<ProcessExited />
</Test>
</DebuggerTests>

Loading…
Cancel
Save