incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: test for lib.string.swap
Date Tue, 16 May 2006 14:51:43 GMT
Martin, I added several test cases to verify the swap with temporary
string and committed the test:
http://svn.apache.org/viewcvs?rev=406940&view=rev

I plan to enhance the test to exercise the function with unequal
allocators.

With best wishes,
Anton Pevtsov

-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Tuesday, May 16, 2006 05:36
To: stdcxx-dev@incubator.apache.org
Subject: Re: test for lib.string.swap


Anton Pevtsov wrote:
> The test for lib.string.swap and required changes to the 
> 21.strings.h/cpp are here: 
> http://people.apache.org/~antonp/stdcxx05152006/

This is okay for now, btw., please go ahead and commit it. We do need to
enhance the test to exercise the common idiom used to shrink a string
object to 0 capacity:

     {
         std::string s ("...");
         assert (0 < s.capacity ());

         std::string ().swap (s);
         assert (0 == s.capacity ());
     }
     // check for memory leaks

I think the cases might already be there, I'm just not sure
I see where we check the capacity or for memory leaks.

In addition, when UserAlloc is ready for prime time, we need
to remember to enhance the test to exercise the function with unequal
allocators.

Martin

Mime
View raw message