Am 30.04.23 um 13:40 schrieb Matthias Seidel:
Hi Peter,

Am 30.04.23 um 12:19 schrieb Peter Kovacs:
Hi All,

As suspekted adding GTEST_ in front fixes my setup.
What does that mean?

Do we need to change something in our code or is it just a configuration
issue?

It depends...

If Googletest is build with the option

  -DGTEST_DONT_DEFINE_FOO=1

our build will fail, because TEST Macro will change name to GTEST_TEST, in 
order to avoid overlap with other testsuites.
If build without the option our build works.

I guess that distributors likely will activate this option. In case we want to 
integrate we might run into issues, depending on distributor.


Regards,

    Matthias

All the best


Am 29.04.23 um 09:26 schrieb Peter Kovacs:
Hi all.

Build fails with:

main/sal/qa/rtl/crc32/rtl_crc32.cxx:72:1:error: expected constructor,
destructor, or type conversion before '(' token

   72 | TEST_F(test, rtl_crc32_002_1)

I have installed gtest using official ubuntu package

the readme says:

### Avoiding Macro Name Clashes

In C++, macros don't obey namespaces. Therefore two libraries that
both define a
macro of the same name will clash if you `#include` both definitions.
In case a
GoogleTest macro clashes with another library, you can force
GoogleTest to
rename its macro to avoid the conflict.

Specifically, if both GoogleTest and some other code define macro
FOO, you can
add

    -DGTEST_DONT_DEFINE_FOO=1

to the compiler flags to tell GoogleTest to change the macro's name
from `FOO`
to `GTEST_FOO`. Currently `FOO` can be `FAIL`, `SUCCEED`, or `TEST`. For
example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write

    GTEST_TEST(SomeTest, DoesThis) { ... }

instead of

    TEST(SomeTest, DoesThis) { ... }

in order to define a test.

------------------------------------------

can this cause my issue?

should we make a change if so?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to