sebor@apache.org wrote:
> Author: sebor
> Date: Thu May 18 18:41:46 2006
> New Revision: 407684
Anton, the most important bit here enables the exception safety
tests for all test cases (except those that test other exceptions
such as out_of_range). I'd like to do the same in the rest of the
tests as well.
The SharedAlloc bits don't do anything yet, but they're a start.
I'm also thinking about exercising length_error in a similar way
as bad_alloc with UserAlloc, i.e., inducing the error by setting
max_size() to a value less than the expected size of the result
string and then setting it to a greater value and letting the
function succeed.
Let me know your thoughts!
Martin
>
> URL: http://svn.apache.org/viewvc?rev=407684&view=rev
> Log:
> 2006-05-18 Martin Sebor <sebor@roguewave.com>
>
> * 21.string.replace.cpp (test cases): Changed the meaning of
> (tcase.bthrow == 0) to enable the testing of exception safety,
> and used -1 to disable.
> (Test, MemFun): Removed unused typedefs.
> (test_replace): Renamed throw_after to throw_count to better
> reflect the purpose of the variable.
> Simplified the conditional computing the expected exception.
> Set UserAlloc::allocate() to throw bad_alloc analogously to
> operator new.
> Exercised exception safety in each test case by default (i.e.,
> when tcase.bthrow == 0).
|