Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ wrapper and mock for gtest #261

Open
HannaKraft opened this issue Aug 19, 2019 · 2 comments
Open

C++ wrapper and mock for gtest #261

HannaKraft opened this issue Aug 19, 2019 · 2 comments

Comments

@HannaKraft
Copy link

Hi all.
I have been using the C client for a C++ project and have written a C++ wrapper and mocked the wrapper functions using Google Test. I was wondering if my patch can be included in the Nats.c repository so I will create a pull request for it?

Regards,

Hanna

@kozlovic
Copy link
Member

@HannaKraft Not sure what you are asking here. The NATS C client is already including the proper macro to be useable by C++ applications (actually I suspect most of users using this lib use it in the context of C++). So I am not sure what your PR would be about.

@danesh-d
Copy link
Contributor

I think what Hanna means is that she has created a C++ wrapper to make NATS more suitable to be called in C++. The wrapper should be quite simple as it sounds. Using it the users should be able to create a class and use C++ types i.e. std::string to invoke NATS functions, but what is more important is that using this wrapper NATS will be testable using 3rd party test platforms e.g. gtest and it will be possible to mock NATS routines and trace back functions calls and stub the functions to simulate behavior in different situations. Today the test program utilizes some internal routines i.e. test, testCond, etc. Using gtest it will be possible to stub, mock, keep track of function calls under different circumstances, and of course verify the results in more robust way and this wrapper makes it possible or at least easier to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants