incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <mse...@gmail.com>
Subject Re: [jira] [Updated] (STDCXX-1058) std::basic_ios<>::copyfmt() with registered callback (via std::ios_base::register_callback()) run-time SIGABRT
Date Mon, 11 Jun 2012 16:35:01 GMT
...
> OK I attached a new test case - 27.basic_ios.copyfmt.stdcxx-1058.cpp.
>
> But, using a simple derived class from std::basic_ios doesn't trigger
> the bug. It's only triggered when using std::fstream or
> std::stringstream.

Here's what I meant:

   struct A: std::streambuf { };
   struct B: std::ios {
     A sb;
     B () { init (&sb); }
   } f0, f1;

Btw., in your new test, either the TEST_ASSERT() macro should abort
or the test should when before returning ret is non-zero.

I.e., every regression test should report failure by calling abort
(via the assert() macro).

Returning a non-zero exit status (in addition to making use of
assert()) is fine but it shouldn't be the sole mechanism for
reporting an error.

Also, please avoid #including <iostream> in tests unless
exercising the standard streams (std::cout et al.) The header
runs complicated code and can lead to unrelated failures.

Attached is a slightly modified test to show what I mean. (Also
fixes formatting -- please use 4 space indents and a space before
each open paren; curly brace goes on the same line as the statement
except for namespace scope declarations).

Martin

>
> --Stefan
>


Mime
View raw message