Skip to content

Fix Win64 compilation of the test project - #42

Open
JaapBaak wants to merge 1 commit into
GDKsoftware:mainfrom
JaapBaak:Fix-Win64-test-project-
Open

Fix Win64 compilation of the test project#42
JaapBaak wants to merge 1 commit into
GDKsoftware:mainfrom
JaapBaak:Fix-Win64-test-project-

Conversation

@JaapBaak

@JaapBaak JaapBaak commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Problem

The test project no longer compiles with dcc64 since #36 introduced
Office4D.Tests.Xml.pas:

[dcc64 Error] Office4D.Tests.Xml.pas(56): E2532 Couldn't infer generic type
argument from different argument types for method 'AreEqual'

(and the same error on the seven other Length asserts in that unit.)

Cause

Under dcc64 in Delphi 12 and later, Length on a dynamic array returns
NativeInt. Assert.AreEqual(2, Length(Elements)) then has no matching
concrete DUnitX overload, and the generic AreEqual<T> cannot infer T
from an Integer literal and a NativeInt argument. The Win32 CI build
doesn't catch this because NativeInt equals Integer there.

Fix

Cast the Length results to Integer, the idiom the other test units
already use (e.g. Office4D.Tests.Excel.pas, Office4D.Tests.Excel.DeleteColumnRow.pas).

Verified: the test project compiles with dcc64 and all tests pass (Win64).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant