Boost logo

Boost Users :

Subject: Re: [Boost-users] [unit test] problem inside boost UTF
From: Bruno Belarte (bruno.belarte_at_[hidden])
Date: 2011-04-05 04:11:41


On 04/04/2011 23:07, Richard wrote:
> Aside from checking for undefined behavior at Steven mentioned, you
> might want to check that each unit test case is completely independent
> of other test cases: no static data, no shared globals, etc. This
> pattern is called the "Fresh Fixture" pattern:
> <http://xunitpatterns.com/Fresh%20Fixture.html>
>
> You may also find it useful to read through my 5-part tutorial on
> doing test-driven development in C++ with Boost.Test:
> <http://legalizeadulthood.wordpress.com/2009/07/04/c-unit-tests-with-boost-test-part-1/>
> <http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-test-part-2/>
> <http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-test-part-3/>
> <http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-test-part-4/>
> <http://legalizeadulthood.wordpress.com/2009/07/05/c-unit-tests-with-boost-test-part-5/>

Thanks for your answer Richard. I already have read your tutorial.

I wrote my classes to be self sufficient, so they don't access any
global or shared memory.
In my test suite, I use fixture and all I set during the set-up is a
data structure (the one I want to test) and some stuff to fill the data
structure (int and std::string, no pointers), so the fixture do not
share anything (except if boost's smart pointers or BGL has some memory
issues, but I really doubt it :)

But again, the weird part is when I call Tree's template member function
(template on iterators), Graph's tests that previously passed now failed
(some values are not in the right place, like if they were add in the
wrong order).

Anyway, thanks for your help.

Bruno


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