Skip to content

Problem with generating mocks for templates. #1

@lgromanowski

Description

@lgromanowski

Hi,
at first thanks for cool gmock generator it's really useful! I found that generator has problems with generating mocks for templates, ie:

#ifndef FOO_H
#define FOO_H

template < class F >
struct Foo
{
  virtual ~Foo() {}
  virtual void bar(F* f = nullptr) = 0;
};


struct Baz
{
  template < class T >  void baz(T* t = nullptr)
  {
  }
};

class Generated
{
  virtual void generated(void* p = nullptr) = 0;
};

#endif /* FOO_H */

becomes:

#include <gmock/gmock.h>
#include "foo.h"

struct GeneratedMock : public Generated
{
    MOCK_METHOD1(generated, void(void *));
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions