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: Re: svn commit: r396754 - /incubator/stdcxx/trunk/tests/strings/21.string.append.cpp
Date Tue, 25 Apr 2006 15:09:37 GMT
Martin, I updated tests for append, assign, insert and replace using
your last changes.
The difference files are attached (difference to replace will go
separately).
I added #include <new> for cases when _RWSTD_NO_REPLACEABLE_NEW_DELETE
is not defined.

Regarding to assertion in the append test: it was a typo bug in the test
cases array, now it is fixed.
In previous versions the res string wasn't be used in exception safety
test, so the were no assertions.

Here is the change log:

2006-04-25  Anton Pevtsov <antonp@moscow.vdiweb.com>
 
    * 21.string.append.cpp (range_test_cases): Bug in test case
    description fixed.
    (test_append_range): Typo bug fixed.
    *  21.string.assign.cpp  (exceptions): Added elements and
    renamed from exp_exceptions for clarity.
    (test_exceptions): Merged the body of the function into the
    test_assign function and removed the declaration of the former.
    (test_assign): Exercised both the function exception safety
    and the behavior of the function under normal conditions.
    *  21.string.insert.cpp: Same


Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com]
Sent: Tuesday, April 25, 2006 05:47
To: stdcxx-dev@incubator.apache.org
Subject: Re: svn commit: r396754 -
/incubator/stdcxx/trunk/tests/strings/21.string.append.cpp


sebor@apache.org wrote:

 >> Author: sebor
 >> Date: Mon Apr 24 18:32:10 2006
 >> New Revision: 396754
 >>
 >> URL: http://svn.apache.org/viewcvs?rev=396754&view=rev
 >> Log:
 >> 2006-04-24  Martin Sebor  <sebor@roguewave.com>
 >>
 >>     * 21.string.append.cpp (exceptions): Added elements and renamed
 >>     from exp_exceptions for clarity.
 >>     (test_exceptions): Merged the body of the function into the
 >>     test_append function and removed the declaration of the former.
 >>     (test_append_range): Constified locals wherever appropriate
 >>     and introduced new helper variables to simplify expressions.
 >>     (test_append): Exercised both the function exception safety
 >>     and the behavior of the function under normal conditions.


Hey Anton, this change eliminates code duplication between the
test_exceptions() and test_append() functions. Could you please
incorporate it into all new tests? Also, when you have a chance, it
would be good to go back to the existing tests and do the same thing
there as well.

Btw., after this change the test fails 6 assertions, all on line 336,
one for each specialization of the test template (see below). I'm having
trouble understanding that test case. What is the meaning of the
expected result (the TestCase::res member) being null? (I don't think
the case was being handled in the test prior to the change which is why
I suspect the test had been passing.)

# ASSERTION (S7) (4 lines):
# TEXT: line 609. std::string ({ 'x' <repeats 4095 times> }).append
(*this, 0, 0) expected (null), length 3, got { 'x' <repeats 4095 times>
}, length 4095
# CLAUSE: lib.string.append
# LINE: 336

Martin

PS Btw., shouldn't this test fail for the same reason as the replace
test does, i.e., because of STDCXX-170:
http://issues.apache.org/jira/browse/STDCXX-170


Mime
View raw message