stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: svn commit: r405254 - /incubator/stdcxx/trunk/tests/strings/21.string.replace.cpp
Date Tue, 09 May 2006 01:27:42 GMT wrote:
> Author: sebor
> Date: Mon May  8 18:08:00 2006
> New Revision: 405254
> URL:
> Log:
> 2006-05-08  Martin Sebor  <>
> 	* replace.cpp: Replaced LSTR, LLEN, and LPAR in test cases with
> 	strings containing the '<char>@<count>' directive(s). Corrected
> 	errors in expected results involving said strings revealed by
> 	the use of the more flexible/reliable directives.

Whoops, I just realized that I introduced these off-by-one errors
during the replacement of LLEN with the directive.

Anyway, the directive is much more flexible than working with the
hardcoded long string in that it allows us to encode an arbitrarily
long string consisting of arbitrary characters for each test case.

For example, we can easily express long complex strings such as:
   { "abc", 'd' repeats 1234 times, "efg", 'h' repeats 5678 times }
by encoding them as follows:

Anton, could you please modify the rest of the tests to use these
new directives and the rw_expand() function instead of LSTR and
rw_widen()? Once we've converted them I would like to get rid of
the long strings and either remove rw_widen() or change it to
behave like rw_expand().

>       Added more
> 	test cases exercising self-referential modification.
> 	(test_replace_range): Added arguments, simplified, documented.
> 	(test_replace): Used the new rw_expand() instead of rw_widen(),
> 	added (and disabled for now) checking for memory leaks.

Once I get memory leak detection working in the replace test we
will also need to change the rest of the tests to exercise the


PS FWIW, I've also fixed STDCXX-170 in my local tree but I'm not
quite ready to commit the (extensive) changes.

View raw message