Commit 02aee327 by Jonathan Wakely Committed by Jonathan Wakely

Improve std::complex test and move to sub-directory

	* testsuite/26_numerics/complex/dr2714.cc: Move to ...
	* testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc:
	... Here. Remove duplicate header and dg-options. Check first invalid
	character gets putback. Remove wchar_t test.

From-SVN: r255630
parent b7280579
2017-12-14 Jonathan Wakely <jwakely@redhat.com>
* testsuite/26_numerics/complex/dr2714.cc: Move to ...
* testsuite/26_numerics/complex/inserters_extractors/char/dr2714.cc:
... Here. Remove duplicate header and dg-options. Check first invalid
character gets putback. Remove wchar_t test.
2017-12-13 Jonathan Wakely <jwakely@redhat.com> 2017-12-13 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59568 PR libstdc++/59568
......
...@@ -15,11 +15,8 @@ ...@@ -15,11 +15,8 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++98" }
#include <complex> #include <complex>
#include <sstream> #include <sstream>
#include <complex>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
void void
...@@ -37,16 +34,6 @@ test01() ...@@ -37,16 +34,6 @@ test01()
void void
test02() test02()
{ {
std::wistringstream in(L" ( 2.0 , 0.5 ) ");
std::complex<double> c;
in >> c;
VERIFY( in.good() );
VERIFY( c.real() == 2.0 && c.imag() == 0.5 );
}
void
test03()
{
std::istringstream in; std::istringstream in;
std::complex<double> c(-1, -1); std::complex<double> c(-1, -1);
const std::complex<double> c0 = c; const std::complex<double> c0 = c;
...@@ -55,6 +42,7 @@ test03() ...@@ -55,6 +42,7 @@ test03()
in >> c; in >> c;
VERIFY( in.fail() ); VERIFY( in.fail() );
in.clear(); in.clear();
VERIFY( in.get() == 'a' );
in.str(" ( ) "); in.str(" ( ) ");
in >> c; in >> c;
...@@ -71,11 +59,10 @@ test03() ...@@ -71,11 +59,10 @@ test03()
in.str("(b)"); in.str("(b)");
in >> c; in >> c;
VERIFY( in.fail() ); VERIFY( in.fail() );
in.clear(); in.clear();
VERIFY( in.get() == 'b' ); VERIFY( in.get() == 'b' );
in.str("( c)");
in.str("( c)");
in >> c; in >> c;
VERIFY( in.fail() ); VERIFY( in.fail() );
in.clear(); in.clear();
...@@ -121,7 +108,7 @@ test03() ...@@ -121,7 +108,7 @@ test03()
} }
void void
test04() test03()
{ {
// PR libstdc++/59568 // PR libstdc++/59568
std::istringstream in; std::istringstream in;
...@@ -164,5 +151,4 @@ main() ...@@ -164,5 +151,4 @@ main()
test01(); test01();
test02(); test02();
test03(); test03();
test04();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment