VSoftTechnologies/DUnitX

Test project won't compile with XE2 and probably higher

Fr0sT-Brutal opened this issue · 1 comments

XE2 and probably several higher versions don't support inline declaration of TArray<T> constants ([item1, item2, ...]) so all tests for AreEqual method with arrays fail to compile:

[DCC Error] DUnitX.Tests.Assert.pas(1201): E2250 There is no overloaded version of 'Assert.AreEqual<System.Integer>' that can be called with these arguments
[DCC Error] DUnitX.Tests.Assert.pas(1207): E2001 Ordinal type required

solutions are:

  • Assert.AreEqual<integer>(TArray<integer>.Create(1, 2, 3), TArray<integer>.Create(1, 2, 3, 4)); - just enable older compilers to build tests
  • change method declaration from TArray<T> to array of T so that all compilers could use the shorter form

Thanks, pushed the change to the tests.