Browse Source

Added 'Expressions' test

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2771 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
12f37461f5
  1. 16
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs
  2. 50
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.cs
  3. 490
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.xml

16
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs

@ -425,5 +425,21 @@ namespace Debugger.Tests
process.WaitForExit(); process.WaitForExit();
CheckXmlOutput(); CheckXmlOutput();
} }
[Test]
public void Expressions()
{
StartTest("Expressions");
WaitForPause();
ObjectDump("Variables", process.SelectedFunction.Variables);
ObjectDump("array", process.SelectedFunction.Variables["array"].GetArrayElements());
ObjectDump("array2", process.SelectedFunction.Variables["array2"].GetArrayElements());
ObjectDump("this", process.SelectedFunction.ThisValue.GetMembers());
process.Continue();
process.WaitForExit();
CheckXmlOutput();
}
} }
} }

50
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.cs

@ -0,0 +1,50 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision: 2279 $</version>
// </file>
using System;
namespace Debugger.Tests.TestPrograms
{
public class BaseClass
{
string name = "base name";
public string Name {
get { return name; }
}
public string Value = "base value";
}
public class TestClass: BaseClass
{
string name = "derived name";
new public string Name {
get { return name; }
}
new public string Value = "derived value";
string field = "field value";
string[] array = {"one", "two", "three"};
public static void Main()
{
new TestClass().Test("argValue");
}
public void Test(string arg)
{
int i = 0;
string[] array = {"one", "two", "three"};
string[,] array2 = {{"A","B"},{"C","D"}};
System.Diagnostics.Debugger.Break();
}
}
}

490
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Expressions.xml

@ -0,0 +1,490 @@
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="Expressions">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">Expressions.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<ObjectDump name="Variables">
<ValueCollection>
<Count>13</Count>
<Items>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>True</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<Name>this</Name>
<IsNull>False</IsNull>
<AsString>{Debugger.Tests.TestPrograms.TestClass}</AsString>
<Expression>this</Expression>
<HasExpired>False</HasExpired>
<Type>Debugger.Tests.TestPrograms.TestClass</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>argValue</PrimitiveValue>
<Name>arg</Name>
<IsNull>False</IsNull>
<AsString>argValue</AsString>
<Expression>arg</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>True</IsInteger>
<PrimitiveValue>0</PrimitiveValue>
<Name>i</Name>
<IsNull>False</IsNull>
<AsString>0</AsString>
<Expression>i</Expression>
<HasExpired>False</HasExpired>
<Type>System.Int32</Type>
</Value>
<Value>
<IsArray>True</IsArray>
<ArrayLenght>3</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<Name>array</Name>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<Expression>array</Expression>
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</Value>
<Value>
<IsArray>True</IsArray>
<ArrayLenght>4</ArrayLenght>
<ArrayRank>2</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<Name>array2</Name>
<IsNull>False</IsNull>
<AsString>{System.String[,]}</AsString>
<Expression>array2</Expression>
<HasExpired>False</HasExpired>
<Type>System.String[,]</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived name</PrimitiveValue>
<Name>name</Name>
<IsNull>False</IsNull>
<AsString>derived name</AsString>
<Expression>this.name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived value</PrimitiveValue>
<Name>Value</Name>
<IsNull>False</IsNull>
<AsString>derived value</AsString>
<Expression>this.Value</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>field value</PrimitiveValue>
<Name>field</Name>
<IsNull>False</IsNull>
<AsString>field value</AsString>
<Expression>this.field</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>True</IsArray>
<ArrayLenght>3</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<Name>array</Name>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<Expression>this.array</Expression>
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived name</PrimitiveValue>
<Name>Name</Name>
<IsNull>False</IsNull>
<AsString>derived name</AsString>
<Expression>this.Name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base name</PrimitiveValue>
<Name>name</Name>
<IsNull>False</IsNull>
<AsString>base name</AsString>
<Expression>this.name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base value</PrimitiveValue>
<Name>Value</Name>
<IsNull>False</IsNull>
<AsString>base value</AsString>
<Expression>this.Value</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base name</PrimitiveValue>
<Name>Name</Name>
<IsNull>False</IsNull>
<AsString>base name</AsString>
<Expression>this.Name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
</Items>
</ValueCollection>
</ObjectDump>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<ObjectDump name="array">
<ValueCollection>
<Count>3</Count>
<Items>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>one</PrimitiveValue>
<Name>[0]</Name>
<IsNull>False</IsNull>
<AsString>one</AsString>
<Expression>array[0]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>two</PrimitiveValue>
<Name>[1]</Name>
<IsNull>False</IsNull>
<AsString>two</AsString>
<Expression>array[1]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>three</PrimitiveValue>
<Name>[2]</Name>
<IsNull>False</IsNull>
<AsString>three</AsString>
<Expression>array[2]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
</Items>
</ValueCollection>
</ObjectDump>
<ObjectDump name="array2">
<ValueCollection>
<Count>4</Count>
<Items>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>A</PrimitiveValue>
<Name>[0,0]</Name>
<IsNull>False</IsNull>
<AsString>A</AsString>
<Expression>array2[0, 0]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>B</PrimitiveValue>
<Name>[0,1]</Name>
<IsNull>False</IsNull>
<AsString>B</AsString>
<Expression>array2[0, 1]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>C</PrimitiveValue>
<Name>[1,0]</Name>
<IsNull>False</IsNull>
<AsString>C</AsString>
<Expression>array2[1, 0]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>D</PrimitiveValue>
<Name>[1,1]</Name>
<IsNull>False</IsNull>
<AsString>D</AsString>
<Expression>array2[1, 1]</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
</Items>
</ValueCollection>
</ObjectDump>
<ObjectDump name="this">
<ValueCollection>
<Count>8</Count>
<Items>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived name</PrimitiveValue>
<Name>name</Name>
<IsNull>False</IsNull>
<AsString>derived name</AsString>
<Expression>this.name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived value</PrimitiveValue>
<Name>Value</Name>
<IsNull>False</IsNull>
<AsString>derived value</AsString>
<Expression>this.Value</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>field value</PrimitiveValue>
<Name>field</Name>
<IsNull>False</IsNull>
<AsString>field value</AsString>
<Expression>this.field</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>True</IsArray>
<ArrayLenght>3</ArrayLenght>
<ArrayRank>1</ArrayRank>
<ArrayDimensions>System.UInt32[]</ArrayDimensions>
<IsObject>False</IsObject>
<IsPrimitive>False</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue exception="Value is not a primitive type" />
<Name>array</Name>
<IsNull>False</IsNull>
<AsString>{System.String[]}</AsString>
<Expression>this.array</Expression>
<HasExpired>False</HasExpired>
<Type>System.String[]</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>derived name</PrimitiveValue>
<Name>Name</Name>
<IsNull>False</IsNull>
<AsString>derived name</AsString>
<Expression>this.Name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base name</PrimitiveValue>
<Name>name</Name>
<IsNull>False</IsNull>
<AsString>base name</AsString>
<Expression>this.name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base value</PrimitiveValue>
<Name>Value</Name>
<IsNull>False</IsNull>
<AsString>base value</AsString>
<Expression>this.Value</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
<Value>
<IsArray>False</IsArray>
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<ArrayDimensions exception="Value is not an array" />
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<IsInteger>False</IsInteger>
<PrimitiveValue>base name</PrimitiveValue>
<Name>Name</Name>
<IsNull>False</IsNull>
<AsString>base name</AsString>
<Expression>this.Name</Expression>
<HasExpired>False</HasExpired>
<Type>System.String</Type>
</Value>
</Items>
</ValueCollection>
</ObjectDump>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<DebuggingPaused>EvalComplete</DebuggingPaused>
<ProcessExited />
</Test>
</DebuggerTests>
Loading…
Cancel
Save