Browse Source

Base class tests

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2918 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
cca75c8ce0
  1. 1
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj
  2. 17
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs
  3. 167
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/PrimitiveValue.cs

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

@ -59,6 +59,7 @@ @@ -59,6 +59,7 @@
<Compile Include="Src\TestPrograms\HelloWorld.cs" />
<Compile Include="Src\TestPrograms\MetadataIdentity.cs" />
<Compile Include="Src\TestPrograms\ObjectValue.cs" />
<Compile Include="Src\TestPrograms\PrimitiveValue.cs" />
<Compile Include="Src\TestPrograms\PropertyVariable.cs" />
<Compile Include="Src\TestPrograms\PropertyVariableForm.cs" />
<Compile Include="Src\TestPrograms\SetIP.cs" />

17
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs

@ -29,11 +29,15 @@ namespace Debugger.Tests { @@ -29,11 +29,15 @@ namespace Debugger.Tests {
[NUnit.Framework.Test]
public void ArrayValue()
{
ExpandProperties(
"DebugType.BaseType"
);
StartTest("ArrayValue.cs");
Value array = process.SelectedStackFrame.GetLocalVariableValue("array");
ObjectDump("array", array);
ObjectDump("array elements", array.GetArrayElements());
ObjectDump("type", array.Type);
EndTest();
}
@ -141,6 +145,19 @@ namespace Debugger.Tests { @@ -141,6 +145,19 @@ namespace Debugger.Tests {
<Type>System.Int32</Type>
</Item>
</array_elements>
<type Type="DebugType" ToString="System.Int32[]">
<BaseType exception="Value does not fall within the expected range." />
<FullName>System.Int32[]</FullName>
<HasElementType>True</HasElementType>
<IsArray>True</IsArray>
<IsClass>False</IsClass>
<IsGenericType>False</IsGenericType>
<IsInteger>False</IsInteger>
<IsPrimitive>False</IsPrimitive>
<IsValueType>False</IsValueType>
<ManagedType>System.Array</ManagedType>
<Module exception="The type is not a class or value type." />
</type>
<ProcessExited />
</Test>
</DebuggerTests>

167
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/PrimitiveValue.cs

@ -0,0 +1,167 @@ @@ -0,0 +1,167 @@
// <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 PrimitiveValue
{
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 PrimitiveValue()
{
ExpandProperties(
"Value.Type",
"DebugType.BaseType"
);
StartTest("PrimitiveValue.cs");
ObjectDump("locals", process.SelectedStackFrame.GetLocalVariableValues());
EndTest();
}
}
}
#endif
#if EXPECTED_OUTPUT
<?xml version="1.0" encoding="utf-8"?>
<DebuggerTests>
<Test name="PrimitiveValue.cs">
<ProcessStarted />
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded>
<ModuleLoaded symbols="True">PrimitiveValue.exe</ModuleLoaded>
<DebuggingPaused>Break</DebuggingPaused>
<locals Type="Value[]" ToString="Debugger.Value[]">
<Item Type="Value" ToString="b = True">
<ArrayDimensions exception="Value is not an array" />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<AsString>True</AsString>
<Expression>b</Expression>
<HasExpired>False</HasExpired>
<IsArray>False</IsArray>
<IsInteger>False</IsInteger>
<IsNull>False</IsNull>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<PrimitiveValue>True</PrimitiveValue>
<Type Type="DebugType" ToString="System.Boolean">
<BaseType exception="Value does not fall within the expected range." />
<FullName>System.Boolean</FullName>
<HasElementType>False</HasElementType>
<IsArray>False</IsArray>
<IsClass>False</IsClass>
<IsGenericType>False</IsGenericType>
<IsInteger>False</IsInteger>
<IsPrimitive>True</IsPrimitive>
<IsValueType>False</IsValueType>
<ManagedType>System.Boolean</ManagedType>
<Module exception="The type is not a class or value type." />
</Type>
</Item>
<Item Type="Value" ToString="i = 5">
<ArrayDimensions exception="Value is not an array" />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<AsString>5</AsString>
<Expression>i</Expression>
<HasExpired>False</HasExpired>
<IsArray>False</IsArray>
<IsInteger>True</IsInteger>
<IsNull>False</IsNull>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<PrimitiveValue>5</PrimitiveValue>
<Type Type="DebugType" ToString="System.Int32">
<BaseType exception="Value does not fall within the expected range." />
<FullName>System.Int32</FullName>
<HasElementType>False</HasElementType>
<IsArray>False</IsArray>
<IsClass>False</IsClass>
<IsGenericType>False</IsGenericType>
<IsInteger>True</IsInteger>
<IsPrimitive>True</IsPrimitive>
<IsValueType>False</IsValueType>
<ManagedType>System.Int32</ManagedType>
<Module exception="The type is not a class or value type." />
</Type>
</Item>
<Item Type="Value" ToString="s = five">
<ArrayDimensions exception="Value is not an array" />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<AsString>five</AsString>
<Expression>s</Expression>
<HasExpired>False</HasExpired>
<IsArray>False</IsArray>
<IsInteger>False</IsInteger>
<IsNull>False</IsNull>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<PrimitiveValue>five</PrimitiveValue>
<Type Type="DebugType" ToString="System.String">
<BaseType exception="Value does not fall within the expected range." />
<FullName>System.String</FullName>
<HasElementType>False</HasElementType>
<IsArray>False</IsArray>
<IsClass>False</IsClass>
<IsGenericType>False</IsGenericType>
<IsInteger>False</IsInteger>
<IsPrimitive>True</IsPrimitive>
<IsValueType>False</IsValueType>
<ManagedType>System.String</ManagedType>
<Module exception="The type is not a class or value type." />
</Type>
</Item>
<Item Type="Value" ToString="d = 5.5">
<ArrayDimensions exception="Value is not an array" />
<ArrayLenght exception="Value is not an array" />
<ArrayRank exception="Value is not an array" />
<AsString>5.5</AsString>
<Expression>d</Expression>
<HasExpired>False</HasExpired>
<IsArray>False</IsArray>
<IsInteger>False</IsInteger>
<IsNull>False</IsNull>
<IsObject>False</IsObject>
<IsPrimitive>True</IsPrimitive>
<PrimitiveValue>5.5</PrimitiveValue>
<Type Type="DebugType" ToString="System.Double">
<BaseType exception="Value does not fall within the expected range." />
<FullName>System.Double</FullName>
<HasElementType>False</HasElementType>
<IsArray>False</IsArray>
<IsClass>False</IsClass>
<IsGenericType>False</IsGenericType>
<IsInteger>False</IsInteger>
<IsPrimitive>True</IsPrimitive>
<IsValueType>False</IsValueType>
<ManagedType>System.Double</ManagedType>
<Module exception="The type is not a class or value type." />
</Type>
</Item>
</locals>
<ProcessExited />
</Test>
</DebuggerTests>
#endif // EXPECTED_OUTPUT
Loading…
Cancel
Save