[tests/managed] Add arrays and builtin types files to shared project.

This commit is contained in:
Joao Matos 2017-05-04 23:29:40 +01:00
Родитель 3fe3ab7be7
Коммит d4d8b12d79
4 изменённых файлов: 37 добавлений и 42 удалений

Просмотреть файл

@ -1,5 +1,3 @@
#if NON_OBJC_SUPPORTED_TESTS
using System;
using System.Linq;
@ -23,5 +21,3 @@ namespace Arrays {
}
}
}
#endif

35
tests/managed/builtins.cs Normal file
Просмотреть файл

@ -0,0 +1,35 @@
using System;
public class BuiltinTypes
{
public void ReturnsVoid () { }
public bool ReturnsBool () { return true; }
public sbyte ReturnsSByte () { return -5; }
public byte ReturnsByte () { return 5; }
public short ReturnsShort () { return -5; }
public ushort ReturnsUShort () { return 5; }
public int ReturnsInt () { return -5; }
public uint ReturnsUInt () { return 5; }
public long ReturnsLong () { return -5; }
public ulong ReturnsULong () { return 5; }
public char ReturnsChar () { return 'a'; }
public string ReturnsString () { return "Mono"; }
public bool PassAndReturnsBool (bool v) { return v; }
public sbyte PassAndReturnsSByte (sbyte v) { return v; }
public byte PassAndReturnsByte (byte v) { return v; }
public short PassAndReturnsShort (short v) { return v; }
public ushort PassAndReturnsUShort (ushort v) { return v; }
public int PassAndReturnsInt (int v) { return v; }
public uint PassAndReturnsUInt (uint v) { return v; }
public long PassAndReturnsLong (long v) { return v; }
public ulong PassAndReturnsULong (ulong v) { return v; }
public char PassAndReturnsChar (char v) { return v; }
public string PassAndReturnsString (string v) { return v; }
public void PassOutInt (out int v) { v = 5; }
public void PassRefInt (ref int v) { v = 10; }
public void PassOutString (out string v) { v = "Mono"; }
public void PassRefString (ref string v) { v = "Mono"; }
}

Просмотреть файл

@ -11,6 +11,8 @@
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)arrays.cs" />
<Compile Include="$(MSBuildThisFileDirectory)builtins.cs" />
<Compile Include="$(MSBuildThisFileDirectory)constructors.cs" />
<Compile Include="$(MSBuildThisFileDirectory)enums.cs" />
<Compile Include="$(MSBuildThisFileDirectory)equalsHashOverrides.cs" />

Просмотреть файл

@ -80,44 +80,6 @@ public static class Type_String
public static string NonEmptyString { get { return "Hello World"; } }
}
#if NON_OBJC_SUPPORTED_TESTS
public class BuiltinTypes
{
public void ReturnsVoid () { }
public bool ReturnsBool () { return true; }
public sbyte ReturnsSByte () { return -5; }
public byte ReturnsByte () { return 5; }
public short ReturnsShort () { return -5; }
public ushort ReturnsUShort () { return 5; }
public int ReturnsInt () { return -5; }
public uint ReturnsUInt () { return 5; }
public long ReturnsLong () { return -5; }
public ulong ReturnsULong () { return 5; }
public char ReturnsChar () { return 'a'; }
public string ReturnsString () { return "Mono"; }
public bool PassAndReturnsBool (bool v) { return v; }
public sbyte PassAndReturnsSByte (sbyte v) { return v; }
public byte PassAndReturnsByte (byte v) { return v; }
public short PassAndReturnsShort (short v) { return v; }
public ushort PassAndReturnsUShort (ushort v) { return v; }
public int PassAndReturnsInt (int v) { return v; }
public uint PassAndReturnsUInt (uint v) { return v; }
public long PassAndReturnsLong (long v) { return v; }
public ulong PassAndReturnsULong (ulong v) { return v; }
public char PassAndReturnsChar (char v) { return v; }
public string PassAndReturnsString (string v) { return v; }
public void PassOutInt (out int v) { v = 5; }
public void PassRefInt (ref int v) { v = 10; }
public void PassOutString (out string v) { v = "Mono"; }
public void PassRefString (ref string v) { v = "Mono"; }
}
#endif
// objc: this type won't be generated (Exception is not supported) but the generation will succeed (with warnings)
public class MyException : Exception {
}