Awesome I'm glad to hear you got np_mock() to work for you. For non-public methods the right thing to do would be np_mock_by_name() but that probably won't handle actual C++ method signatures. You might be able to pass the mangled name. I haven't tried. On Sat, Oct 14, 2017 at 12:50 Rohith Jayakumar rojayaku@users.sf.net wrote: Hi Greg, Thanks for the suggestion, by providing the address of the functions prefixed with the class name scope resolution operator, i was able to mock the public function....
Hi Greg, Thanks for the suggestion, by providing the address of the functions prefixed with the class name scope resolution operator, i was able to mock the public function. This was using np_mock function, but still i am unable to use "mock_" function signature to mock the class functions. For now this solution has solved the issue for all the public class member functions but still i am trying to see how we can mock a private or protected method. Thanks & Regards RJ
Without seeeing an actual test case, here's what I think is going on. The first argument to np_mock() needs to be the address of withinAAAMethod(). Instead you're calling the method and passing its return value. Your compiler is not complaining because np_mock() is actually a macro which casts its first argument thus defeating type checking. On Thu, Oct 12, 2017 at 03:38 Rohith Jayakumar rojayaku@users.sf.net wrote: Hi Greg, Thanks for your response. I tried mocking one of the member functions which...
Hi Greg, Thanks for your response. I tried mocking one of the member functions which is not virtual, by using np_mock() and also by separately writing a mock_ function, but it is unable to call the mocked function. Here is how my example looks like: I have the files AAA.hxx and AAA.cpp, which has the template class within which there is a method which i am testing i.e., AAAmethod(), this method inturn calls withinAAAmethod() which i am trying to mock. So inorder to call the method AAAmethod() within...
Hi Greg, Thanks for your response. I tried mocking one of the member functions which is not virtual, by using np_mock() and also by separately writing a mock_ function, but it is unable to call the mocked function. Here is how my example looks like: I have the files AAA.hxx and AAA.cpp, which has the template class within which there is a method which i am testing i.e., AAAmethod(), this method inturn calls withinAAAmethod() which i am trying to mock. So inorder to call the method AAAmethod() within...
Hi Greg, Thanks for your response. I tried mocking one of the member functions which is not virtual, by using np_mock() and also by separately writing a mock_ function, but it is unable to call the mocked function. Here is how my example looks like: I have the files AAA.hxx and AAA.cpp, which has the template class within which there is a method which i am testing i.e., AAAmethod(), this method inturn calls withinAAAmethod() which i am trying to mock. So inorder to call the method AAAmethod() within...
Hi Greg, Thanks for your response. I tried mocking one of the member functions which is not virtual, by using np_mock(), but it is not possible, i am hitting the below error: Here is how my example looks like: I have the files AAA.hxx and AAA.cpp, which has the template class within which there is a method which i am testing i.e., AAAmethod(), this method inturn calls withinAAAmethod() which i am trying to mock. So inorder to call the method AAAmethod() within the class AAA, i have the files Access_AAA.hpp...
Hi RJ, Thanks for looking into NovaProva. To answer your questions: On 11 October 2017 at 06:01, Rohith Jayakumar rojayaku@users.sf.net wrote: Hi, I am working on a C++ project and in need of performing unit testing for my C++ class member functions using NovaProva, could you please let me know if there are sample examples on how we can use NovaProva for testing C++ class functions I haven't written any such examples. If there were examples they would be very similar to the C examples, particularly...
Hi, I am working on a C++ project and in need of performing unit testing for my C++ class member functions using NovaProva, could you please let me know if there are sample examples on how we can use NovaProva for testing C++ class functions and also is there a way to mock the class function members using NovaProva. I have already gone through the examples for C, but not sure if there are any examples for C++, so any suggestions or references would be very helpful. Thanks RJ
G'day, The Mac OS X port of NovaProva is ready for folks to try it out. I've added...
For anyone looking at these issues, I believe all the issues listed in this discussion...
Sent from my iPhone On Aug 16, 2015, at 2:00, "Greig" greighamilton@users.sf.net...
...and to be clear, I'm eagerly awaiting your patch. On 16 August 2015 at 07:44,...
I've found the problem and will try to send a patch later this week. I've found a...
G'day, Nope, no internal documentation - sorry. I just pushed a commit for an error...
Last comment for now. I see it goes via the proxy listener before getting to the...
Okay I've done some more debugging and it's quite unusual what is happening. In runner_t::begin_job(job_t...
I've done a little debugging. In the working and non working case the code gets into...
The tests pass successfully on my PC but the way the build works for our test environment...
Curious. I would expect that to work. Does the tnmemleak regression test pass? How...
Hi, I've just added suppression support in our Novaprova build and I noticed that...
Oh, if I read all my pending email it seems you already worked that out :) Greg....
The procedure is on github, fork the novaprova/novaprova repo. This creates a repo...
I've got a small patch that should solve this issue. How do I go about pushing that...
G'day, Yes, I see that would be inconvenient :) I think the sensible thing would...
I have a few tests that test the failing case, during these tests a number of syslog...
It's good to know it's a problem with Novaprova and not something to do with my build...
G'day, I built a test case and it fails in exactly the way you describe. There's...
So let's see if I understand. Mocking a function in a shared library works if you...
Sent from my iPhone On Aug 5, 2015, at 21:38, "Greig" greighamilton@users.sf.net...
I still have the above issue but I now understand why I couldn't mock strcpy. I can...
Actually it looks like I was a bit premature with thinking I've succeeded. I've played...
Actually it looks like I was a bit premature with thinking I've succeeded. I've played...
Actually it looks like I was a bit premature with thinking I've succeeded. I've played...
Well I've made some progress and now seem to be able to successfully mock functions...
Ok, one step at least :) If install_intercept is being called then the mock is being...
Thanks for the suggestions. We're just developing in C. The library is being installed...
G'day, On 4 August 2015 at 21:56, Greig greighamilton@users.sf.net wrote: I've been...
I've been playing round with mocking functions again. I have a few tests where I...
Thanks for reading the docs :) On 1 August 2015 at 02:30, Greig greighamilton@users.sf.net...
I've had a read through the docs. It's heaps better than when I last read the Novaprova...
G'day, For the upcoming 1.4 release of NovaProva, I've written an expanded user manual....
Awesome! I should ask my boss about LCA :) Sent from my iPhone On Oct 14, 2014, at...
Hi Greg, Looks like you've nailed it! All the tests pass, and example1 works as expected....
G'day, I think I've fixed this problem, can you try the latest in git? On 25 September...
G'day, So that's a 64 bit executable and I don't currently have access to either...
Hi Greg, Here's a link to the attachment. Thanks for persisting with this. https...
G'day, On 21 September 2014 15:13, bonybrown bonybrown@users.sf.net wrote: Result...
Result of make check in tests/ === Running tests --- tnaequalfail.ee 2014-09-18 22:02:12.749414942...
G'day, So what happens when you do "make check" in the tests/ directory? Can you...
Hi, That did not help. What did help was adding -gdwarf-2 to the CFLAGS in the Makefile...
G'day, Ok, I think I know what's happened here. This crash happens when NP starts...
Bad news, I'm afraid. np now builds without error, but example1 fails with the following:...
G'day, On 8 September 2014 09:35, Greg Banks gnb@fmeh.org wrote: No worries. I'll...
G'day, No worries. I'll take a look later this week when I'm back from my trip. Greg....
Sorry, I'm unable to fix this right now, so I'm going to persist with the "-gdwarf-2"...
Just tried accepting any value from 2 to 4, but seems DWARF 4 won't work without...
G'day, On 7 September 2014 18:31, bonybrown bonybrown@users.sf.net wrote: Hi, I just...
Hi, I just built novaprova from git, on ubuntu 14.04, x86_64, gcc 4.8.2, and found...
G'day, I'm pleased to announce that binary packages of NovaProva for multiple Linux...