At Typemock, we are always improving our unit testing tools. Several months ago, we released the first version of Isolator++, a mocking framework for C++ developers. Isolator++ has helped C++ programmers test even the most problematic bits of C or C++ code.
We have just released a new version, Isolator++ 1.1.0.3, that incorporates many fixes.
In addition to various bug fixes, the following features were added:
- Added API for faking out parameter – RET(outParam, sizeOfObject)
- Added GUI for the configuration form when entering your license key
If you haven’t yet tried out Isolator++, download Isolator++ 1.1.0.3 now and let us know what you think.
Learn more about Isolator++ and unit testing in C++.
1 |
<span class="lnum"> 1: </span>TEST_F(Tests, FakeOutParameterWithSize) |
1 |
<span class="lnum"> 2: </span>{ |
1 |
<span class="lnum"> 3: </span> ToFake* fake = FAKE<ToFake>(); |
1 |
<span class="lnum"> 4: </span> |
1 |
<span class="lnum"> 5: </span> <span class="kwrd">int</span> fakeBuf[] = {1,2,3}; |
1 |
<span class="lnum"> 6: </span> <span class="kwrd">int</span> size = <span class="kwrd">sizeof</span>(fakeBuf); |
1 |
<span class="lnum"> 7: </span> |
1 |
<span class="lnum"> 8: </span> WHEN_CALLED(fake->Foo( RET(fakeBuf, size) )); |
1 |
<span class="lnum"> 9: </span> |
1 |
<span class="lnum"> 10: </span> <span class="kwrd">int</span> arr[3]; |
1 |
<span class="lnum"> 11: </span> fake->Foo(arr); |
1 |
<span class="lnum"> 12: </span> ASSERT_EQ(arr[0], 1); |
1 |
<span class="lnum"> 13: </span> ASSERT_EQ(arr[1], 2); |
1 |
<span class="lnum"> 14: </span> ASSERT_EQ(arr[2], 3); |
1 |
<span class="lnum"> 15: </span>} |
1 |
<span class="lnum"> 16: </span> |