From 90c5a6311be83afa56f6f9de42ffacc67707cab9 Mon Sep 17 00:00:00 2001 From: neuecc Date: Thu, 28 May 2020 21:18:35 +0900 Subject: [PATCH] check il2cpp generics limitation --- .../Assets/Tests/GenericsWhenAllAny.cs | 165 ++++++++++++++++++ .../Assets/Tests/GenericsWhenAllAny.cs.meta | 11 ++ 2 files changed, 176 insertions(+) create mode 100644 src/UniTask/Assets/Tests/GenericsWhenAllAny.cs create mode 100644 src/UniTask/Assets/Tests/GenericsWhenAllAny.cs.meta diff --git a/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs b/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs new file mode 100644 index 0000000..e9a3c90 --- /dev/null +++ b/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs @@ -0,0 +1,165 @@ +#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6)) +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine.UI; +using UnityEngine.Scripting; +using Cysharp.Threading.Tasks; +using Unity.Collections; +using System.Threading; +using NUnit.Framework; +using UnityEngine.TestTools; +using FluentAssertions; + +namespace Cysharp.Threading.TasksTests +{ + public class GenericsWhenAllAny + { + + [UnityTest] + public IEnumerator WhenAllT15() => UniTask.ToCoroutine(async () => + { + var t01 = Tes(); + var t02 = Tes(); + var t03 = Tes(); + var t04 = Tes(); + var t05 = Tes(); + var t06 = Tes(); + var t07 = Tes(); + var t08 = Tes(); + var t09 = Tes(); + var t10 = Tes(); + var t11 = Tes(); + var t12 = Tes(); + var t13 = Tes(); + var t14 = Tes(); + var t15 = Tes(); + + await UniTask.WhenAll(t01, t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t12, t13, t14, t15); + }); + + [UnityTest] + public IEnumerator WhenAllT01_Generics1() => UniTask.ToCoroutine(async () => + { + var t01 = Tes>(); + + await UniTask.WhenAll(t01); + }); + + [UnityTest] + public IEnumerator WhenAllT02_Generics1() => UniTask.ToCoroutine(async () => + { + var t01 = Tes>(); + var t02 = Tes>(); + + await UniTask.WhenAll(t01, t02); + }); + + [UnityTest] + public IEnumerator WhenAllT03_Generics1() => UniTask.ToCoroutine(async () => + { + var t01 = Tes>(); + var t02 = Tes>(); + var t03 = Tes>(); + + await UniTask.WhenAll(t01, t02, t03); + }); + + [UnityTest] + public IEnumerator WhenAllT04_Generics1() => UniTask.ToCoroutine(async () => + { + var t01 = Tes>(); + var t02 = Tes>(); + var t03 = Tes>(); + var t04 = Tes>(); + + await UniTask.WhenAll(t01, t02, t03, t04); + }); + + // will fail. + + //[UnityTest] + //public IEnumerator WhenAllT05_Generics1() => UniTask.ToCoroutine(async () => + //{ + // var t01 = Tes>(); + // var t02 = Tes>(); + // var t03 = Tes>(); + // var t04 = Tes>(); + // var t05 = Tes>(); + + // await UniTask.WhenAll(t01, t02, t03, t04, t05); + //}); + + //[UnityTest] + //public IEnumerator WhenAllT06_Generics1() => UniTask.ToCoroutine(async () => + //{ + // var t01 = Tes>(); + // var t02 = Tes>(); + // var t03 = Tes>(); + // var t04 = Tes>(); + // var t05 = Tes>(); + // var t06 = Tes>(); + + // await UniTask.WhenAll(t01, t02, t03, t04, t05, t06); + //}); + + //[UnityTest] + //public IEnumerator WhenAllT07_Generics1() => UniTask.ToCoroutine(async () => + //{ + // var t01 = Tes>(); + // var t02 = Tes>(); + // var t03 = Tes>(); + // var t04 = Tes>(); + // var t05 = Tes>(); + // var t06 = Tes>(); + // var t07 = Tes>(); + + // await UniTask.WhenAll(t01, t02, t03, t04, t05, t06, t07); + //}); + + //[UnityTest] + //public IEnumerator WhenAllT15_Generics1() => UniTask.ToCoroutine(async () => + //{ + // var t01 = Tes>(); + // var t02 = Tes>(); + // var t03 = Tes>(); + // var t04 = Tes>(); + // var t05 = Tes>(); + // var t06 = Tes>(); + // var t07 = Tes>(); + // var t08 = Tes>(); + // var t09 = Tes>(); + // var t10 = Tes>(); + // var t11 = Tes>(); + // var t12 = Tes>(); + // var t13 = Tes>(); + // var t14 = Tes>(); + // var t15 = Tes>(); + + // await UniTask.WhenAll(t01, t02, t03, t04, t05, t06, t07, t08, t09, t10, t11, t12, t13, t14, t15); + //}); + + async UniTask Tes() + { + await UniTask.Yield(); + return default; + } + } + + public class MyGenerics + { + + } + + public class MyGenerics2 + { + + } +} + +#endif \ No newline at end of file diff --git a/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs.meta b/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs.meta new file mode 100644 index 0000000..67ac5a6 --- /dev/null +++ b/src/UniTask/Assets/Tests/GenericsWhenAllAny.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ce87069a3c0ebb47b26dca280a07756 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: