#23 better registration macro

open
5
2003-03-11
2003-03-07
Anonymous
No

The registration macro appends the current line number
to the token it generates. Unfortunately, this is not
unique across source files. I made a simple
modification (see below). It now prepends the test
class name to the token.

#define CPPUNIT_TEST_SUITE_REGISTRATION(
ATestFixtureType ) \ static CppUnit::AutoRegisterSuite< ATestFixtureType >
\

__CPPUNIT_MAKE_UNIQUE_NAME(ATestFixtureType##__autoRegisterSuite
)

Discussion

  • Baptiste Lepilleur

    • assigned_to: nobody --> blep
     
  • Baptiste Lepilleur

    Logged In: YES
    user_id=196852

    I don't understand the issue you have with the current
    implementation: If the line number is included in the name
    and there is only one test declaration per line, then it is
    unique in the source file.

    Could you explain what is the problem ?

    Baptiste.

     

Log in to post a comment.