Git Product home page Git Product logo

cppfreemock's People

Contributors

gzc9047 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cppfreemock's Issues

Is there one version to support windows?

I am adding gtests for our codes and found your way that may be used. But you said you had tested it only on mac. Is there one version to support windows? We are now using VS2015 update3.

Thanks.

Compiling fails with error " invalid initialization of non-const reference of type ‘testing::internal::MockSpec.."

Hello,
I am trying to run the example present in "https://github.com/gzc9047/CppFreeMock/tree/master/example".

I am using google test release version - googletest-release-1.8.1

Steps performed:
1.)Download the "CppFreeMock" repository and placed it on my SUT
2.)Navigated to Examples folder and modified the Makefile to update paths to my libraries and include files as follows:

TMPDIR=..
PROJECT_ROOT=..
GMOCK_LIB = -L/opt/gtest/lib
GMOCK_INCLUDE = -I/opt/gtest/include -I/usr/include/gtest/ -I/usr/include/gmock/ -I$(PROJECT_ROOT)

3.)Executed make as below:

[root@SUT example]# make all
g++ -g -O0 -std=c++11 -fno-inline -falign-functions=32 test_member_function.cpp -I/opt/gtest/include -I/usr/include/gtest/ -I/usr/include/gmock/ -I.. -L/opt/gtest/lib -o ../test_member_function.out
In file included from ../impl.h:12:0,
                 from ../internal_macro.h:11,
                 from ../cpp_free_mock.h:12,
                 from test_member_function.cpp:16:
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = std::basic_string<char>; P = {const void*}]’:
test_member_function.cpp:102:5:   required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*)>&’ from an rvalue of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*)>’
         return gmocker.With(p ...);
                                  ^
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = std::basic_string<char>; P = {const void*, bool, char, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’:
test_member_function.cpp:114:5:   required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*, bool, char, int, std::basic_string<char>, const std::basic_string<char>&)>&’ from an rvalue of type ‘testing::internal::MockSpec<std::basic_string<char>(const void*, bool, char, int, std::basic_string<char>, const std::basic_string<char>&)>’
../cpp11/impl.h: In instantiation of ‘testing::internal::MockSpec<R(P ...)>& CppFreeMock::MockerBase<R(P ...)>::gmock_CppFreeMockStubFunction(const testing::Matcher<P>& ...) [with R = int; P = {const void*, bool&, char&, int&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’:
test_member_function.cpp:136:5:   required from here
../cpp11/impl.h:77:34: error: invalid initialization of non-const reference of type ‘testing::internal::MockSpec<int(const void*, bool&, char&, int&, std::basic_string<char>&, const std::basic_string<char>&)>&’ from an rvalue of type ‘testing::internal::MockSpec<int(const void*, bool&, char&, int&, std::basic_string<char>&, const std::basic_string<char>&)>’
make: *** [test_member_function] Error 1

Not sure what I am missing..
Any guidance on same will be helpful..

Compile error

cpp11/impl.h:77:34: error: cannot bind non-const lvalue reference of type ‘testing::internal::MockSpec<std::__cxx11::basic_string()>&’ to an rvalue of type ‘testing::internal::MockSpec<std::__cxx11::basic_string()>’
return gmocker.With(p ...);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.