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
Hi all,

i am using a method that returns a CString. I am not able to set the Return value for that method using WHEN_CALLED.

Here is the sample code:
#include"stdafx.h"
#include <Isolator.h>
#include "gtest/gtest.h"

class CIniFileStub
{
public:

CString GetValueTest1()
{
return "Test1";
}
};

class SampleTesting : public ::testing::Test
{
public:
virtual void TearDown()
{
ISOLATOR_CLEANUP();
}
};

TEST_F(SampleTesting,test1)
{
CIniFileStub * fakeIniFile=FAKE<CIniFileStub>();
CString param1("GeneralInformation");
WHEN_CALLED(fakeIniFile->GetValueTest1()).ReturnPtr(&param1);
CString temp=fakeIniFile->GetValueTest1();
}

This gives an SEH exception .The exact error is:
SEH exception with code 0x0000005 thrown in the test body.
Please help.
Thanks in advance!!
asked by manneni392 (6.3k points)

3 Answers

0 votes
Hi Manneni,

We too encountered an exception while running a repro based on your code but we have a different exception.
We still are not sure regarding what caused it, but this is probably a bug.
One more thing, which version do you currently use?
answered by alex (18k points)
0 votes
Hi Alex,

I'm using the 1.1.0.6 version.

--Ravi
answered by manneni392 (6.3k points)
0 votes
Hi Ravi,

We fixed the issue.
I sent you a mail with a link to download the patch please try it and let me know if it solves the problem.
answered by ohad (35.5k points)
...