c++ - Using wxString with Google Mock -


has out there had luck using google mock in conjunction wxwidgets? have class foo setters take const reference wxstring in signature so:

class foo { public:     foo();     virtual ~foo();     void setname(const wxstring& name); }; 

i proceed mock foo this:

class mockfoo : public foo {     mock_method1(setname, void(const wxstring& name)); }; 

my other mocks works fine there wxstring parameter doesn't like. when compile see following:

c:\gmock-1.6.0\gtest\include\gtest\internal\gtest-internal.h:890: error: conversion `const wxunichar' `long long int' ambiguous c:\wxwidgets-2.9.0\include\wx\unichar.h:74: note: candidates are: wxunichar::operator char() const c:\wxwidgets-2.9.0\include\wx\unichar.h:75: note:                 wxunichar::operator unsigned char() const //more potential candidates wxunichar follow after 

the jist google mock cannot determine operator() function call since operator() functions provided wxunichar not map google mock expects. seeing error 'long long int' , 'testing::internal::biggestint' conversions.

this must consequence of using proxy class, wxunicharref, result type of wxstring::operator[]() (see "traps unwary" section of wxstring documentation more details), i'm not sure come there doesn't seem code accessing wxstring characters here. @ line 890 of gtest-internal.h?

also, you're using const reference wxstring, code doesn't. don't think it's relevant question it's confusing have discrepancy between description , code snippets...


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -