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
Products
Isolator for C++
Isolate ++
Isolator for .NET
Suggest
Isolate
Smart Runner
Coverage – Part of Typemock Isolator Complete .NET
Isolator for Build Server
Download
C++
.NET
Pricing
Resources
Documentation
Isolator++
Isolator
Learning Center
Tutorials
Webinars
Articles
Case Studies
Partners
Blog
Support
C++ Community
.NET Community
Premium Support
Products
Isolator for C++
Isolate ++
Isolator for .NET
Suggest
Isolate
Smart Runner
Coverage – Part of Typemock Isolator Complete .NET
Isolator for Build Server
Download
C++
.NET
Pricing
Resources
Documentation
Isolator++
Isolator
Learning Center
Tutorials
Webinars
Articles
Case Studies
Partners
Blog
Support
C++ Community
.NET Community
Premium Support
Menu
Search
Remember
Register
Typemock Q&A
Ask a question
All Activity
Questions
Hot!
Unanswered
Tags
Users
Ask a Question
The Unit Testing Company
Development Resources
Knowledge Base
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
Related questions
Mocking (C#) a COM interop method that returns SafeArray
How can I test that an internal property was set with a specific value during a method call
Help to mock method with no return value w/ Mock/MockObject?
cannot mock a method that returns a bidimensional array
Issue with firing an event for an interface that has two Eventhandlers of the same name
Issue with return value of a method that returns CString
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(¶m1);
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
Jul 26, 2012
by
manneni392
Report User
(
1.3k
points)
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
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
Jul 26, 2012
by
alex
Report User
(
17k
points)
Please
log in
or
register
to add a comment.
0
votes
Hi Alex,
I'm using the 1.1.0.6 version.
--Ravi
answered
Jul 27, 2012
by
manneni392
Report User
(
1.3k
points)
Please
log in
or
register
to add a comment.
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
Aug 1, 2012
by
ohad
Report User
(
35.4k
points)
Unable to Mock functions returning CString in C++
Please
log in
or
register
to add a comment.
...
×
Choose the product type:
WINDOWS
LINUX DEB
LINUX RMP
×