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
in this code all the functions are mocked but the Template function throws an exception. Please assist 
auto fakeDataBlk = FAKE_ALL<sjm::Parameters::DataBlock>(CallOriginal);
ISOLATOR_INVOKE_CONSTRUCTOR(fakeDataBlk);
WHEN_CALLED(fakeDataBlk->getInterval()).Return(BY_VAL(timeInterval));
WHEN_CALLED((fakeDataBlk->getData<AM_MAGNETIC>())).Return(BY_VAL(magData._rawData));
WHEN_CALLED(fakeDataBlk->getStride()).Return(magData._stride);
asked by calebxyz (1.1k points)

1 Answer

0 votes

Hi calebxyz,

It's hard for us to help you without seeing the function you are trying to mock, the code and the error message.

In the following link you will see our documentation that contains an explanation on faking a template and more.

https://www.typemock.com/docs/?book=Ipp&page=faking_templates.htm

If you are still having issues, contact us for further assistant.

Cheers,
Alon Sapozhnikov | Support Team 
 typemock-logo.png
 
answered by Alon_TypeMock (8.9k points)
HI Alon.

I cannot show the code of that function here but the error i get is

nknown location(0): fatal error: in "MagneticIsolator_Test/TimerEventCase1": memory access violation at address: 0x00000000: no mapping at fault address

just when i try to use the templated function , other functions from that class work fine.

i have read the content of the link and im familiar with it but it only shows you how to fake classes and not template functions.

Hi calebxyz,

I understand why it's not possible to show code in here.

Please open a ticket in our ticket portal (see in premium support) so we can further assist you on all of your issues integrating Typemock Isolator++.

In the ticket, please add all the relevant issues and information.

Cheers,
Alon Sapozhnikov | Support Team 
 typemock-logo.png

...