Browse Source

Tests for the last revision generic

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2782 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
72d158f3e7
  1. 1
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj
  2. 17
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTestsBase.cs
  4. 85
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs
  5. 1116
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.xml

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

@ -43,6 +43,7 @@
<Compile Include="Src\TestPrograms\Exception.cs" /> <Compile Include="Src\TestPrograms\Exception.cs" />
<Compile Include="Src\TestPrograms\ExceptionCustom.cs" /> <Compile Include="Src\TestPrograms\ExceptionCustom.cs" />
<Compile Include="Src\TestPrograms\GenericDictionary.cs" /> <Compile Include="Src\TestPrograms\GenericDictionary.cs" />
<Compile Include="Src\TestPrograms\Generics.cs" />
<EmbeddedResource Include="Src\TestPrograms\*.cs" /> <EmbeddedResource Include="Src\TestPrograms\*.cs" />
<EmbeddedResource Include="Src\TestPrograms\*.xml" /> <EmbeddedResource Include="Src\TestPrograms\*.xml" />
</ItemGroup> </ItemGroup>

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

@ -442,5 +442,22 @@ namespace Debugger.Tests
process.WaitForExit(); process.WaitForExit();
CheckXmlOutput(); CheckXmlOutput();
} }
[Test]
public void Generics()
{
StartTest("Generics");
for(int i = 0; i < 8; i++) {
WaitForPause();
ObjectDump("SelectedFunction", process.SelectedFunction);
process.Continue();
}
WaitForPause();
process.Continue();
process.WaitForExit();
CheckXmlOutput();
}
} }
} }

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

@ -177,6 +177,7 @@ namespace Debugger.Tests
} }
foreach(System.Reflection.PropertyInfo property in type.GetProperties()) { foreach(System.Reflection.PropertyInfo property in type.GetProperties()) {
if (property.GetGetMethod() == null) continue;
if (property.GetGetMethod().GetParameters().Length > 0) continue; if (property.GetGetMethod().GetParameters().Length > 0) continue;
if (property.GetCustomAttributes(typeof(Debugger.Tests.IgnoreAttribute), true).Length > 0) continue; if (property.GetCustomAttributes(typeof(Debugger.Tests.IgnoreAttribute), true).Length > 0) continue;

85
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs

@ -0,0 +1,85 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision: 1634 $</version>
// </file>
using System;
namespace Debugger.Tests.TestPrograms
{
public class MainClass
{
public static void Main()
{
GenericClass<int, string> gClass = new GenericClass<int, string>();
gClass.Metod(1, "1!");
gClass.GenericMethod<bool>(1, "1!");
GenericClass<int, string>.StaticMetod(1, "1!");
GenericClass<int, string>.StaticGenericMethod<bool>(1, "1!");
GenericStruct<int, string> gStruct = new GenericStruct<int, string>();
gStruct.Metod(1, "1!");
gStruct.GenericMethod<bool>(1, "1!");
GenericStruct<int, string>.StaticMetod(1, "1!");
GenericStruct<int, string>.StaticGenericMethod<bool>(1, "1!");
System.Diagnostics.Debugger.Break();
}
}
public class GenericClass<V, K>
{
public K Metod(V v, K k)
{
System.Diagnostics.Debugger.Break();
return k;
}
public T GenericMethod<T>(V v, K k)
{
System.Diagnostics.Debugger.Break();
return default(T);
}
public static K StaticMetod(V v, K k)
{
System.Diagnostics.Debugger.Break();
return k;
}
public static T StaticGenericMethod<T>(V v, K k)
{
System.Diagnostics.Debugger.Break();
return default(T);
}
}
public struct GenericStruct<V, K>
{
public K Metod(V v, K k)
{
System.Diagnostics.Debugger.Break();
return k;
}
public T GenericMethod<T>(V v, K k)
{
System.Diagnostics.Debugger.Break();
return default(T);
}
public static K StaticMetod(V v, K k)
{
System.Diagnostics.Debugger.Break();
return k;
}
public static T StaticGenericMethod<T>(V v, K k)
{
System.Diagnostics.Debugger.Break();
return default(T);
}
}
}

1116
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.xml

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save