Boost logo

Boost Users :

From: Duane Murphy (duanemurphy_at_[hidden])
Date: 2003-08-30 11:30:03


--- At Sat, 30 Aug 2003 00:47:01 +0000, Gennadiy E. Rozental wrote:

>--- In Boost-Users_at_[hidden], "Duane Murphy" <duanemurphy_at_m...>
>wrote:
>> --- At Fri, 29 Aug 2003 11:02:51 +0200, Anders Moe wrote:
>>
>> >Hi again and thanks for your reply.
>> >
>> >
>> >If I understand you correctly you suggest using the ctor/dtor in
>the
>> >class-test-case to do the job of build_up/tear_down. I suppose
>that would be
>> >equivalent to setup/teardown. This works, ofcourse, because a C++
>> >programmer can rely on the dtor being executed, unlike the Java
>finalizer.
>>
>> Having worked some with CppUnit, I have wondered similarly.
>
>Did you try to use Boost.Test? Any comparison?

I have not had a chance to try Boost.Test. It's on our list of things to
try, but we have a time and code investment in CppUnit already.

>> It's hard to
>> judge when a particular "feature" is put in to work around
>limitations or
>> differences in the language. When I studied JUnit, I didnt fully
>grasp
>> the need for setUp and tearDown. This explaination makes some
>sense.
>
>Do you mean, that in C++ we do not need explicit teardown and buildup?

I need to look at this a little more. setUp and tearDown are called
before and after each test. I dont know how this could be simulated with
constructors or member variables.

Conceptually a fixture establishes a known good test environment for the
test independent of all previous tests. That is each unit test should be
seperate and independent. setUp and tearDown in Fixtures was designed to
establish this environment.

I would need to study Boost.Test more to understand how this might be
made possible.

>> The
>> equivalent is simply member variables or something similar in C++.
>
>I did not get this. An equivalent to what?

Equivalent to setUp and tearDown.

 ...Duane


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