You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Liviu Nicoara <ni...@roguewave.com> on 2006/02/06 22:36:08 UTC

23.deque.iterators.cpp

I have attached the converted test in subject line.

The explanatory pieces of text accompanying the assertions are in
certain [few] cases kind of silly.

Liviu

Re: 23.deque.iterators.cpp

Posted by Martin Sebor <se...@roguewave.com>.
Liviu Nicoara wrote:
> I have attached the converted test in subject line.

Great, thanks! I made a few changes and committed it here:
http://svn.apache.org/viewcvs.cgi?rev=375703&view=rev
> 
> The explanatory pieces of text accompanying the assertions are in
> certain [few] cases kind of silly.

You mean the "Expected value..." stuff? Well, yes. That's probably
one of the reasons why the original test used plain assert() rather
than something more sophisticated. All that matters here is that
the test pass. A single failure is just as bad and the whole test
failing since it indicates an inconsistency in the container, and
in that case the actual values the iterator returns probably won't
make any sense anyway. I didn't see the test yesterday when you
asked what to do with the assertions otherwise I could have saved
you the time adding all this stuff. Sorry about that.

One more comment below:


[...]
> #ifndef _RWSTD_NO_REPLACEABLE_NEW_DELETE
>    // disabled for compilers that can't reliably replace the operators
> 
>    // replace operators new and delete with versions that invalidate
>    // storage to detect problems due to deque iterators accessing
>    // uninitialized pointers
> #  define DEFINE_REPLACEMENT_NEW_AND_DELETE

This doesn't do anything. We need to #include <rw_new.h> to get the
replacement operators.

> #endif   // _RWSTD_NO_REPLACEABLE_NEW_DELETE

Martin