On Jun 14, 2025 at 10:50:46 PM, Martin Frb via fpc-devel <
fpc-devel@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.

I had this same problem before when trying to test some metrics. I think I
decided to use PChar even to ensure I only passed string constants and
avoided some copies.


Regards,
    Ryan Joseph
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to