Menu

#135 CPPUNIT_TEST_SUITE_REGISTRATION may cause symbol collision

1.10.2
closed-invalid
nobody
5
2004-11-02
2004-10-21
Anonymous
No

Unique symbol names are created by appending the line
number to autoRegisterRegistry__. This works fine if all
of your declarations are right in a row:

CPPUNIT_TEST_SUITE_REGISTRATION(MyFoo);
CPPUNIT_TEST_SUITE_REGISTRATION(MyBar);

However, if they are broken into different files, it is vary
possible that they end up on the same line, in which
case your application can no longer compile. Perhaps
joining the test fixture name and the line number would
make a better symbol.

Discussion

  • Baptiste Lepilleur

    • status: open --> closed-invalid
     
  • Baptiste Lepilleur

    Logged In: YES
    user_id=196852

    Those variables are declared static, meaning they are not
    visible beyond the translation unit => no collisions are
    possible.

    Baptiste.

     

Log in to post a comment.