Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOOST_TEST_GLOBAL_FIXTURE documentation misleading #297

Closed
Mondlied opened this issue Jan 6, 2021 · 1 comment
Closed

BOOST_TEST_GLOBAL_FIXTURE documentation misleading #297

Mondlied opened this issue Jan 6, 2021 · 1 comment
Assignees
Milestone

Comments

@Mondlied
Copy link

Mondlied commented Jan 6, 2021

The documentation of BOOST_TEST_GLOBAL_FIXTURE makes no mention of a restriction of the class names that can be passed. Passing a class name including the namespace leads to a compiler error though. The documentation should be adjusted to indicate this (or the macro adjusted, assuming this is even possible.)

Documentation document: https://github.com/boostorg/test/blob/develop/doc/test_organization/fixtures.qbk (Section "Global fixture")

Example of the issue

namespace foo {
    struct Bar {
    }
}

BOOST_TEST_GLOBAL_FIXTURE(foo::Bar);

It's pretty simple to work around this issue, but the documentation should mention the restriction on the macro parameters.

Workaround for the above case:

namespace foo {
     BOOST_TEST_GLOBAL_FIXTURE(Bar);
}

Alternatively a typedef/using could be used, but this could lead to name conflicts that are avoided by putting BOOST_TEST_GLOBAL_FIXTURE inside the namespace.

@raffienficiaud raffienficiaud self-assigned this Feb 27, 2022
@raffienficiaud raffienficiaud added this to the 1.79 milestone Feb 27, 2022
@raffienficiaud
Copy link
Member

Merged in #337 rev b52b0ea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants