because the following virtual functions are pure within '::utility::mock::MockObserver<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, ::utility::log::LogLevel>':
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Mocking Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googlemock+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/googlemock/93b7f5ed-eb87-4926-a68c-af6c55d510ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
using TypedSubject = SubjectInterface<ArgTypes...>;
MOCK_METHOD1_T(onAdd, void(TypedSubject &subject));
MOCK_METHOD2_T(onNotify, void(TypedSubject &subject, ArgTypes... args));
MOCK_METHOD1_T(onRemove, void(TypedSubject &subject));
unfortunately that didn't change anything either :(
Do you mean like that?:using TypedSubject = SubjectInterface<ArgTypes...>;
MOCK_METHOD1_T(onAdd, void(TypedSubject &subject));
MOCK_METHOD2_T(onNotify, void(TypedSubject &subject, ArgTypes... args));
MOCK_METHOD1_T(onRemove, void(TypedSubject &subject));
unfortunately that didn't change anything either :(
Am Mittwoch, 21. Mai 2014 15:24:25 UTC+2 schrieb Billy Donahue:To help troubleshoot this, try using a typedef inside MockObserver:using TypedSubject = SubjectInterface<ArgTypes...>;On Wed, May 21, 2014 at 9:14 AM, Robotic Brain <roboti...@googlemail.com> wrote:Hi,I have this code: http://pastebin.com/LGK1F5LaFor some reason I cannot Instantiate MockObserver<std::string, LogLevel> because it is abstract?Error: cannot declare variable 'logOut' to be of abstract type '::utility::mock::MockObserver<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, ::utility::log::LogLevel>'because the following virtual functions are pure within '::utility::mock::MockObserver<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, ::utility::log::LogLevel>':
Instantiating MockObserver<std::string> however works.I have the suspicion that there is something wrong with my variadic templates or worse, my compiler is bugged (MacPorts gcc 4.8.20)Does someone know what is going wrong?Tanks in advance--To unsubscribe from this group and stop receiving emails from it, send an email to googlemock+...@googlegroups.com.
---
You received this message because you are subscribed to the Google Groups "Google C++ Mocking Framework" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/googlemock/93b7f5ed-eb87-4926-a68c-af6c55d510ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Mocking Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googlemock+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/googlemock/d9f1a892-88f6-4acb-8047-64dab634ad33%40googlegroups.com.
I got it working!
gmock doesn't seem to like variadic templates at all :(
The first use works fine since it just expands to a normal type, but the 2nd use expands to multiple arguments as if you had copy&past-ed them in there...
is there a way to prameterize the argument number of MOCK_METHOD ?
if that's not possible i would have to define the mock class everywhere i want to use it and can't extract it into a header
namespace {
template<typename... ArgTypes>
class MockObserver : public ObserverInterface<ArgTypes...> {
public:
MOCK_METHOD1_T(onAdd, void(SubjectInterface<ArgTypes...> &subject));
MOCK_METHOD3_T(onNotify, void(SubjectInterface<ArgTypes...> &subject, ArgTypes... args));
^ --- changed 2 to 3 here
MOCK_METHOD1_T(onRemove, void(SubjectInterface<ArgTypes...> &subject));
};