mock_api: Only mock methods with less than 10 arguments

GoogleMock only handles up to 10 arguments, but functions this big
probably won't be used in mocked tests so we can just skip them.
This commit is contained in:
Corentin Wallez 2017-05-09 16:56:10 +02:00 committed by Corentin Wallez
parent 060f254468
commit a2d4d14bd4
2 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@
namespace {
{% for type in by_category["object"] %}
{% for method in native_methods(type) %}
{% for method in native_methods(type) if len(method.arguments) < 10 %}
{{as_cType(method.return_type.name)}} Forward{{as_MethodSuffix(type.name, method.name)}}(
{{-as_cType(type.name)}} self
{%- for arg in method.arguments -%}
@ -45,7 +45,7 @@ void ProcTableAsClass::GetProcTableAndDevice(nxtProcTable* table, nxtDevice* dev
*device = GetNewDevice();
{% for type in by_category["object"] %}
{% for method in native_methods(type) %}
{% for method in native_methods(type) if len(method.arguments) < 10 %}
table->{{as_varName(type.name, method.name)}} = reinterpret_cast<{{as_cProc(type.name, method.name)}}>(Forward{{as_MethodSuffix(type.name, method.name)}});
{% endfor %}
{% endfor %}

View File

@ -29,7 +29,7 @@ class ProcTableAsClass {
{% endfor %}
{% for type in by_category["object"] %}
{% for method in native_methods(type) %}
{% for method in native_methods(type) if len(method.arguments) < 10 %}
virtual {{as_cType(method.return_type.name)}} {{as_MethodSuffix(type.name, method.name)}}(
{{-as_cType(type.name)}} {{as_varName(type.name)}}
{%- for arg in method.arguments -%}
@ -47,7 +47,7 @@ class ProcTableAsClass {
class MockProcTable : public ProcTableAsClass {
public:
{% for type in by_category["object"] %}
{% for method in native_methods(type) %}
{% for method in native_methods(type) if len(method.arguments) < 10 %}
MOCK_METHOD{{len(method.arguments) + 1}}(
{{-as_MethodSuffix(type.name, method.name)}},
{{as_cType(method.return_type.name)}}(