Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cfg/googletest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,15 @@
<define name="MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)" value="bool name##MatcherP9&lt;p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type, p7##_type, p8##_type&gt;::gmock_Impl&lt;arg_type&gt;::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
<define name="MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)" value="bool name##MatcherP10&lt;p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type&gt;::gmock_Impl&lt;arg_type&gt;::MatchAndExplain(GTEST_REFERENCE_TO_CONST_(arg_type) arg,::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) const"/>
<define name="MOCK_METHOD(...)" value=""/>
<define name="ACTION(name)" value="template&lt;class arg0_type, class arg1_type&gt; auto name(const arg0_type&amp; arg0, const arg1_type&amp; arg1)"/>
<define name="ACTION_P(name,p0)" value="template&lt;class p0##_type, class arg0_type&gt; auto name(p0##_type p0, const arg0_type&amp; arg0)"/>
<define name="ACTION_P2(name,p0,p1)" value="template&lt;class p0##_type, class p1##_type&gt; auto name(p0##_type p0, p1##_type p1, int arg0)"/>
<define name="ACTION_P3(name,p0,p1,p2)" value="template&lt;class p0##_type, class p1##_type, class p2##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, int arg0)"/>
<define name="ACTION_P4(name,p0,p1,p2,p3)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, int arg0)"/>
<define name="ACTION_P5(name,p0,p1,p2,p3,p4)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, int arg0)"/>
<define name="ACTION_P6(name,p0,p1,p2,p3,p4,p5)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type, class p5##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, int arg0)"/>
<define name="ACTION_P7(name,p0,p1,p2,p3,p4,p5,p6)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type, class p5##_type, class p6##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, int arg0)"/>
<define name="ACTION_P8(name,p0,p1,p2,p3,p4,p5,p6,p7)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type, class p5##_type, class p6##_type, class p7##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, int arg0)"/>
<define name="ACTION_P9(name,p0,p1,p2,p3,p4,p5,p6,p7,p8)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type, class p5##_type, class p6##_type, class p7##_type, class p8##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, int arg0)"/>
<define name="ACTION_P10(name,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9)" value="template&lt;class p0##_type, class p1##_type, class p2##_type, class p3##_type, class p4##_type, class p5##_type, class p6##_type, class p7##_type, class p8##_type, class p9##_type&gt; auto name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, p9##_type p9, int arg0)"/>
</def>
40 changes: 40 additions & 0 deletions test/cfg/googletest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,46 @@ namespace ExampleNamespace {
}
}

namespace ActionNamespace {
int x;
// cppcheck-suppress autoNoType
ACTION(ExampleAction)
{
return x;
}

int y;
// cppcheck-suppress autoNoType
ACTION_P(ExampleActionP, p)
{
return p + y;
}

int z;
// cppcheck-suppress autoNoType
ACTION_P3(ExampleActionP3, p0, p1, p2)
{
return p0 + p1 + p2 + z;
}
}

namespace {
int w;
// cppcheck-suppress autoNoType
ACTION_P2(ExampleActionP2, p0, p1)
{
return p0 + p1 + w;
}
}

// cppcheck-suppress autoNoType
ACTION(ExampleActionNullPointer)
{
int *p = 0;
// cppcheck-suppress nullPointer
return *p;
}

TEST(ASSERT, ASSERT)
{
int *a = (int*)calloc(10,sizeof(int)); // cppcheck-suppress cstyleCast
Expand Down
Loading