[fpc-devel] Speed of TTestCase
Sven Barth
pascaldragon at googlemail.com
Tue Jun 17 11:11:41 CEST 2025
Hairy Pixels via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am Sa.,
14. Juni 2025, 18:20:
> On Jun 14, 2025 at 10:50:46 PM, Martin Frb via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
>
>> I may... Need to find some time.
>>
>> Also, what do you think about overloading AssertEquals (and the like)
>> taking
>> AssertEqual(
>> const AnFormatString: string;
>> const AFormatData: array of const;
>> AnExpect,
>> AnActual: TFoo
>> )
>> ?
>>
>
> Curious, if the function was actually inline wouldn’t the condition be
> tripped and exit before calling the format call which was passed in? FPC
> often fails to inline for various reason so if it can’t I agree your
> solution makes sense.
>
If the compiler would indeed inline in this case, then yes, the Format call
would be skipped. However open arrays are currently not supported for
inlining.
But even without inlining this is simply more convenient for a user (I
often have such formatting related overloads in my own code as well).
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20250617/fc4fbdea/attachment.htm>
More information about the fpc-devel
mailing list