gmock does not support rvalue reference as parameter of mocked function (issue report).
For example the following code will not compile:
MOCK_METHOD1(foo,void(std::string&&));
I can’t find information on when gmock will add support to this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I figured out a workaround: use a non-mocked function
foo(std::string&& s){foo_rvr(s)}to relay the function to a mocked functionfoo_rvr(std::string). Here is the complete program.