From f8e3179ce09419ab6c486cc6e7b82ba6ce2c19a9 Mon Sep 17 00:00:00 2001 From: Quajak Date: Fri, 8 May 2020 13:52:20 +0200 Subject: [PATCH] Added tests for list with enums of underlying long type --- .../System/Collections/Generic/ListTest.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/Collections/Generic/ListTest.cs b/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/Collections/Generic/ListTest.cs index 514499f64..e75557f87 100644 --- a/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/Collections/Generic/ListTest.cs +++ b/Tests/Kernels/Cosmos.Compiler.Tests.Bcl/System/Collections/Generic/ListTest.cs @@ -14,6 +14,13 @@ namespace Cosmos.Compiler.Tests.Bcl.System.Collections.Generic E1, E2 } + + public enum LongTest : long + { + L1 = long.MaxValue - 1, + L2 = long.MaxValue - 2, + L3 = 0 + } public static void Execute() { var xList = new List(); @@ -94,6 +101,13 @@ namespace Cosmos.Compiler.Tests.Bcl.System.Collections.Generic list.Add(Test.E2); Assert.IsTrue(list[0] == Test.E2, "IL2CPU does not handle lists with Enums correctly"); + List list2 = new List(); + list2.Add(LongTest.L3); + list2.Add(LongTest.L2); + list2.Add(LongTest.L1); + Assert.IsTrue(list2[2] == LongTest.L1, "Enums with underlying long type work"); + Assert.IsTrue(list2[1] == LongTest.L2, "Enums with underlying long type work"); + } } }