Browse Source

Updated unit tests to the new metadata API

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5110 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 16 years ago
parent
commit
710b027272
  1. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs
  3. 1120
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugType.cs
  4. 92
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebugType_CompilerGeneratedClasses.cs
  5. 4
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ExpressionEvaluator.cs

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs

@ -354,7 +354,7 @@ namespace Debugger.MetaData @@ -354,7 +354,7 @@ namespace Debugger.MetaData
public override Type GetInterface(string name, bool ignoreCase)
{
foreach(DebugType inter in this.GetInterfaces()) {
if (string.Equals(inter.FullName, fullName, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) {
if (string.Equals(inter.FullName, name, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) {
return inter;
}
}
@ -569,11 +569,7 @@ namespace Debugger.MetaData @@ -569,11 +569,7 @@ namespace Debugger.MetaData
public bool IsCompilerGenerated {
get {
if (this.IsClass || this.IsValueType) {
return IsDefined(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false);
} else {
return false;
}
return IsDefined(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute), false);
}
}
@ -950,8 +946,6 @@ namespace Debugger.MetaData @@ -950,8 +946,6 @@ namespace Debugger.MetaData
case "System.UInt64": return typeof(System.UInt64);
case "System.Single": return typeof(System.Single);
case "System.Double": return typeof(System.Double);
case "System.IntPtr": return typeof(System.IntPtr);
case "System.UIntPtr": return typeof(System.UIntPtr);
case "System.String": return typeof(System.String);
default: return null;
}

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

@ -65,15 +65,16 @@ namespace Debugger.Tests @@ -65,15 +65,16 @@ namespace Debugger.Tests
"*.GetHashCode",
"*.GetEnumerator",
"MemberInfo.MemberType",
"MemberInfo.IsPublic",
"Type.DeclaringType",
"Type.IsAbstract",
"Type.IsAnsiClass",
"Type.IsAutoLayout",
"Type.IsLayoutSequential",
"Type.IsPublic",
"Type.IsNestedPublic",
"Type.IsSealed",
"Type.IsSerializable",
"Type.IsNotPublic",
"Type.Name",
"Type.Namespace",
"Type.UnderlyingSystemType",
@ -81,11 +82,10 @@ namespace Debugger.Tests @@ -81,11 +82,10 @@ namespace Debugger.Tests
"MethodBase.GetMethodBody",
"MethodBase.GetMethodImplementationFlags",
"MethodBase.GetParameters",
"MethodBase.IsFinal",
"MethodBase.IsHideBySig",
"MethodBase.IsPublic",
"MethodBase.IsVirtual",
"MethodBase.IsSpecialName",
"MethodBase.Name",
"MethodBase.ReturnParameter",
"MethodBase.ParameterCount",
"PropertyInfo.CanRead",

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

File diff suppressed because it is too large Load Diff

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

@ -70,20 +70,11 @@ namespace Debugger.Tests { @@ -70,20 +70,11 @@ namespace Debugger.Tests {
public void DebugType_CompilerGeneratedClasses()
{
StartTest("DebugType_CompilerGeneratedClasses.cs");
ObjectDump("YieldLocalVariables",
process.SelectedStackFrame.MethodInfo.LocalVariables.
Select(v => new { v.Name, Value = v.GetValue(process.SelectedStackFrame) })
);
PrintLocalVariables("YieldLocalVariables");
process.Continue();
ObjectDump("OutterDelegateLocalVariables",
process.SelectedStackFrame.MethodInfo.LocalVariables.
Select(v => new { v.Name, Value = v.GetValue(process.SelectedStackFrame) })
);
PrintLocalVariables("OutterDelegateLocalVariables");
process.Continue();
ObjectDump("InnterDelegateLocalVariables",
process.SelectedStackFrame.MethodInfo.LocalVariables.
Select(v => new { v.Name, Value = v.GetValue(process.SelectedStackFrame) })
);
PrintLocalVariables("InnterDelegateLocalVariables");
EndTest();
}
}
@ -101,134 +92,159 @@ namespace Debugger.Tests { @@ -101,134 +92,159 @@ namespace Debugger.Tests {
<DebuggingPaused>Break DebugType_CompilerGeneratedClasses.cs:35,5-35,41</DebuggingPaused>
<YieldLocalVariables>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar"
Type="System.Int32"
Value="201" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="deleg"
Type="Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses.IntDelegate"
Value="null" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_DelegRef"
Type="System.Int32"
Value="202" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_NestedDelegRef"
Type="System.Int32"
Value="203" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="this"
Type="Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses"
Value="{Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses}" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar"
Type="System.Int32"
Value="101" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_DelegRef"
Type="System.Int32"
Value="102" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_NestedDelegRef"
Type="System.Int32"
Value="103" />
</Item>
</YieldLocalVariables>
<DebuggingPaused>Break DebugType_CompilerGeneratedClasses.cs:54,6-54,42</DebuggingPaused>
<OutterDelegateLocalVariables>
<Item>
<AnonymousType
<LocalVariable
Name="delegVar"
Type="System.Int32"
Value="301" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="nestedDeleg"
Value="{IntDelegate}" />
Type="Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses.IntDelegate"
Value="{Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses.IntDelegate}" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="delegVar_NestedDelegRef"
Type="System.Int32"
Value="302" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="delegArg_NestedDelegRef"
Type="System.Int32"
Value="401" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_DelegRef"
Type="System.Int32"
Value="202" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_NestedDelegRef"
Type="System.Int32"
Value="203" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_DelegRef"
Type="System.Int32"
Value="102" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_NestedDelegRef"
Type="System.Int32"
Value="103" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="this"
Type="Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses"
Value="{Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses}" />
</Item>
</OutterDelegateLocalVariables>
<DebuggingPaused>Break DebugType_CompilerGeneratedClasses.cs:51,7-51,43</DebuggingPaused>
<InnterDelegateLocalVariables>
<Item>
<AnonymousType
<LocalVariable
Name="nestedDelegVar"
Type="System.Int32"
Value="303" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="delegVar_NestedDelegRef"
Type="System.Int32"
Value="302" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="delegArg_NestedDelegRef"
Type="System.Int32"
Value="401" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_DelegRef"
Type="System.Int32"
Value="202" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateLessVar_NestedDelegRef"
Type="System.Int32"
Value="203" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_DelegRef"
Type="System.Int32"
Value="102" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="stateFullVar_NestedDelegRef"
Type="System.Int32"
Value="103" />
</Item>
<Item>
<AnonymousType
<LocalVariable
Name="this"
Type="Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses"
Value="{Debugger.Tests.TestPrograms.DebugType_CompilerGeneratedClasses}" />
</Item>
</InnterDelegateLocalVariables>

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

@ -156,14 +156,14 @@ namespace Debugger.Tests { @@ -156,14 +156,14 @@ namespace Debugger.Tests {
<Eval> array[1] = e </Eval>
<Eval> array[i] = o </Eval>
<Eval> array[i - 1] = l </Eval>
<Eval> list = List&lt;Char&gt; {H, e, l, l, o} </Eval>
<Eval> list = List`1 {H, e, l, l, o} </Eval>
<Eval> list[1] = e </Eval>
<Eval> list[i] = o </Eval>
<Eval> hi[1] = i </Eval>
<Eval> "abcd"[2] = c </Eval>
<Eval> </Eval>
<Eval> list.Add(42); list.Add(52);</Eval>
<Eval> list = List&lt;Char&gt; {H, e, l, l, o, *, 4} </Eval>
<Eval> list = List`1 {H, e, l, l, o, *, 4} </Eval>
<Eval> </Eval>
<Eval> i = 10 = 10 </Eval>
<Eval> -i = -10 </Eval>

Loading…
Cancel
Save