Browse Source
Simplified DebugType test git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5112 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 204 additions and 917 deletions
@ -1,138 +0,0 @@
@@ -1,138 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace Debugger.Tests.TestPrograms |
||||
{ |
||||
public class Value_Array |
||||
{ |
||||
public static void Main() |
||||
{ |
||||
int[] array = new int[5]; |
||||
for(int i = 0; i < 5; i++) { |
||||
array[i] = i; |
||||
} |
||||
System.Diagnostics.Debugger.Break(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#if TEST_CODE
|
||||
namespace Debugger.Tests { |
||||
public partial class DebuggerTests |
||||
{ |
||||
[NUnit.Framework.Test] |
||||
public void Value_Array() |
||||
{ |
||||
ExpandProperties( |
||||
"DebugType.BaseType" |
||||
); |
||||
StartTest("Value_Array.cs"); |
||||
|
||||
Value array = process.SelectedStackFrame.GetLocalVariableValue("array"); |
||||
ObjectDump("array", array); |
||||
ObjectDump("array elements", array.GetArrayElements()); |
||||
ObjectDump("type", array.Type); |
||||
ObjectDump("array.Length", array.GetMemberValue("Length")); |
||||
|
||||
EndTest(); |
||||
} |
||||
} |
||||
} |
||||
#endif
|
||||
|
||||
#if EXPECTED_OUTPUT
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<DebuggerTests> |
||||
<Test |
||||
name="Value_Array.cs"> |
||||
<ProcessStarted /> |
||||
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded> |
||||
<ModuleLoaded>Value_Array.exe (Has symbols)</ModuleLoaded> |
||||
<DebuggingPaused>Break Value_Array.cs:20,4-20,40</DebuggingPaused> |
||||
<array> |
||||
<Value |
||||
ArrayDimensions="{5}" |
||||
ArrayLength="5" |
||||
ArrayRank="1" |
||||
AsString="{System.Int32[]}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Int32[]" /> |
||||
</array> |
||||
<array_elements> |
||||
<Item> |
||||
<Value |
||||
AsString="0" |
||||
PrimitiveValue="0" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="1" |
||||
PrimitiveValue="1" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="2" |
||||
PrimitiveValue="2" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="3" |
||||
PrimitiveValue="3" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="4" |
||||
PrimitiveValue="4" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
</array_elements> |
||||
<type> |
||||
<DebugType |
||||
BaseType="System.Array" |
||||
ElementType="System.Int32" |
||||
FullName="System.Int32[]" |
||||
Kind="Array" |
||||
Module="{Exception: The type is not a class or value type.}" |
||||
Name="Int32[]"> |
||||
<BaseType> |
||||
<DebugType |
||||
BaseType="System.Object" |
||||
FullName="System.Array" |
||||
Interfaces="{System.ICloneable, System.Collections.IList, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable}" |
||||
Kind="Class" |
||||
Module="mscorlib.dll" |
||||
Name="Array"> |
||||
<BaseType> |
||||
<DebugType |
||||
FullName="System.Object" |
||||
Kind="Class" |
||||
Module="mscorlib.dll" |
||||
Name="Object"> |
||||
<BaseType>null</BaseType> |
||||
</DebugType> |
||||
</BaseType> |
||||
</DebugType> |
||||
</BaseType> |
||||
</DebugType> |
||||
</type> |
||||
<array.Length> |
||||
<Value |
||||
AsString="5" |
||||
PrimitiveValue="5" |
||||
Type="System.Int32" /> |
||||
</array.Length> |
||||
<ProcessExited /> |
||||
</Test> |
||||
</DebuggerTests> |
||||
#endif // EXPECTED_OUTPUT
|
||||
@ -1,177 +0,0 @@
@@ -1,177 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Debugger.Tests.TestPrograms |
||||
{ |
||||
public class Value_GenericDictionary |
||||
{ |
||||
public static void Main() |
||||
{ |
||||
Dictionary<string, int> dict = new Dictionary<string, int>(); |
||||
dict.Add("one",1); |
||||
dict.Add("two",2); |
||||
dict.Add("three",3); |
||||
System.Diagnostics.Debugger.Break(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#if TEST_CODE
|
||||
namespace Debugger.Tests { |
||||
using Debugger.MetaData; |
||||
|
||||
public partial class DebuggerTests |
||||
{ |
||||
[NUnit.Framework.Test] |
||||
public void Value_GenericDictionary() |
||||
{ |
||||
StartTest("Value_GenericDictionary.cs"); |
||||
|
||||
ObjectDump("dict", process.SelectedStackFrame.GetLocalVariableValue("dict")); |
||||
ObjectDump("dict members", process.SelectedStackFrame.GetLocalVariableValue("dict").GetMemberValues()); |
||||
|
||||
EndTest(); |
||||
} |
||||
} |
||||
} |
||||
#endif
|
||||
|
||||
#if EXPECTED_OUTPUT
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<DebuggerTests> |
||||
<Test |
||||
name="Value_GenericDictionary.cs"> |
||||
<ProcessStarted /> |
||||
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded> |
||||
<ModuleLoaded>Value_GenericDictionary.exe (Has symbols)</ModuleLoaded> |
||||
<DebuggingPaused>Break Value_GenericDictionary.cs:21,4-21,40</DebuggingPaused> |
||||
<dict> |
||||
<Value |
||||
AsString="{System.Collections.Generic.Dictionary<System.String,System.Int32>}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Collections.Generic.Dictionary<System.String,System.Int32>" /> |
||||
</dict> |
||||
<dict_members> |
||||
<Item> |
||||
<Value |
||||
ArrayDimensions="{3}" |
||||
ArrayLength="3" |
||||
ArrayRank="1" |
||||
AsString="{System.Int32[]}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Int32[]" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
ArrayDimensions="{3}" |
||||
ArrayLength="3" |
||||
ArrayRank="1" |
||||
AsString="{Entry<System.String,System.Int32>[]}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="Entry<System.String,System.Int32>[]" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="3" |
||||
PrimitiveValue="3" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="3" |
||||
PrimitiveValue="3" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="-1" |
||||
PrimitiveValue="-1" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="0" |
||||
PrimitiveValue="0" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="{System.Collections.Generic.GenericEqualityComparer<System.String>}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Collections.Generic.GenericEqualityComparer<System.String>" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="null" |
||||
IsNull="True" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="KeyCollection<System.String,System.Int32>" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="null" |
||||
IsNull="True" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="ValueCollection<System.String,System.Int32>" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="null" |
||||
IsNull="True" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Object" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="null" |
||||
IsNull="True" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Runtime.Serialization.SerializationInfo" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="{System.Collections.Generic.GenericEqualityComparer<System.String>}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="System.Collections.Generic.GenericEqualityComparer<System.String>" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="3" |
||||
PrimitiveValue="3" |
||||
Type="System.Int32" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="{KeyCollection<System.String,System.Int32>}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="KeyCollection<System.String,System.Int32>" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="{ValueCollection<System.String,System.Int32>}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="ValueCollection<System.String,System.Int32>" /> |
||||
</Item> |
||||
</dict_members> |
||||
<ProcessExited /> |
||||
</Test> |
||||
</DebuggerTests> |
||||
#endif // EXPECTED_OUTPUT
|
||||
@ -1,168 +0,0 @@
@@ -1,168 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace Debugger.Tests.TestPrograms |
||||
{ |
||||
public class BaseClass2 |
||||
{ |
||||
public string basePublic = "a"; |
||||
string basePrivate = "b"; |
||||
} |
||||
|
||||
public class Value_Object: BaseClass2 |
||||
{ |
||||
string privateField = "c"; |
||||
public string publicFiled = "d"; |
||||
|
||||
public string PublicProperty { |
||||
get { |
||||
return privateField; |
||||
} |
||||
} |
||||
|
||||
public static void Main() |
||||
{ |
||||
Value_Object val = new Value_Object(); |
||||
System.Diagnostics.Debugger.Break(); |
||||
val.privateField = "new private"; |
||||
System.Diagnostics.Debugger.Break(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#if TEST_CODE
|
||||
namespace Debugger.Tests { |
||||
using Debugger.MetaData; |
||||
|
||||
public partial class DebuggerTests |
||||
{ |
||||
[NUnit.Framework.Test] |
||||
public void Value_Object() |
||||
{ |
||||
Value val = null; |
||||
|
||||
StartTest("Value_Object.cs"); |
||||
|
||||
val = process.SelectedStackFrame.GetLocalVariableValue("val"); |
||||
ObjectDump("val", val); |
||||
ObjectDump("val members", val.GetMemberValues()); |
||||
|
||||
process.Continue(); |
||||
val = process.SelectedStackFrame.GetLocalVariableValue("val"); |
||||
ObjectDump("val", val); |
||||
ObjectDump("val members", val.GetMemberValues()); |
||||
|
||||
EndTest(); |
||||
} |
||||
} |
||||
} |
||||
#endif
|
||||
|
||||
#if EXPECTED_OUTPUT
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<DebuggerTests> |
||||
<Test |
||||
name="Value_Object.cs"> |
||||
<ProcessStarted /> |
||||
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded> |
||||
<ModuleLoaded>Value_Object.exe (Has symbols)</ModuleLoaded> |
||||
<DebuggingPaused>Break Value_Object.cs:32,4-32,40</DebuggingPaused> |
||||
<val> |
||||
<Value |
||||
AsString="{Debugger.Tests.TestPrograms.Value_Object}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="Debugger.Tests.TestPrograms.Value_Object" /> |
||||
</val> |
||||
<val_members> |
||||
<Item> |
||||
<Value |
||||
AsString="c" |
||||
IsReference="True" |
||||
PrimitiveValue="c" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="d" |
||||
IsReference="True" |
||||
PrimitiveValue="d" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="a" |
||||
IsReference="True" |
||||
PrimitiveValue="a" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="b" |
||||
IsReference="True" |
||||
PrimitiveValue="b" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="c" |
||||
IsReference="True" |
||||
PrimitiveValue="c" |
||||
Type="System.String" /> |
||||
</Item> |
||||
</val_members> |
||||
<DebuggingPaused>Break Value_Object.cs:34,4-34,40</DebuggingPaused> |
||||
<val> |
||||
<Value |
||||
AsString="{Debugger.Tests.TestPrograms.Value_Object}" |
||||
IsReference="True" |
||||
PrimitiveValue="{Exception: Value is not a primitive type}" |
||||
Type="Debugger.Tests.TestPrograms.Value_Object" /> |
||||
</val> |
||||
<val_members> |
||||
<Item> |
||||
<Value |
||||
AsString="new private" |
||||
IsReference="True" |
||||
PrimitiveValue="new private" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="d" |
||||
IsReference="True" |
||||
PrimitiveValue="d" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="a" |
||||
IsReference="True" |
||||
PrimitiveValue="a" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="b" |
||||
IsReference="True" |
||||
PrimitiveValue="b" |
||||
Type="System.String" /> |
||||
</Item> |
||||
<Item> |
||||
<Value |
||||
AsString="new private" |
||||
IsReference="True" |
||||
PrimitiveValue="new private" |
||||
Type="System.String" /> |
||||
</Item> |
||||
</val_members> |
||||
<ProcessExited /> |
||||
</Test> |
||||
</DebuggerTests> |
||||
#endif // EXPECTED_OUTPUT
|
||||
@ -1,92 +0,0 @@
@@ -1,92 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace Debugger.Tests.TestPrograms |
||||
{ |
||||
public class Value_Property |
||||
{ |
||||
string PrivateProperty { |
||||
get { |
||||
return "private"; |
||||
} |
||||
} |
||||
|
||||
public string PublicProperty { |
||||
get { |
||||
return "public"; |
||||
} |
||||
} |
||||
|
||||
public string ExceptionProperty { |
||||
get { |
||||
throw new NotSupportedException(); |
||||
} |
||||
} |
||||
|
||||
public static string StaticProperty { |
||||
get { |
||||
return "static"; |
||||
} |
||||
} |
||||
|
||||
public static void Main() |
||||
{ |
||||
Value_Property var = new Value_Property(); |
||||
System.Diagnostics.Debugger.Break(); |
||||
System.Diagnostics.Debugger.Break(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#if TEST_CODE
|
||||
namespace Debugger.Tests { |
||||
public partial class DebuggerTests |
||||
{ |
||||
/* |
||||
[NUnit.Framework.Test] |
||||
public void PropertyVariable() |
||||
{ |
||||
StartProgram("PropertyVariable.cs"); |
||||
WaitForPause(); |
||||
NamedValueCollection props = process.SelectedFunction.LocalVariables["var"].GetMembers(null, Debugger.BindingFlags.All); |
||||
|
||||
Assert.AreEqual(typeof(UnavailableValue), props["PrivateProperty"].Value.GetType()); |
||||
process.StartEvaluation(); |
||||
WaitForPause(); |
||||
Assert.AreEqual("private", props["PrivateProperty"].AsString); |
||||
|
||||
Assert.AreEqual(typeof(UnavailableValue), props["PublicProperty"].Value.GetType()); |
||||
process.StartEvaluation(); |
||||
WaitForPause(); |
||||
Assert.AreEqual("public", props["PublicProperty"].AsString); |
||||
|
||||
Assert.AreEqual(typeof(UnavailableValue), props["ExceptionProperty"].Value.GetType()); |
||||
process.StartEvaluation(); |
||||
WaitForPause(); |
||||
Assert.AreEqual(typeof(UnavailableValue), props["ExceptionProperty"].Value.GetType()); |
||||
|
||||
Assert.AreEqual(typeof(UnavailableValue), props["StaticProperty"].Value.GetType()); |
||||
process.StartEvaluation(); |
||||
WaitForPause(); |
||||
Assert.AreEqual("static", props["StaticProperty"].AsString); |
||||
|
||||
process.Continue(); |
||||
WaitForPause(PausedReason.Break, null); |
||||
|
||||
process.Continue(); |
||||
process.WaitForPrecessExit(); |
||||
CheckXmlOutput(); |
||||
} |
||||
*/ |
||||
} |
||||
} |
||||
#endif
|
||||
|
||||
#if EXPECTED_OUTPUT
|
||||
#endif // EXPECTED_OUTPUT
|
||||
Loading…
Reference in new issue