Same function implemented 6 times in calc tests

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Jan 28 07:22:05 PST 2013


Hey,

2013/1/28 Marcos Souza <marcos.souza.org at gmail.com>:
> Hi guys!
>
> While I was looking at some STRINGPARAM macros in calc, I saw the function
> createFileURL is implemented several times:
>
> http://opengrok.libreoffice.org/search?q=void+createFileURL&project=core&defs=&refs=&path=sc&hist=
>
> And they are all equal. In UnoApiTest exists a createFileURL too, and this
> is used just in one place in all LO code...

Yes they are all copied from the original implementation.

>
> Can I get ride of all this and make just one function and call it in every
> place?

Sure go on with that.

>
> If yes, how can I proceed? Where can I create this function?

Either in the test module in one of the common base classes or inside
a header file inside sc/qa/
I'd prefer the solution inside test as this would simplify the code a
bit for the future.

Regards,
Markus


More information about the LibreOffice mailing list