chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
I try to use Isolator++ since in my opinion, it has the best and easiest faking possibilities.
I tried with Microsoft C++ Unit Tests, where Isolator works fine, but I didn't get the C++/CLR Bridge to a C# assembgly working right now.
So I am trying with google-test, where Isolator++ behaves differently and I haven't figured out why.
WHEN_CALLED

_
cannot convert from int to whatever (const char*)

so I tried

ANY_VAL(const char*) // function does not take 0 arguements

and finally just a C-style cast

(const char*)(_)

WHEN_CALLED(::MyGlobalTrue((const char*)(_))).Return(false);

It compiles, however it fails with
********* Typemock Isolator++ Assert Exception *********

 - The function 'MyGlobalTrueNoArgs' information cannot be found by Isolator++. Making the application's PDB accessible to Isolator++ will usually solve this problem. If the PDB's and the dll's are not in the same folder you can set the environment variable IPP_PDB_PATH to the path of the PDB's.You can set several folders separate with semicolon like this: set IPP_PDB_PATH="C:\Symbols;C:\Windows\Symbols"Otherwise please use FAKE_GLOBAL(MyGlobalTrueNoArgs) macro to make the function visible to Isolator++.To verify that the PDB is generated, please go to project settings->Linker->Debugging and set 'Generate Debug Info' to 'Yes'.Also make sure that in C++->General 'Debug Information Format' is set to 'Program Database'

**************************************

The PDB is in the folder and I also tried setting IPP_PDB_PATH.
The project in use can be found here:

https://github.com/relascope/TestingCppClrCs

Thanks for suggestions.
asked by relascope (600 points)

1 Answer

0 votes

Hi relascope,

Thanks for reaching out, I am sorry for what you are experiencing.
I was able to reproduce the issues, but i dont quite understand what you trying to 
achieve.
can you please explain to me what exactly does the code do?
This will help us understand what you are trying to achieve.


Cheers,
Naor Abudi
Typemock support team

answered by Naor_Typemock (1.6k points)
The repository is just for testing testing frameworks. So, there is no actual "achievement" of the code, besides testing testing strategies.
We somehow want to use Typemocks Isolator++, which is not possible with a recent version of google-test, what the repository shows.
Mocking doesn't really work as expected.
On the other hand, it works with Microsofts C++ testing framework.
Which has problems loading C# assemblies (at least without the modification in the last commit, using a custom Assembly Resolve function).
The question is, why Isolator++, behaves differently with google-test and Microsoft C++ Tests. (I didn't have time to investigate compile-flags...)

We are at the very beginning of integrating a UnitTest Framework, so it seems we will try to use Microsoft's C++ Testing Framework for the actual project.

Hi Relascope,

Sorry for the late response.
We were able to reproduce the issue and we are looking into it.
So far I can say that the issue with Google Test is not related to the latest version as we checked and we support the latest version of google test.

We want to move this issue to our premium ticket portal, before we do that we wanted to know if the issue is still relevant?

Please keep us posted.
Cheers,
Alon Sapozhnikov.
Support Specialist.

Yes it it still relevant, and I think other customers want to use google-test as well.

Hi,

I will open a premium ticket for you and add all the information you provided.
We will continue our support in the premium portal so we could have a better platform to share files and etc...

Once we will fix the issue I will update this QA.

Cheers,
Alon Sapozhnikov.
Support Speciailst.

...