aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-07 16:31:42 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-07 16:31:42 +0000
commitd8d674a19a9f3d2f17427e7a7b5217e2c15880cf (patch)
tree4342fb258227c31c859682720d4d979a6df73063 /libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
parent964944fc854c1dd723f7b8150d0deac634aabdbb (diff)
This commit was manufactured by cvs2svn to create taghammer-3_3-merge-20030407
'hammer-3_3-merge-20030407'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/hammer-3_3-merge-20030407@65335 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc')
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
index 041f3149011..e4e618d68d8 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
@@ -368,7 +368,26 @@ test05()
istringstream istr (sval);
double d;
istr >> d;
- VERIFY (abs(pi-d)/pi < DBL_EPSILON);
+ VERIFY( abs(pi-d)/pi < DBL_EPSILON );
+ return 0;
+}
+
+
+// libstdc++/9151
+int
+test06()
+{
+ int prec = numeric_limits<double>::digits10 + 2;
+ double oval = numeric_limits<double>::min();
+
+ stringstream ostr;
+ ostr.precision(prec);
+ ostr << oval;
+ string sval = ostr.str();
+ istringstream istr (sval);
+ double ival;
+ istr >> ival;
+ VERIFY( abs(oval-ival)/oval < DBL_EPSILON );
return 0;
}
@@ -380,6 +399,7 @@ main()
test03();
test04();
test05();
+ test06();
#ifdef TEST_NUMPUT_VERBOSE
cout << "Test passed!" << endl;
#endif