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

Unable to compile TEMPLATE_TEST_CASE_SIG with 7 templates #1954

Closed
nicolapiccinelli opened this issue Jun 8, 2020 · 1 comment
Closed

Unable to compile TEMPLATE_TEST_CASE_SIG with 7 templates #1954

nicolapiccinelli opened this issue Jun 8, 2020 · 1 comment

Comments

@nicolapiccinelli
Copy link

Describe the bug
The following test won't compile:

TEMPLATE_TEST_CASE_SIG("Title", "[con][template]",
                       ((int Tnx, int Tnu, int Tny, int Tph, int Tch, int Tineq, int Teq), Tnx, Tnu, Tny, Tph, Tch, Tineq, Teq),
                       (1, 1, 1, 1, 1, 0, 0), (5, 1, 1, 1, 1, 0, 0), (5, 3, 1, 1, 1, 0, 0),
                       (5, 3, 1, 7, 1, 0, 0), (5, 3, 1, 7, 4, 0, 0), (5, 3, 1, 7, 7, 0, 0))

This is the compiler error

... fatal error: too few arguments provided to function-like macro invocation
TEMPLATE_TEST_CASE_SIG("Checking missing user constraints", "[constraints][template]",
^
/usr/local/include/catch2/catch.hpp:17455:39: note: expanded from macro 'TEMPLATE_TEST_CASE_SIG'
#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
                                      ^
/usr/local/include/catch2/catch.hpp:1130:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG'
        INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_...
        ^
/usr/local/include/catch2/catch.hpp:1112:22: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_TEST_CASE_2'
            TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
                     ^
/usr/local/include/catch2/catch.hpp:770:20: note: expanded from macro 'INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES'
    CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
                   ^
/usr/local/include/catch2/catch.hpp:777:9: note: macro 'INTERNAL_CATCH_REMOVE_PARENS_6_ARG' defined here
#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)

Expected behavior
Should compile

Reproduction steps
To reproduce the error is enough an empty test with the signature above:

TEMPLATE_TEST_CASE_SIG("Title, "[con][template]",
                       ((int Tnx, int Tnu, int Tny, int Tph, int Tch, int Tineq, int Teq), Tnx, Tnu, Tny, Tph, Tch, Tineq, Teq),
                       (1, 1, 1, 1, 1, 0, 0), (5, 1, 1, 1, 1, 0, 0), (5, 3, 1, 1, 1, 0, 0),
                       (5, 3, 1, 7, 1, 0, 0), (5, 3, 1, 7, 4, 0, 0), (5, 3, 1, 7, 7, 0, 0))
{
}

Platform information:

  • OS: Catalina 10.15.4
  • Compiler+version: Apple clang version 11.0.3 (clang-1103.0.32.62)
  • Catch version: Catch v2.12.2
@horenmar
Copy link
Member

We have had to implement those macros using copy paste due to MSVC's preprocessor and apparently in the 7-arg case we made a copy paste error.

Should be fixed now.

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

No branches or pull requests

2 participants