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

When I call a private function with call by reference like below code,

I only get a empty value,

Please let me know how to properly pass an argument.

with Isolator++

// function

int Auth::getName(string& name)

{

    name = "hello";

    return 1;

}

// main

std::string passed = "hi";

int ret;

ISOLATOR_INVOKE_FUNCTION(ret, getName, passed);

ASSERT_EQ(passed, "hello");

passed is empty string

asked by karlchoe (600 points)

1 Answer

0 votes

Hi Karlchoe,

Thank you for reaching out.

Can you please try the next INVOKE command and instead of is now there:

ISOLATOR_INVODE_FUNCTION(ret, _, getName, passed)

Also, is the ret variable is "1" after the call?

Please keep me posted.

Cheers,

Alon Sapozhnikov.

Support Specialist.

answered by Alon_TypeMock (3.2k points)
...