Liviu Nicoara wrote:
I have attached my tentative porting of lib.deque.modifiers test to the
new driver. Martin, I would appreciate suggestions for improving the
sections which use ToString class (one of those uses split formatting).

I don't see the class defined in the test. Did you by any chance
move/copy it into your version alg_test.h?

I think the bits that use the ToString class are fine. As soon as
I'm done with the extension to rw_asnprintf() to format arrays of
class X (we need to rename it!) it should be straightforward to
simply remove the class and pass the arrays directly to rw_assert().

Btw., the old tests were designed to avoid invoking the RW_ASSERT
macro except on failure (i.e., there's usually an if (failed) { }
block around it). It was done to avoid the relatively expensive
formatting done behind the scenes (as a result of expanding the
RW_ASSERT() macro). The new driver doesn't do any formatting unless
a diagnostic is actually active (i.e., unless an assertion fails)
or unless tracing is on (i.e., unless the --trace option is used),
so this is not a concern anymore. It's also important to be able
exercise the formatting code even when there are no assertion
failures (via the --trace option), and it can be useful to keep
track of the number of assertions (or individual test cases)
exercised. So it would be good to remove the if conditionals
from around the assertions in the ported tests. Doing so will
also allow us to get rid of the dummy assertion at the end of
some tests and the code that counts the number of failures.

Martin

Reply via email to