Skip to content

Commit

Permalink
googletest: add TYPED_TEST macros
Browse files Browse the repository at this point in the history
Add `TYPED_TEST` and `TYPED_TEST_P` macro definitions.
  • Loading branch information
fwinkl committed Dec 5, 2024
1 parent f7d0c25 commit 81e84be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cfg/googletest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<define name="TEST(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TEST_F(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TEST_P(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TYPED_TEST(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="TYPED_TEST_P(A,B)" value="void __ ## A ## _ ## B ( )"/>
<define name="GTEST_API_" value=""/>
<define name="GTEST_FLAG(name)" value="FLAGS_gtest_##name"/>
<define name="GTEST_DECLARE_bool_(name)" value="GTEST_API_ extern bool GTEST_FLAG(name)"/>
Expand Down
10 changes: 10 additions & 0 deletions test/cfg/googletest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ namespace ExampleNamespace {
{
return (arg == TOLERANCE);
}

// syntaxError when TYPED_TEST is not known
TYPED_TEST (ExampleTypedTest, cppcheck_test)
{
}

// syntaxError when TYPED_TEST_P is not known
TYPED_TEST_P (ExampleTypedTestP, cppcheck)
{
}
}

TEST(ASSERT, ASSERT)
Expand Down

0 comments on commit 81e84be

Please sign in to comment.