This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

shared_ptr tests (was Re: [v3 patch] Add std::tr1::shared_ptr)


On Mon, Feb 21, 2005 at 11:12:51AM -0600, Benjamin Kosnik wrote:

> > I have modified the relevant Boost tests to use the std::tr1::shared_ptr
> > instead of boost::shared_ptr and run them successfully, but only on a
> > single processor machine.  The threaded tests should be run on as many
> > exotic multiprocessor machines as possible, as one of the major changes
> > I made to the classes was to use GCC's atomic ops instead of the
> > Boost.Threads library.  I can't commit those tests but I'll make them
> > available to those who want them.
> 
> Can you post them after you check this in?

Modified versions of Boost smart_ptr regression test attached.  Not all
Boost tests are included, since some test scoped_ptr and other types
that aren't in TR1 and one test (collector_test.cpp) uses extra
debugging code that can be enabled in the shared_ptr class, but which I
removed from the version I committed.

There's a little bash script to compile and run the tests, you'll need
to set some variables at the top of the file if you want to use it.
You'll need to have the Boost headers.

The file shared_ptr_assign_fail.cpp is supposed to fail to compile
(Boost uses a _fail suffix to indicate an XFAIL.)

I get a compiler error for shared_ptr_alloc_test.cpp, which I also see
for the unaltered test using boost::shared_ptr so I don't think it's
anything I've done. It works with GCC 3.4, so I don't know if it's a bug
in 4.x or Boost.

We should try to get all these tests covered in the v3 testsuite
eventually.  I introduced a bug in the reference counting which I only
found by running these tests, as there are no weak_ptr tests in the v3
testsuite yet.

jon

-- 
"Any sufficiently advanced bug is indistinguishable from a feature"
	- Rich Kulawiec

Attachment: smart_ptr_tests.tar.gz
Description: application/tar-gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]