Isolator++ 1.1 Released

Time for another release, And this one, has a few power punches. With the newly Introduced RET macro, Isolator can now fake a ref argument, actually returning it as the method returns.

So if you have this method to test:

bool PricingManager::IsExpired()
{
SYSTEMTIME now;

::GetSystemTime(&now);

if
(now.wYear > 2010)
return true
;
return false;
}

And that GetSystemTime needs to return your custom value, here’s your test:

TEST_F(IsolatorPPTests, IsExpired_YearIs2011_ReturnTrue)
{
PricingManager manager;
SYSTEMTIME fakeTime;
fakeTime.wYear = 2011;

FAKE_GLOBAL(GetSystemTime);
WHEN_CALLED(GetSystemTime(RET(&fakeTime))).Ignore();

ASSERT_TRUE(manager.IsExpired());
}

Isn’t that cool? 

We’ve also done away with the “begin_testable.h” and “end_testable.h” files. With the new engine identifying types using the PDB file, there’s now no need to change your production code in order to make it testable.

I’ll say it again: Isolator++ can now fake every class, without you touching your production code.

The PDB exploration allows us to get rid of the FAKE_GLOBAL for global methods declared in the project. Global system methods, like GetSystemTime, still require the FAKE_GLOBAL declaration. And we’ve had some bug fixes, making 1.1 more stable.

Download Isolator++!

Gil Zilberfeld

TOP