Boost logo

Boost Users :

From: Pierre-Jules Tremblay (iamtrep_at_[hidden])
Date: 2006-04-12 14:15:39


Thanks for your reply.

It turns out that it was our static data (cough) doing those
allocations. But wrapping the BOOST_ tools is a good idea - I think
I'll implement it anyway.

Cheers,

Pierre

On 4/12/06, Gennadiy Rozental <gennadiy.rozental_at_[hidden]> wrote:
> Sorry, for delay response. I've been extremely busy lately.
>
> > We use Boost.Test extensively as our unit test framework. Recently,
> > we introduced some code to check for memory leaks. Each test case is
> > expected to release all the memory it allocates (i.e. fixtures and
> > what not). However, we observe that several of our test cases appear
> > to leak memory when in fact they don't. For instance, a memory leak
> > check when main() exits reveals no leaks, even though leaks were
> > "found" in several test cases. Our observation is that the apparent
> > leaks appear and disappear as we modify the test code.
> >
> > Scrutinizing the code has revealed that adding a BOOST_REQUIRE(true)
> > here and there in the problematic test cases can make this problem go
> > away. Is it at all possible that Boost.Test somehow allocates memory
> > during a test case run, say for logging or other purpose, and doesn't
> > release it before the test case ends?
>
> I found similar issues when designed exception safety testing facilities. I
> tried to minimize an amount of dynamically allocated memory with Boost.Test
> code. Also I am using guard that tell me when I enter/leave Boost.Test code
> and stop/start recording memory allocations. It's still not 100%
> bulletproof. It's possible that some static/global variables access from
> within test case may cause memory allocation. You will need to deal with it
> in case by case level.
> Try to wrap Boost.Test tools with your guards.
>
> Gennadiy
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net