On Sat, 14 Jun 2025, Martin Frb via fpc-devel wrote:

On 14/06/2025 15:44, Michael Van Canneyt via fpc-devel wrote:

I have heaps and heaps of testcases, but I've never felt the need to investigate
the speed of the Assert* calls.

I wasn't actually looking at it... I found it by random chance.

I was trying to kcachegrind some of my code, and the results said that the majority of time went into string handling that wasn't part of the tested code.



Millions of AssertEquals calls ? I'm surprised that you are surprised it takes so long? :-)
I haven't counted them.

But some of my tests are simply fuzzing (ish) tests (not necessarily random, but just throwing large amount of data at the code).


If you present a patch to avoid constructing the message in case the test is
OK, that's certainly fine for me.

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
)
?

OK with me.

I would not do the checkequal since that will lead to confusion
with the Delphi DUnit compatibility layer.

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to