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'm trying to use Isolator++ to unit test some CPP code I wrote. My company is a little weird in that we don't have a working debug configuration for our CPP DLLs. We do everything in release mode w/ optimization turned off.

Can I comment out the lines in IsolatorInternals here?
#if !defined(DEBUG) && !defined(_DEBUG)
#error Typemock I++ is intended for DEBUG builds only

Also, I'm trying to fake CFileFind like so:
   CFileFind *fakeFind = FAKE_ALL<CFileFind>();


and I get this error:

C:Program Files (x86)TypemockIsolator++includeForTestsIsolator.h(376) : error C2027: use of undefined type 'type_info'
        predefined C++ types (compiler internal)(126) : see declaration of 'type_info'
        .ConnectorDiscoveryEngineTests.cpp(27) : see reference to function template instantiation 'T *FAKE_ALL<CFileFind>(UINT)' being compiled
C:Program Files (x86)TypemockIsolator++includeForTestsIsolator.h(376) : error C2228: left of '.name' must have class/struct/union

Any ideas?
asked by sorakiu (4.2k points)

1 Answer

0 votes
Most of the chances are that Isolator++ will not work in release mode.
Even with generated pdb the optimizer do will inline methods calls which will prevent from the Isolator to work correctly.

As for the error you get, please make sure that rtti is enabled in the project.
To do that right click on the project and than go to
Properties -> C/C++ -> Language -> Enable run-time type information
and choose Yes.

Hope it helps.
answered by ohad (35.4k points)