Use correct type name instead of index for TEMPLATE_PRODUCT_TEST_CASE (#1544)

Previously, for a TEMPLATE_PRODUCT_TEST_CASE("Test" ..., T, (P1, P2)),
the generated test case names were

  Test - 0
  Test - 1

With this commit, the correct typename is used:

  Test - T<P1>
  Test - T<P2>

-----------

MSVC needs another indirection to evaluate INTERNAL_CATCH_STRINGIZE
and also inserts a space before theINTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS
parameter, which we can get rid of by pointer arithmetic.
This commit is contained in:
Tobias Ribizel
2019-02-17 21:52:22 +01:00
committed by Martin Hořeňovský
parent 359a54b6bd
commit c99a346490
7 changed files with 85 additions and 57 deletions

View File

@@ -93,7 +93,8 @@ with expansion:
"hello" == "world"
-------------------------------------------------------------------------------
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 0
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
<float>
-------------------------------------------------------------------------------
Class.tests.cpp:<line number>
...............................................................................
@@ -104,7 +105,8 @@ with expansion:
0 == 1
-------------------------------------------------------------------------------
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 1
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - Template_Foo
<int>
-------------------------------------------------------------------------------
Class.tests.cpp:<line number>
...............................................................................
@@ -115,7 +117,8 @@ with expansion:
0 == 1
-------------------------------------------------------------------------------
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 2
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
<float>
-------------------------------------------------------------------------------
Class.tests.cpp:<line number>
...............................................................................
@@ -126,7 +129,8 @@ with expansion:
0 == 1
-------------------------------------------------------------------------------
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - 3
A TEMPLATE_PRODUCT_TEST_CASE_METHOD based test run that fails - std::vector
<int>
-------------------------------------------------------------------------------
Class.tests.cpp:<line number>
...............................................................................