stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r628071 - /stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp
Date Fri, 15 Feb 2008 14:39:34 GMT
Author: faridz
Date: Fri Feb 15 06:39:33 2008
New Revision: 628071

URL: http://svn.apache.org/viewvc?rev=628071&view=rev
Log:
2008-02-15 Farid Zaripov <farid_zaripov@epam.com>

	* tests/regress/22.locale.num.put.stdcxx-2.cpp: New regression test for STDCXX-2 issue.

Added:
    stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp   (with props)

Added: stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp
URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp?rev=628071&view=auto
==============================================================================
--- stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp (added)
+++ stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp Fri Feb 15 06:39:33 2008
@@ -0,0 +1,65 @@
+/************************************************************************
+ *
+ * 22.locale.num.put.stdcxx-2.cpp
+ *
+ * the regression test for STDCXX-2 issue
+ *
+ * $Id$
+ *
+ ***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  "License"); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ **************************************************************************/
+
+#include <cassert>
+#include <cstddef>
+#include <ios>
+#include <string>
+#include <sstream>
+
+ void test (std::streamsize prec)
+{
+    const std::size_t len = 0 > prec ? 7 : (1 < prec ? prec + 1 : 2);
+    std::string exp (len, '0');
+    exp [1] = '.';
+
+    std::ostringstream strm;
+    strm.setf (strm.showpoint);
+    strm.precision (prec);
+
+    strm << 0.0f;
+    assert (exp == strm.str ());
+
+    strm.str ("");
+    strm << 0.0;
+    assert (exp == strm.str ());
+
+    strm.str ("");
+    strm << 0.0L;
+    assert (exp == strm.str ());
+}
+
+int main ()
+{
+    test (-2);
+    test (0);
+    test (1);
+    test (5);
+
+    return 0;
+}

Propchange: stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: stdcxx/trunk/tests/regress/22.locale.num.put.stdcxx-2.cpp
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message