Author: faridz
Date: Mon Oct 15 08:15:32 2007
New Revision: 584803
URL: http://svn.apache.org/viewvc?rev=584803&view=rev
Log:
2007-10-15 Farid Zaripov <[EMAIL PROTECTED]>
* 21.string.io.stdcxx-206.cpp: Perform testing with zero
and non-zero padding. Perform checking according to
_RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILUDE macro definition.
Modified:
incubator/stdcxx/trunk/tests/regress/21.string.io.stdcxx-206.cpp
Modified: incubator/stdcxx/trunk/tests/regress/21.string.io.stdcxx-206.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/regress/21.string.io.stdcxx-206.cpp?rev=584803&r1=584802&r2=584803&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/regress/21.string.io.stdcxx-206.cpp (original)
+++ incubator/stdcxx/trunk/tests/regress/21.string.io.stdcxx-206.cpp Mon Oct 15
08:15:32 2007
@@ -2,13 +2,10 @@
#include <string>
#include <cassert>
-int main ()
+void test (const std::string& str, const std::streamsize width)
{
- std::string str ("abcdefghijk");
-
char buf[10];
std::ostrstream os (buf, sizeof(buf));
- const std::streamsize width = 2;
os.width (width);
os.exceptions (std::ios_base::failbit | std::ios_base::badbit);
@@ -19,6 +16,19 @@
catch (std::ios_base::failure&) {
}
+#ifndef _RWSTD_NO_EXT_KEEP_WIDTH_ON_FAILURE
+ assert (width == os.width ());
+#else
assert (0 == os.width ());
+#endif
+}
+
+int main ()
+{
+ std::string str ("abcdefghijk");
+
+ test (str, 2);
+ test (str, str.size () + 2);
+
return 0;
}