Browse Source

Merged and simplified Value tests;

Simplified DebugType test

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5112 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
c168ea3b63
  1. 12
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj
  2. 216
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugType.cs
  3. 20
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ExpressionEvaluator.cs
  4. 128
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ValueTest.cs
  5. 138
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Array.cs
  6. 177
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_GenericDictionary.cs
  7. 168
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Object.cs
  8. 170
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Primitive.cs
  9. 92
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Property.cs

12
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj

@ -46,7 +46,6 @@
<Compile Include="Src\DebuggerTests.cs" /> <Compile Include="Src\DebuggerTests.cs" />
<Compile Include="Src\DebuggerTestsBase.cs" /> <Compile Include="Src\DebuggerTestsBase.cs" />
<Compile Include="Src\TestPrograms\AppDomain.cs" /> <Compile Include="Src\TestPrograms\AppDomain.cs" />
<Compile Include="Src\TestPrograms\Value_Array.cs" />
<Compile Include="Src\TestPrograms\ExpressionEvaluator.cs" /> <Compile Include="Src\TestPrograms\ExpressionEvaluator.cs" />
<Compile Include="Src\TestPrograms\Breakpoint.cs" /> <Compile Include="Src\TestPrograms\Breakpoint.cs" />
<Compile Include="Src\TestPrograms\StackFrame_Callstack.cs" /> <Compile Include="Src\TestPrograms\StackFrame_Callstack.cs" />
@ -56,13 +55,10 @@
<Compile Include="Src\TestPrograms\Exception_Custom.cs" /> <Compile Include="Src\TestPrograms\Exception_Custom.cs" />
<Compile Include="Src\TestPrograms\StackFrame_Lifetime.cs" /> <Compile Include="Src\TestPrograms\StackFrame_Lifetime.cs" />
<Compile Include="Src\TestPrograms\StackFrame_VariablesLifetime.cs" /> <Compile Include="Src\TestPrograms\StackFrame_VariablesLifetime.cs" />
<Compile Include="Src\TestPrograms\Value_GenericDictionary.cs" />
<Compile Include="Src\TestPrograms\_HelloWorld.cs" /> <Compile Include="Src\TestPrograms\_HelloWorld.cs" />
<Compile Include="Src\TestPrograms\ControlFlow_MainThreadExit.cs" /> <Compile Include="Src\TestPrograms\ControlFlow_MainThreadExit.cs" />
<Compile Include="Src\TestPrograms\Process_MemoryReadWrite.cs" /> <Compile Include="Src\TestPrograms\Process_MemoryReadWrite.cs" />
<Compile Include="Src\TestPrograms\Value_Object.cs" /> <Compile Include="Src\TestPrograms\ValueTest.cs" />
<Compile Include="Src\TestPrograms\Value_Primitive.cs" />
<Compile Include="Src\TestPrograms\Value_Property.cs" />
<Compile Include="Src\TestPrograms\StackFrame_SetIP.cs" /> <Compile Include="Src\TestPrograms\StackFrame_SetIP.cs" />
<Compile Include="Src\TestPrograms\Exception_StackOverflow.cs" /> <Compile Include="Src\TestPrograms\Exception_StackOverflow.cs" />
<Compile Include="Src\TestPrograms\ControlFlow_Stepping.cs" /> <Compile Include="Src\TestPrograms\ControlFlow_Stepping.cs" />
@ -89,11 +85,7 @@
<EmbeddedResource Include="Src\TestPrograms\StackFrame_SetIP.cs" /> <EmbeddedResource Include="Src\TestPrograms\StackFrame_SetIP.cs" />
<EmbeddedResource Include="Src\TestPrograms\StackFrame_VariablesLifetime.cs" /> <EmbeddedResource Include="Src\TestPrograms\StackFrame_VariablesLifetime.cs" />
<EmbeddedResource Include="Src\TestPrograms\Thread_Name.cs" /> <EmbeddedResource Include="Src\TestPrograms\Thread_Name.cs" />
<EmbeddedResource Include="Src\TestPrograms\Value_Array.cs" /> <EmbeddedResource Include="Src\TestPrograms\ValueTest.cs" />
<EmbeddedResource Include="Src\TestPrograms\Value_GenericDictionary.cs" />
<EmbeddedResource Include="Src\TestPrograms\Value_Object.cs" />
<EmbeddedResource Include="Src\TestPrograms\Value_Primitive.cs" />
<EmbeddedResource Include="Src\TestPrograms\Value_Property.cs" />
<EmbeddedResource Include="Src\TestPrograms\_HelloWorld.cs" /> <EmbeddedResource Include="Src\TestPrograms\_HelloWorld.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

216
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugType.cs

@ -21,34 +21,24 @@ namespace Debugger.Tests.TestPrograms
// The classes are intentionally nested for testing // The classes are intentionally nested for testing
public class MyClass public enum MyEnum: byte { A, B }
{
}
public class MyGenClass<T> public class MyClass
{
public class MyNestedClass
{
}
public class MyGenNestedClass<U>
{ {
} }
}
public struct MyStruct public struct MyStruct
{ {
} }
public struct MyGenStruct<T> public class MyGenClass<T>
{ {
public struct MyGenNestedStruct<U> public struct MyNestedStruct
{ {
} }
} public struct MyGenNestedStruct<U>
public enum MyEnum: byte
{ {
A, B }
} }
public interface MyInterface<R, A, B> public interface MyInterface<R, A, B>
@ -62,6 +52,8 @@ namespace Debugger.Tests.TestPrograms
public List<R> Prop { get { return new List<R>(); } } public List<R> Prop { get { return new List<R>(); } }
public char SetterOnlyProp { set { ; } }
public R Fun<M>(MyClass a, MyStruct b, M m) public R Fun<M>(MyClass a, MyStruct b, M m)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
@ -109,15 +101,9 @@ namespace Debugger.Tests.TestPrograms
// Generic class // Generic class
MyGenClass<int> myGenClass_int = new MyGenClass<int>(); MyGenClass<int> myGenClass_int = new MyGenClass<int>();
MyGenClass<int>[] array_MyGenClass_int = new MyGenClass<int>[] {}; MyGenClass<int>[] array_MyGenClass_int = new MyGenClass<int>[] {};
MyGenClass<MyGenStruct<int>> myGenClass_MyGenStruct_int = new MyGenClass<MyGenStruct<int>>(); MyGenClass<int?> myGenClass_Nullable_int = new MyGenClass<int?>();
MyGenClass<int>.MyNestedClass myNestedClass = new MyGenClass<int>.MyNestedClass(); MyGenClass<int>.MyNestedStruct myNestedStruct = new MyGenClass<int>.MyNestedStruct();
MyGenClass<int>.MyGenNestedClass<char> myGenNestedClass = new MyGenClass<int>.MyGenNestedClass<char>(); MyGenClass<int>.MyGenNestedStruct<char> myGenNestedStruct = new MyGenClass<int>.MyGenNestedStruct<char>();
// Generic struct
MyGenStruct<int> myGenStruct_int = new MyGenStruct<int>();
MyGenStruct<int>[] array_MyGenStruct_int = new MyGenStruct<int>[] {};
MyGenStruct<MyGenClass<int>> myGenStruct_MyGenClass_int = new MyGenStruct<MyGenClass<int>>();
MyGenStruct<int>.MyGenNestedStruct<char> myGenNestedStruct = new MyGenStruct<int>.MyGenNestedStruct<char>();
// Generic interface // Generic interface
MyInterfaceImpl<int> myInterfaceImpl = new MyInterfaceImpl<int>(); MyInterfaceImpl<int> myInterfaceImpl = new MyInterfaceImpl<int>();
@ -223,20 +209,18 @@ namespace Debugger.Tests {
<ProcessStarted /> <ProcessStarted />
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded> <ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>DebugType.exe (Has symbols)</ModuleLoaded> <ModuleLoaded>DebugType.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break DebugType.cs:138,4-138,40</DebuggingPaused> <DebuggingPaused>Break DebugType.cs:124,4-124,40</DebuggingPaused>
<DefinedTypes <DefinedTypes
Capacity="16" Capacity="16"
Count="13"> Count="11">
<Item>Debugger.Tests.TestPrograms.DebugType</Item> <Item>Debugger.Tests.TestPrograms.DebugType</Item>
<Item>AddDelegate</Item> <Item>AddDelegate</Item>
<Item>MyEnum</Item>
<Item>MyClass</Item> <Item>MyClass</Item>
<Item>MyGenClass`1</Item>
<Item>MyNestedClass</Item>
<Item>MyGenNestedClass`1</Item>
<Item>MyStruct</Item> <Item>MyStruct</Item>
<Item>MyGenStruct`1</Item> <Item>MyGenClass`1</Item>
<Item>MyNestedStruct</Item>
<Item>MyGenNestedStruct`1</Item> <Item>MyGenNestedStruct`1</Item>
<Item>MyEnum</Item>
<Item>MyInterface`3</Item> <Item>MyInterface`3</Item>
<Item>MyInterfaceImpl`1</Item> <Item>MyInterfaceImpl`1</Item>
<Item>Access</Item> <Item>Access</Item>
@ -267,6 +251,20 @@ namespace Debugger.Tests {
<GetElementType>null</GetElementType> <GetElementType>null</GetElementType>
</DebugType> </DebugType>
</Item> </Item>
<Item>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, Sealed"
BaseType="System.Enum"
FullName="Debugger.Tests.TestPrograms.DebugType.MyEnum"
GetEnumUnderlyingType="System.Byte"
GetFields="{System.Byte value__}"
GetMembers="{System.Byte value__, Equals, GetHashCode, ToString, ToString, ToString, ToString, CompareTo, GetTypeCode, Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, ToString, ToString, ToString, CompareTo, GetTypeCode, Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
IsEnum="True"
IsValueType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Item>
<Item> <Item>
<DebugType <DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit" Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit"
@ -289,20 +287,6 @@ namespace Debugger.Tests {
<GetElementType>null</GetElementType> <GetElementType>null</GetElementType>
</DebugType> </DebugType>
</Item> </Item>
<Item>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, Sealed"
BaseType="System.Enum"
FullName="Debugger.Tests.TestPrograms.DebugType.MyEnum"
GetEnumUnderlyingType="System.Byte"
GetFields="{System.Byte value__}"
GetMembers="{System.Byte value__, Equals, GetHashCode, ToString, ToString, ToString, ToString, CompareTo, GetTypeCode, Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, ToString, ToString, ToString, CompareTo, GetTypeCode, Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
IsEnum="True"
IsValueType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Item>
<Item> <Item>
<DebugType <DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit" Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit"
@ -418,6 +402,14 @@ namespace Debugger.Tests {
Name="get_Prop" Name="get_Prop"
ReturnType="System.Collections.Generic.List`1[[System.Int32]]" /> ReturnType="System.Collections.Generic.List`1[[System.Int32]]" />
</Item> </Item>
<Item>
<DebugMethodInfo
Attributes="PrivateScope, Public, HideBySig, SpecialName"
DeclaringType="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyInterfaceImpl`1[[System.Int32]]"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyInterfaceImpl`1[[System.Int32]].set_SetterOnlyProp(Char value)"
GetLocalVariables="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyInterfaceImpl`1[[System.Int32]] this}"
Name="set_SetterOnlyProp" />
</Item>
<Item> <Item>
<DebugMethodInfo <DebugMethodInfo
Attributes="PrivateScope, Public, Final, Virtual, HideBySig, VtableLayoutMask" Attributes="PrivateScope, Public, Final, Virtual, HideBySig, VtableLayoutMask"
@ -450,6 +442,12 @@ namespace Debugger.Tests {
Name="Prop" Name="Prop"
PropertyType="System.Collections.Generic.List`1[[System.Int32]]" /> PropertyType="System.Collections.Generic.List`1[[System.Int32]]" />
</Item> </Item>
<Item>
<DebugPropertyInfo
DeclaringType="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyInterfaceImpl`1[[System.Int32]]"
Name="SetterOnlyProp"
PropertyType="System.Char" />
</Item>
<Item> <Item>
<DebugMethodInfo <DebugMethodInfo
Attributes="PrivateScope, Public, HideBySig, SpecialName, RTSpecialName" Attributes="PrivateScope, Public, HideBySig, SpecialName, RTSpecialName"
@ -1065,55 +1063,15 @@ namespace Debugger.Tests {
</Item> </Item>
<Item> <Item>
<LocalVariable <LocalVariable
Name="myGenClass_MyGenStruct_int" Name="myGenClass_Nullable_int"
Type="Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]].MyGenClass`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]]" Type="Debugger.Tests.TestPrograms.DebugType[[System.Nullable`1[[System.Int32]]]].MyGenClass`1[[System.Nullable`1[[System.Int32]]]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]].MyGenClass`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]]}"> Value="{Debugger.Tests.TestPrograms.DebugType[[System.Nullable`1[[System.Int32]]]].MyGenClass`1[[System.Nullable`1[[System.Int32]]]]}">
<Type>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit"
BaseType="System.Object"
FullName="Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]].MyGenClass`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]]]"
GetGenericArguments="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]}"
GetMembers="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
IsClass="True"
IsGenericType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Type>
</LocalVariable>
</Item>
<Item>
<LocalVariable
Name="myNestedClass"
Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedClass[[System.Int32]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedClass[[System.Int32]]}">
<Type>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit"
BaseType="System.Object"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedClass[[System.Int32]]"
GetGenericArguments="{System.Int32}"
GetMembers="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
IsClass="True"
IsGenericType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Type>
</LocalVariable>
</Item>
<Item>
<LocalVariable
Name="myGenNestedClass"
Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedClass`1[[System.Int32, System.Char]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedClass`1[[System.Int32, System.Char]]}">
<Type> <Type>
<DebugType <DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit" Attributes="AutoLayout, AnsiClass, Class, NestedPublic, BeforeFieldInit"
BaseType="System.Object" BaseType="System.Object"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedClass`1[[System.Int32, System.Char]]" FullName="Debugger.Tests.TestPrograms.DebugType[[System.Nullable`1[[System.Int32]]]].MyGenClass`1[[System.Nullable`1[[System.Int32]]]]"
GetGenericArguments="{System.Int32, System.Char}" GetGenericArguments="{System.Nullable`1[[System.Int32]]}"
GetMembers="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}" GetMembers="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}" GetMethods="{.ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
IsClass="True" IsClass="True"
@ -1125,48 +1083,14 @@ namespace Debugger.Tests {
</Item> </Item>
<Item> <Item>
<LocalVariable <LocalVariable
Name="myGenStruct_int" Name="myNestedStruct"
Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]" Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedStruct[[System.Int32]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]}"> Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedStruct[[System.Int32]]}">
<Type>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit"
BaseType="System.ValueType"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]"
GetGenericArguments="{System.Int32}"
GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
IsGenericType="True"
IsValueType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Type>
</LocalVariable>
</Item>
<Item>
<LocalVariable
Name="array_MyGenStruct_int"
Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]][]"
Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]][]}">
<Type> <Type>
<DebugType
Attributes="NotPublic"
BaseType="System.Array"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]][]"
GetArrayRank="1"
GetElementType="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]"
GetMembers="{GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, get_Length, get_LongLength, GetLength, GetLongLength, get_Rank, GetUpperBound, GetLowerBound, get_SyncRoot, get_IsReadOnly, get_IsFixedSize, get_IsSynchronized, Clone, CompareTo, Equals, GetHashCode, CopyTo, CopyTo, GetEnumerator, Initialize, System.Int32 Length, System.Int64 LongLength, System.Int32 Rank, System.Object SyncRoot, System.Boolean IsReadOnly, System.Boolean IsFixedSize, System.Boolean IsSynchronized, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, GetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, SetValue, get_Length, get_LongLength, GetLength, GetLongLength, get_Rank, GetUpperBound, GetLowerBound, get_SyncRoot, get_IsReadOnly, get_IsFixedSize, get_IsSynchronized, Clone, CompareTo, Equals, GetHashCode, CopyTo, CopyTo, GetEnumerator, Initialize, .ctor, ToString, Equals, GetHashCode, GetType}"
GetProperties="{System.Int32 Length, System.Int64 LongLength, System.Int32 Rank, System.Object SyncRoot, System.Boolean IsReadOnly, System.Boolean IsFixedSize, System.Boolean IsSynchronized}"
HasElementType="True"
IsArray="True"
IsClass="True"
IsCompilerGenerated="True">
<GetElementType>
<DebugType <DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit" Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit"
BaseType="System.ValueType" BaseType="System.ValueType"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenStruct`1[[System.Int32]]" FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]].MyNestedStruct[[System.Int32]]"
GetGenericArguments="{System.Int32}" GetGenericArguments="{System.Int32}"
GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}" GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}" GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
@ -1174,41 +1098,19 @@ namespace Debugger.Tests {
IsValueType="True"> IsValueType="True">
<GetElementType>null</GetElementType> <GetElementType>null</GetElementType>
</DebugType> </DebugType>
</GetElementType>
</DebugType>
</Type>
</LocalVariable>
</Item>
<Item>
<LocalVariable
Name="myGenStruct_MyGenClass_int"
Type="Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]].MyGenStruct`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]].MyGenStruct`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]]}">
<Type>
<DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit"
BaseType="System.ValueType"
FullName="Debugger.Tests.TestPrograms.DebugType[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]].MyGenStruct`1[[Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]]]"
GetGenericArguments="{Debugger.Tests.TestPrograms.DebugType[[System.Int32]].MyGenClass`1[[System.Int32]]}"
GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
IsGenericType="True"
IsValueType="True">
<GetElementType>null</GetElementType>
</DebugType>
</Type> </Type>
</LocalVariable> </LocalVariable>
</Item> </Item>
<Item> <Item>
<LocalVariable <LocalVariable
Name="myGenNestedStruct" Name="myGenNestedStruct"
Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenStruct`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]" Type="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]"
Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenStruct`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]}"> Value="{Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]}">
<Type> <Type>
<DebugType <DebugType
Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit" Attributes="AutoLayout, AnsiClass, Class, NestedPublic, SequentialLayout, Sealed, BeforeFieldInit"
BaseType="System.ValueType" BaseType="System.ValueType"
FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenStruct`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]" FullName="Debugger.Tests.TestPrograms.DebugType[[System.Int32, System.Char]].MyGenClass`1[[System.Int32, System.Char]].MyGenNestedStruct`1[[System.Int32, System.Char]]"
GetGenericArguments="{System.Int32, System.Char}" GetGenericArguments="{System.Int32, System.Char}"
GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}" GetMembers="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}" GetMethods="{Equals, GetHashCode, ToString, .ctor, ToString, Equals, GetHashCode, GetType}"
@ -1232,9 +1134,9 @@ namespace Debugger.Tests {
GetFields="{System.Void* voidPtr}" GetFields="{System.Void* voidPtr}"
GetGenericArguments="{System.Int32}" GetGenericArguments="{System.Int32}"
GetInterfaces="{Debugger.Tests.TestPrograms.DebugType[[System.Int32, Debugger.Tests.TestPrograms.DebugType.MyClass, Debugger.Tests.TestPrograms.DebugType.MyStruct]].MyInterface`3[[System.Int32, Debugger.Tests.TestPrograms.DebugType.MyClass, Debugger.Tests.TestPrograms.DebugType.MyStruct]]}" GetInterfaces="{Debugger.Tests.TestPrograms.DebugType[[System.Int32, Debugger.Tests.TestPrograms.DebugType.MyClass, Debugger.Tests.TestPrograms.DebugType.MyStruct]].MyInterface`3[[System.Int32, Debugger.Tests.TestPrograms.DebugType.MyClass, Debugger.Tests.TestPrograms.DebugType.MyStruct]]}"
GetMembers="{System.Void* voidPtr, get_Prop, Fun, Fun2, .ctor, System.Collections.Generic.List`1[[System.Int32]] Prop, .ctor, ToString, Equals, GetHashCode, GetType}" GetMembers="{System.Void* voidPtr, get_Prop, set_SetterOnlyProp, Fun, Fun2, .ctor, System.Collections.Generic.List`1[[System.Int32]] Prop, System.Char SetterOnlyProp, .ctor, ToString, Equals, GetHashCode, GetType}"
GetMethods="{get_Prop, Fun, Fun2, .ctor, .ctor, ToString, Equals, GetHashCode, GetType}" GetMethods="{get_Prop, set_SetterOnlyProp, Fun, Fun2, .ctor, .ctor, ToString, Equals, GetHashCode, GetType}"
GetProperties="{System.Collections.Generic.List`1[[System.Int32]] Prop}" GetProperties="{System.Collections.Generic.List`1[[System.Int32]] Prop, System.Char SetterOnlyProp}"
IsClass="True" IsClass="True"
IsGenericType="True"> IsGenericType="True">
<GetElementType>null</GetElementType> <GetElementType>null</GetElementType>

20
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ExpressionEvaluator.cs

@ -20,7 +20,7 @@ namespace Debugger.Tests.TestPrograms
get { return name; } get { return name; }
} }
public static string StaticValue = "base static value"; public static string StaticField = "base static field";
public string Foo(int i) public string Foo(int i)
{ {
@ -36,7 +36,15 @@ namespace Debugger.Tests.TestPrograms
get { return name; } get { return name; }
} }
new public static string StaticValue = "derived static value"; public char SetterOnlyProperty { set { ; } }
new public static string StaticField = "derived static field";
public static string StaticProperty {
get {
return "static";
}
}
new public string Foo(int i) new public string Foo(int i)
{ {
@ -191,7 +199,7 @@ namespace Debugger.Tests {
<ProcessStarted /> <ProcessStarted />
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded> <ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>ExpressionEvaluator.exe (Has symbols)</ModuleLoaded> <ModuleLoaded>ExpressionEvaluator.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break ExpressionEvaluator.cs:69,4-69,40</DebuggingPaused> <DebuggingPaused>Break ExpressionEvaluator.cs:77,4-77,40</DebuggingPaused>
<Eval> </Eval> <Eval> </Eval>
<Eval> b = 1 </Eval> <Eval> b = 1 </Eval>
<Eval> i = 4 </Eval> <Eval> i = 4 </Eval>
@ -240,10 +248,12 @@ namespace Debugger.Tests {
<Eval> !flag = False </Eval> <Eval> !flag = False </Eval>
<Eval> </Eval> <Eval> </Eval>
<Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).name = "derived name" </Eval> <Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).name = "derived name" </Eval>
<Eval> Debugger.Tests.TestPrograms.DerivedClass.StaticValue = Error evaluating "Debugger.Tests.TestPrograms.DerivedClass.StaticValue": Identifier "Debugger" not found in this context </Eval> <Eval> Debugger.Tests.TestPrograms.DerivedClass.StaticField = Error evaluating "Debugger.Tests.TestPrograms.DerivedClass.StaticField": Identifier "Debugger" not found in this context </Eval>
<Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).Name = "derived name" </Eval> <Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).Name = "derived name" </Eval>
<Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).SetterOnlyProperty = Error evaluating "((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).SetterOnlyProperty": Property does not have a get method </Eval>
<Eval> Debugger.Tests.TestPrograms.DerivedClass.StaticProperty = Error evaluating "Debugger.Tests.TestPrograms.DerivedClass.StaticProperty": Identifier "Debugger" not found in this context </Eval>
<Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).name = "base name" </Eval> <Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).name = "base name" </Eval>
<Eval> Debugger.Tests.TestPrograms.BaseClass.StaticValue = Error evaluating "Debugger.Tests.TestPrograms.BaseClass.StaticValue": Identifier "Debugger" not found in this context </Eval> <Eval> Debugger.Tests.TestPrograms.BaseClass.StaticField = Error evaluating "Debugger.Tests.TestPrograms.BaseClass.StaticField": Identifier "Debugger" not found in this context </Eval>
<Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).Name = "base name" </Eval> <Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).Name = "base name" </Eval>
<Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).Foo((System.Int32)(1)) = "base Foo - int" </Eval> <Eval> ((Debugger.Tests.TestPrograms.BaseClass)(myClass)).Foo((System.Int32)(1)) = "base Foo - int" </Eval>
<Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).Foo((System.Int32)(1)) = "derived Foo - int" </Eval> <Eval> ((Debugger.Tests.TestPrograms.DerivedClass)(myClass)).Foo((System.Int32)(1)) = "derived Foo - int" </Eval>

128
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ValueTest.cs

@ -0,0 +1,128 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbeck<EFBFBD>" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.Tests.TestPrograms
{
public class ValueTest
{
public static void Main()
{
bool b = true;
int i = 5;
string s = "five";
double d = 5.5;
int[,] array = new int[2,2];
array[0,0] = 0;
array[0,1] = 1;
array[1,0] = 2;
array[1,1] = 3;
System.Diagnostics.Debugger.Break();
}
}
}
#if TEST_CODE
namespace Debugger.Tests {
public partial class DebuggerTests
{
[NUnit.Framework.Test]
public void ValueTest()
{
StartTest("ValueTest.cs");
PrintLocalVariables();
Value array = process.SelectedStackFrame.GetLocalVariableValue("array").GetPermanentReference();
ObjectDump("array.Length", array.GetMemberValue("Length"));
ObjectDump("array elements", array.GetArrayElements());
EndTest();
}
}
}
#endif
#if EXPECTED_OUTPUT
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test
name="ValueTest.cs">
<ProcessStarted />
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>ValueTest.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break ValueTest.cs:26,4-26,40</DebuggingPaused>
<LocalVariables>
<Item>
<LocalVariable
Name="b"
Type="System.Boolean"
Value="True" />
</Item>
<Item>
<LocalVariable
Name="i"
Type="System.Int32"
Value="5" />
</Item>
<Item>
<LocalVariable
Name="s"
Type="System.String"
Value="five" />
</Item>
<Item>
<LocalVariable
Name="d"
Type="System.Double"
Value="5.5" />
</Item>
<Item>
<LocalVariable
Name="array"
Type="System.Int32[,]"
Value="{System.Int32[,]}" />
</Item>
</LocalVariables>
<array.Length>
<Value
AsString="4"
PrimitiveValue="4"
Type="System.Int32" />
</array.Length>
<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>
</array_elements>
<ProcessExited />
</Test>
</DebuggerTests>
#endif // EXPECTED_OUTPUT

138
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Array.cs

@ -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

177
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_GenericDictionary.cs

@ -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&lt;System.String,System.Int32&gt;}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="System.Collections.Generic.Dictionary&lt;System.String,System.Int32&gt;" />
</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&lt;System.String,System.Int32&gt;[]}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="Entry&lt;System.String,System.Int32&gt;[]" />
</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&lt;System.String&gt;}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="System.Collections.Generic.GenericEqualityComparer&lt;System.String&gt;" />
</Item>
<Item>
<Value
AsString="null"
IsNull="True"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="KeyCollection&lt;System.String,System.Int32&gt;" />
</Item>
<Item>
<Value
AsString="null"
IsNull="True"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="ValueCollection&lt;System.String,System.Int32&gt;" />
</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&lt;System.String&gt;}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="System.Collections.Generic.GenericEqualityComparer&lt;System.String&gt;" />
</Item>
<Item>
<Value
AsString="3"
PrimitiveValue="3"
Type="System.Int32" />
</Item>
<Item>
<Value
AsString="{KeyCollection&lt;System.String,System.Int32&gt;}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="KeyCollection&lt;System.String,System.Int32&gt;" />
</Item>
<Item>
<Value
AsString="{ValueCollection&lt;System.String,System.Int32&gt;}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
Type="ValueCollection&lt;System.String,System.Int32&gt;" />
</Item>
</dict_members>
<ProcessExited />
</Test>
</DebuggerTests>
#endif // EXPECTED_OUTPUT

168
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Object.cs

@ -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

170
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Primitive.cs

@ -1,170 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbeck<EFBFBD>" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.Tests.TestPrograms
{
public class Value_Primitive
{
public static void Main()
{
bool b = true;
int i = 5;
string s = "five";
double d = 5.5;
System.Diagnostics.Debugger.Break();
}
}
}
#if TEST_CODE
namespace Debugger.Tests {
public partial class DebuggerTests
{
[NUnit.Framework.Test]
public void Value_Primitive()
{
ExpandProperties(
"Value.Type",
"DebugType.BaseType"
);
StartTest("Value_Primitive.cs");
ObjectDump("locals", process.SelectedStackFrame.GetLocalVariableValues());
// Test System.Object access
ObjectDump("b as string", process.SelectedStackFrame.GetLocalVariableValue("b").InvokeToString());
ObjectDump("i as string", process.SelectedStackFrame.GetLocalVariableValue("i").InvokeToString());
ObjectDump("s as string", process.SelectedStackFrame.GetLocalVariableValue("s").InvokeToString());
EndTest();
}
}
}
#endif
#if EXPECTED_OUTPUT
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test
name="Value_Primitive.cs">
<ProcessStarted />
<ModuleLoaded>mscorlib.dll (No symbols)</ModuleLoaded>
<ModuleLoaded>Value_Primitive.exe (Has symbols)</ModuleLoaded>
<DebuggingPaused>Break Value_Primitive.cs:20,4-20,40</DebuggingPaused>
<locals
Capacity="4"
Count="4">
<Item>
<Value
AsString="True"
PrimitiveValue="True"
Type="System.Boolean">
<Type>
<DebugType
BaseType="System.Object"
FullName="System.Boolean"
Kind="Primitive"
Module="{Exception: The type is not a class or value type.}"
Name="Boolean">
<BaseType>
<DebugType
FullName="System.Object"
Kind="Class"
Module="mscorlib.dll"
Name="Object">
<BaseType>null</BaseType>
</DebugType>
</BaseType>
</DebugType>
</Type>
</Value>
</Item>
<Item>
<Value
AsString="5"
PrimitiveValue="5"
Type="System.Int32">
<Type>
<DebugType
BaseType="System.Object"
FullName="System.Int32"
Kind="Primitive"
Module="{Exception: The type is not a class or value type.}"
Name="Int32">
<BaseType>
<DebugType
FullName="System.Object"
Kind="Class"
Module="mscorlib.dll"
Name="Object">
<BaseType>null</BaseType>
</DebugType>
</BaseType>
</DebugType>
</Type>
</Value>
</Item>
<Item>
<Value
AsString="five"
IsReference="True"
PrimitiveValue="five"
Type="System.String">
<Type>
<DebugType
BaseType="System.Object"
FullName="System.String"
Kind="Primitive"
Module="{Exception: The type is not a class or value type.}"
Name="String">
<BaseType>
<DebugType
FullName="System.Object"
Kind="Class"
Module="mscorlib.dll"
Name="Object">
<BaseType>null</BaseType>
</DebugType>
</BaseType>
</DebugType>
</Type>
</Value>
</Item>
<Item>
<Value
AsString="5.5"
PrimitiveValue="5.5"
Type="System.Double">
<Type>
<DebugType
BaseType="System.Object"
FullName="System.Double"
Kind="Primitive"
Module="{Exception: The type is not a class or value type.}"
Name="Double">
<BaseType>
<DebugType
FullName="System.Object"
Kind="Class"
Module="mscorlib.dll"
Name="Object">
<BaseType>null</BaseType>
</DebugType>
</BaseType>
</DebugType>
</Type>
</Value>
</Item>
</locals>
<b_as_string>True</b_as_string>
<i_as_string>5</i_as_string>
<s_as_string>five</s_as_string>
<ProcessExited />
</Test>
</DebuggerTests>
#endif // EXPECTED_OUTPUT

92
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Value_Property.cs

@ -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…
Cancel
Save