Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-10

[patch] - fpcUnit testreport.pp

10 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Attached is a patch for testreport.pp (part of fpcUnit) that corrects indentation of XML output listing all available test casses.

Patch needs to be applied from the root FPC 2.1.1 directory.

Regards,
- Graeme -

There's no place like 127.0.0.1

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
Hi, Attached is a patch for testreport.pp (part of fpcUnit) that corrects indentation of XML output listing all available test casses. Patch needs to be applied from the root FPC 2.1.1 directory.

Thank you, applied the patch.

Michael.

Reply by email

Michael Van Canneyt
to Micha Nelissen
Micha Nelissen wrote 10 lines
Graeme Geldenhuys wrote: > +begin > + sString := ''; > + for i := 1 to pIntLen do > + sString := sString + ' '; > + Result := sString; > +end; I object to the inefficiency of this implementation. Isn't there a routine in system to generate a string of X characters ?

Yes. StringOfChar()

Michael.

Reply by email

Darius Blaszijk
to Micha Nelissen: I object to the inefficiency of this implementation. Isn't there a routine in system to…

DupeString

Earlier message 22 lines
----- Original Message ----- From: "Micha Nelissen" To: "FPC developers' list" Sent: Thursday, October 26, 2006 1:47 PM Subject: Re: [fpc-devel] [patch] - fpcUnit testreport.pp > Graeme Geldenhuys wrote: >> +begin >> + sString := ''; >> + for i := 1 to pIntLen do >> + sString := sString + ' '; >> + Result := sString; >> +end; > > I object to the inefficiency of this implementation. Isn't there a > routine in system to generate a string of X characters ? > > Micha > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Sergei Gorelkin
to Micha Nelissen: I object to the inefficiency of this implementation. Isn't there a routine in system to…

Thursday, October 26, 2006, 3:47:37 PM, Micha Nelissen wrote:

MN> Graeme Geldenhuys wrote 6 lines
> +begin > + sString := ''; > + for i := 1 to pIntLen do > + sString := sString + ' '; > + Result := sString; > +end;

MN> I object to the inefficiency of this implementation. Isn't there a MN> routine in system to generate a string of X characters ?

Surely there is - StringOfChar()

Best regards, Sergei

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Yes. StringOfChar() Michael.

Hi

Thanks for that, I didn't know about that function. Attached is the patch using the new StringOfChar.

Incidently the speed increase is not much, but yes it is faster. Maybe my test cases are just not big enough. ;-) I did 4 test runs with the old trSpace function and did 4 test runs with the new trSpace function outputing 80 lines of text each with varied levels of indentation.
The huge speed increase was: 0.00145 seconds

Thanks, that really cut down on my coffee break. :-)

Regards,
- Graeme -

Michael Van Canneyt wrote 22 lines
On Thu, 26 Oct 2006, Micha Nelissen wrote: > Graeme Geldenhuys wrote: > > +begin > > + sString := ''; > > + for i := 1 to pIntLen do > > + sString := sString + ' '; > > + Result := sString; > > +end; > > I object to the inefficiency of this implementation. Isn't there a routine in > system to generate a string of X characters ? Yes. StringOfChar() Michael. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel
There's no place like 127.0.0.1

Reply by email

Dean Zobec
to Graeme Geldenhuys

Graeme Geldenhuys ha scritto:

Show quoted text 13 lines
Hi Thanks for that, I didn't know about that function. Attached is the patch using the new StringOfChar. Incidently the speed increase is not much, but yes it is faster. Maybe my test cases are just not big enough. ;-) I did 4 test runs with the old trSpace function and did 4 test runs with the new trSpace function outputing 80 lines of text each with varied levels of indentation. The huge speed increase was: 0.00145 seconds Thanks, that really cut down on my coffee break. :-)

There's another benefit, 7 lines of code less.
Btw, thank you for your constant work.
Dean

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: Hi Thanks for that, I didn't know about that function. Attached is the patch using the…
Graeme Geldenhuys wrote 11 lines
Hi Thanks for that, I didn't know about that function. Attached is the patch using the new StringOfChar. Incidently the speed increase is not much, but yes it is faster. Maybe my test cases are just not big enough. ;-) I did 4 test runs with the old trSpace function and did 4 test runs with the new trSpace function outputing 80 lines of text each with varied levels of indentation. The huge speed increase was: 0.00145 seconds

1. Further increased speed by removing your helper function altogether.

2. Made it thread-safe by making the global 'ulevel' variable an (optional) argument to the TestSuiteAsXML function.

Remember: As a general rule, global variables are evil :)

Then committed.

Michael.

Reply by email