Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-12-20 13:42:46


----- Original Message -----
From: rogeeff <rogeeff_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, December 20, 2001 3:20 PM
Subject: [boost] Re: BCB5, the pimpl idiom bug and the new Unit Test
Framework

> --- In boost_at_y..., "Fernando Cacciola" <fcacciola_at_g...> wrote:
> >
> > ----- Original Message -----
> > From: rogeeff <rogeeff_at_m...>
> > To: <boost_at_y...>
> > Sent: Thursday, December 20, 2001 3:00 PM
> > Subject: [boost] Re: BCB5, the pimpl idiom bug and the new Unit Test
> > Framework
> >
> >
> > > --- In boost_at_y..., "Fernando Cacciola" <fcacciola_at_g...> wrote:
> > > > Hi!
> > > >
> > > > Incidentally, I was set today to the task of writing a new unit
> > > test for
> > > > some of my code.
> > > > I figured that it was a perfect opportunity to give the latest
> Unit
> > > Test
> > > > Framework a try.
> > > >
> > > > I created a BCB5 project so as to build up unit_test.dll (BTW,
> it
> > > really
> > > > needs a jamfile!)
> > > >
> > > > As soon as I tried to compile it, I stumbled across the BCB bug
> > > regarding
> > > > the pimpl idiom:
> > > >
> > >
> > > [...]
> > >
> > > >
> > > > Fernando Cacciola
> > > > Sierra s.r.l.
> > > > fcacciola_at_g...
> > > > www.gosierra.com
> > >
> > > See a latest update. I remove scoped_ptr from unit_test_main and
> it
> > > should work now with BCB5.
> > >
> > > Gennadiy.
> > >
> > I downloaded the latest sources this morning.
> > There are still places where pimpls are used:
> >
> > test_tools.hpp, class output_test_stream
> > unit_test_log.hpp, class unit_test_log
> >
> > etc...
> >
> > Fernando Cacciola
> > Sierra s.r.l.
> > fcacciola_at_g...
> > www.gosierra.com
>
> But I though that you would not have problems with them, cause
> objects containing pimpl's are accessed using pointers.
> Did you try to compile? Could you send me a compilation errors?
>
> Gennadiy.
>
>

#include <boost/test/unit_test.hpp>
using namespace boost::unit_test_framework;

void constructors_test()
{
}

test_suite*
init_unit_test_suite( int argc, char* argv[] )
{
  test_suite* test= BOOST_TEST_SUITE("const_string test");

  test->add( BOOST_TEST_CASE( &constructors_test ) );

  return test;
}

If I compile this without the updated scoped_ptr<>, I get:

utility.hpp (42) "undefined structure 'test_suite::Impl'

(inside checked_delete<>)

That is, test_suite uses pimpl.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk