You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2007/06/27 01:58:55 UTC
svn commit: r550991 [23/23] - in /incubator/stdcxx/branches/4.2.0: ./ doc/
doc/stdlibref/ doc/stdlibug/ etc/config/ etc/config/src/
etc/config/windows/ etc/nls/ etc/nls/posix/charmaps/ etc/nls/posix/src/
examples/include/ examples/manual/ examples/manu...
Modified: incubator/stdcxx/branches/4.2.0/tests/self/0.new.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/self/0.new.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/self/0.new.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/self/0.new.cpp Tue Jun 26 16:58:07 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/tests/self/0.outputiter.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/self/0.outputiter.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/self/0.outputiter.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/self/0.outputiter.cpp Tue Jun 26 16:58:07 2007
@@ -30,6 +30,10 @@
#include <signal.h>
#include <stdio.h>
+#ifdef _MSC_VER
+#include <crtdbg.h> // for _CrtSetReportMode()
+#endif
+
#include <alg_test.h> // for OutputIter
#include <rw_value.h> // for UserClass
#include <driver.h> // for rw_test(), ...
@@ -326,6 +330,11 @@
int main (int argc, char *argv[])
{
+#ifdef _MSC_VER
+ // disable GUI window from abort()
+ _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG);
+#endif
+
return rw_test (argc, argv, __FILE__,
0 /* no clause */,
0 /* no comment */, run_test,
Modified: incubator/stdcxx/branches/4.2.0/tests/self/0.printf.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/self/0.printf.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/self/0.printf.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/self/0.printf.cpp Tue Jun 26 16:58:07 2007
@@ -361,6 +361,7 @@
//////////////////////////////////////////////////////////////////
printf ("%s\n", "\"%s\": character string");
+ TEST ("", "", 0, 0, "");
TEST ("%s", "", 0, 0, "");
TEST ("%s", "a", 0, 0, "a");
TEST ("%s", "ab", 0, 0, "ab");
@@ -1105,8 +1106,65 @@
// "%ld", "%li" //////////////////////////////////////////////////
printf ("\"%%l%c\": signed long\n", spec);
+ TEST_SPEC ("%l", 0L, 0, 0, "0");
+ TEST_SPEC ("%l", 1L, 0, 0, "1");
+ TEST_SPEC ("%l", 2L, 0, 0, "2");
+ TEST_SPEC ("%l", LONG_MAX, 0, 0, 0);
+
+ TEST_SPEC ("%l", -1L, 0, 0, 0);
+ TEST_SPEC ("%l", -2L, 0, 0, 0);
+ TEST_SPEC ("%l", LONG_MIN, 0, 0, 0);
+
+#ifndef _RWSTD_NO_LONG_LONG
+
// "%lld", "%lli" ////////////////////////////////////////////////
printf ("\"%%ll%c\": signed long long\n", spec);
+
+ const _RWSTD_LONG_LONG llong_min = _RWSTD_LLONG_MIN;
+ const _RWSTD_LONG_LONG llong_max = _RWSTD_LLONG_MAX;
+
+ TEST_SPEC ("%ll", 0LL, 0, 0, "0");
+ TEST_SPEC ("%ll", 1LL, 0, 0, "1");
+ TEST_SPEC ("%ll", 12LL, 0, 0, "12");
+ TEST_SPEC ("%ll", 123LL, 0, 0, "123");
+ TEST_SPEC ("%ll", 1234LL, 0, 0, "1234");
+ TEST_SPEC ("%ll", 12345LL, 0, 0, "12345");
+ TEST_SPEC ("%ll", 123456LL, 0, 0, "123456");
+ TEST_SPEC ("%ll", 1234567LL, 0, 0, "1234567");
+ TEST_SPEC ("%ll", 12345678LL, 0, 0, "12345678");
+ TEST_SPEC ("%ll", 123456789LL, 0, 0, "123456789");
+
+# if 4 == _RWSTD_LLONG_SIZE
+
+ // FIXME: exercise 32-bit negative long long
+
+ fprintf (stderr, "Warning: %s\n", "\"%lld\" not exercised "
+ "with negative values for %u-bit long long",
+ sizeof (RWSTD_LONG_LONG) * CHAR_BIT);
+
+# elif 8 == _RWSTD_LLONG_SIZE
+
+ TEST_SPEC ("%ll", -1LL, 0, 0, sgn ? "-1" : "18446744073709551615");
+ TEST_SPEC ("%ll", -2LL, 0, 0, sgn ? "-2" : "18446744073709551614");
+ TEST_SPEC ("%ll", -3LL, 0, 0, sgn ? "-3" : "18446744073709551613");
+
+ TEST_SPEC ("%ll", llong_min, 0, 0,
+ sgn ? "-9223372036854775808" : "9223372036854775808");
+ TEST_SPEC ("%ll", llong_min + 1, 0, 0,
+ sgn ? "-9223372036854775807" : "9223372036854775809");
+ TEST_SPEC ("%ll", llong_min + 2, 0, 0,
+ sgn ? "-9223372036854775806" : "9223372036854775810");
+
+ TEST_SPEC ("%ll", llong_max, 0, 0, "9223372036854775807");
+ TEST_SPEC ("%ll", llong_max - 1, 0, 0, "9223372036854775806");
+
+# endif
+
+#else // if defined (_RWSTD_NO_LONG_LONG)
+
+ fprintf (stderr, "Warning: %s\n", "\"%lld\" not exercised");
+
+#endif // _RWSTD_NO_LONG_LONG
}
/***********************************************************************/
@@ -2880,7 +2938,10 @@
// members must be packed with no padding
RW_ASSERT (sizeof *sa == sizeof sa->i + sizeof sa->s);
- TEST ("{%{ .*A@}}", 3, "(%i, %#s)", sa,
+ TEST ("{%{ .*A@}}", // array of nested directives
+ 3, // three elements
+ "(%zu, %#s)", // descrcibes structure
+ sa, // array argument
"{(1, \"foo\") (2, \"bar\") (3, \"foobar\")}");
}
Modified: incubator/stdcxx/branches/4.2.0/tests/src/any.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/any.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/any.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/any.cpp Tue Jun 26 16:58:07 2007
@@ -6,16 +6,23 @@
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/tests/src/environ.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/environ.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/environ.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/environ.cpp Tue Jun 26 16:58:07 2007
@@ -134,14 +134,14 @@
// try to remove variable from the environment
#ifndef _RWSTD_NO_UNSETENV
-# ifdef _RWSTD_OS_FREEBSD
- // FreeBSD declares void unsetenv(const char*)
+# if defined (_RWSTD_OS_FREEBSD) || defined (_RWSTD_OS_DARWIN)
+ // FreeBSD (and Darwin) declares void unsetenv(const char*)
// http://www.freebsd.org/cgi/man.cgi?query=unsetenv&sektion=3
unsetenv (envvar);
ret = 0;
-# else // !FreeBSD
+# else // !FreeBSD ...
ret = unsetenv (envvar);
-# endif // FreeBSD
+# endif // FreeBSD ...
#else // ifdef _RWSTD_NO_UNSETENV
ret = putenv (envvar);
#endif // _RWSTD_NO_UNSETENV
Modified: incubator/stdcxx/branches/4.2.0/tests/src/locale.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/locale.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/locale.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/locale.cpp Tue Jun 26 16:58:07 2007
@@ -34,15 +34,17 @@
#include <environ.h> // for rw_putenv()
#include <file.h> // for SHELL_RM_RF, rw_tmpnam
+#include <rw_printf.h> // for rw_fprintf()
#include <rw_process.h> // for rw_system()
+#include <cstdio>
-#if defined __linux__
+#if defined (_RWSTD_OS_LINUX) && !defined (_XOPEN_SOURCE)
// on Linux define _XOPEN_SOURCE to get CODESET defined in <langinfo.h>
# define _XOPEN_SOURCE 500 /* Single Unix conformance */
// bring __int32_t into scope (otherwise <wctype.h> fails to compile)
# include <sys/types.h>
-#endif // __linux__
+#endif // Linux
#include <fcntl.h>
#include <sys/stat.h> // for stat
@@ -62,7 +64,7 @@
#include <assert.h> // for assert
#include <errno.h> // for EBADF
#include <float.h> // for {FLT,DBL,LDBL}_DIG
-#include <limits.h> // for CHAR_BIT, PATH_MAX
+#include <limits.h> // for CHAR_BIT, MB_LEN_MAX, PATH_MAX
#include <locale.h> // for LC_XXX macros, setlocale
#include <stdarg.h> // for va_copy, va_list, ...
#include <stdio.h> // for fgets, remove, sprintf, ...
@@ -469,4 +471,242 @@
remove (fname);
return slocname;
+}
+
+/**************************************************************************/
+
+// finds a multibyte character that is `bytes' long if `bytes' is less
+// than or equal to MB_CUR_MAX, or the longest multibyte sequence in
+// the current locale
+static const char*
+_get_mb_char (char *buf, size_t bytes)
+{
+ _RWSTD_ASSERT (0 != buf);
+
+ *buf = '\0';
+
+ if (0 == bytes)
+ return buf;
+
+ const bool exact = bytes <= size_t (MB_CUR_MAX);
+
+ if (!exact)
+ bytes = MB_CUR_MAX;
+
+ wchar_t wc;
+
+ // search the first 64K characters sequentially
+ for (wc = wchar_t (1); wc != wchar_t (0xffff); ++wc) {
+
+ if ( int (bytes) == wctomb (buf, wc)
+ && int (bytes) == mblen (buf, bytes)) {
+ // NUL-terminate the multibyte character of the requested length
+ buf [bytes] = '\0';
+ break;
+ }
+
+ *buf = '\0';
+ }
+
+#if 2 < _RWSTD_WCHAR_T_SIZE
+
+ // if a multibyte character of the requested size is not found
+ // in the low 64K range, try to find one using a random search
+ if (wchar_t (0xffff) == wc) {
+
+ // iterate only so many times to prevent an infinite loop
+ // in case when MB_CUR_MAX is greater than the longest
+ // multibyte character
+ for (int i = 0; i != 0x100000; ++i) {
+
+ wc = wchar_t (rand ());
+
+ if (RAND_MAX < 0x10000) {
+ wc <<= 16;
+ wc |= wchar_t (rand ());
+ }
+
+ if ( int (bytes) == wctomb (buf, wc)
+ && int (bytes) == mblen (buf, bytes)) {
+ // NUL-terminate the multibyte character
+ buf [bytes] = '\0';
+ break;
+ }
+
+ *buf = '\0';
+ }
+ }
+
+#endif // 2 < _RWSTD_WCHAR_SIZE
+
+ // return 0 on failure to find a sequence exactly `bytes' long
+ return !exact || bytes == strlen (buf) ? buf : 0;
+}
+
+
+_TEST_EXPORT size_t
+rw_get_mb_chars (rw_mbchar_array_t mb_chars)
+{
+ _RWSTD_ASSERT (0 != mb_chars);
+
+ const char* mbc = _get_mb_char (mb_chars [0], size_t (-1));
+
+ if (!mbc) {
+ rw_fprintf (rw_stderr, "*** failed to find any multibyte characters "
+ "in locale \"%s\" with MB_CUR_MAX = %u\n",
+ setlocale (LC_CTYPE, 0), MB_CUR_MAX);
+ return 0;
+ }
+
+ size_t mb_cur_max = strlen (mbc);
+
+ if (_RWSTD_MB_LEN_MAX < mb_cur_max)
+ mb_cur_max = _RWSTD_MB_LEN_MAX;
+
+ // fill each element of `mb_chars' with a multibyte character
+ // of the corresponding length
+ for (size_t i = mb_cur_max; i; --i) {
+
+ // try to generate a multibyte character `i' bytes long
+ mbc = _get_mb_char (mb_chars [i - 1], i);
+
+ if (0 == mbc) {
+ if (i < mb_cur_max) {
+ rw_fprintf (rw_stderr, "*** failed to find %u-byte characters "
+ "in locale \"%s\" with MB_CUR_MAX = %u\n",
+ i + 1, setlocale (LC_CTYPE, 0), MB_CUR_MAX);
+ mb_cur_max = 0;
+ break;
+ }
+ --mb_cur_max;
+ }
+ }
+
+ return mb_cur_max;
+}
+
+
+_TEST_EXPORT const char*
+rw_find_mb_locale (size_t *mb_cur_max,
+ rw_mbchar_array_t mb_chars)
+{
+ _RWSTD_ASSERT (0 != mb_cur_max);
+ _RWSTD_ASSERT (0 != mb_chars);
+
+ if (2 > _RWSTD_MB_LEN_MAX) {
+ rw_fprintf (rw_stderr, "MB_LEN_MAX = %d, giving up\n",
+ _RWSTD_MB_LEN_MAX);
+ return 0;
+ }
+
+ static const char *mb_locale_name;
+
+ char saved_locale_name [1024];
+ strcpy (saved_locale_name, setlocale (LC_CTYPE, 0));
+
+ _RWSTD_ASSERT (strlen (saved_locale_name) < sizeof saved_locale_name);
+
+ *mb_cur_max = 0;
+
+ // iterate over all installed locales
+ for (const char *name = rw_locales (_RWSTD_LC_CTYPE, 0); name && *name;
+ name += strlen (name) + 1) {
+
+ if (setlocale (LC_CTYPE, name)) {
+
+ // try to generate a set of multibyte characters
+ // with lengths from 1 and MB_CUR_MAX (or less)
+ const size_t cur_max = rw_get_mb_chars (mb_chars);
+
+ if (*mb_cur_max < cur_max) {
+ *mb_cur_max = cur_max;
+ mb_locale_name = name;
+
+ // break when we've found a multibyte locale
+ // with the longest possible encoding
+ if (_RWSTD_MB_LEN_MAX == *mb_cur_max)
+ break;
+ }
+ }
+ }
+
+ if (*mb_cur_max < 2) {
+ rw_fprintf (rw_stderr, "*** failed to find a full set of multibyte "
+ "characters in locale \"%s\" with MB_CUR_MAX = %u "
+ "(computed)", mb_locale_name, *mb_cur_max);
+ mb_locale_name = 0;
+ }
+ else {
+ // (re)generate the multibyte characters for the saved locale
+ // as they may have been overwritten in subsequent iterations
+ // of the loop above (while searching for a locale with greater
+ // value of MB_CUR_MAX)
+ setlocale (LC_CTYPE, mb_locale_name);
+ rw_get_mb_chars (mb_chars);
+ }
+
+ setlocale (LC_CTYPE, saved_locale_name);
+
+ return mb_locale_name;
+}
+
+
+/**************************************************************************/
+
+_TEST_EXPORT const char*
+rw_create_locale (const char *charmap, const char *locale)
+{
+ // only one locale is enough (avoid invoking localedef more than once)
+ static const char* locname;
+ const char* locale_root;
+
+ if (locname)
+ return locname;
+
+ // set up RWSTD_LOCALE_ROOT and other environment variables
+ locale_root = rw_set_locale_root ();
+
+ if (0 == locale_root)
+ return 0;
+
+ // create a temporary locale definition file that exercises as
+ // many different parts of the collate standard as possible
+ char srcfname [256];
+ std::sprintf (srcfname, "%s%slocale.src", locale_root, SLASH);
+
+ std::FILE *fout = std::fopen (srcfname, "w");
+
+ if (!fout) {
+ std::fprintf (stderr, "%s:%d: fopen(\"%s\", \"w\") failed\n",
+ __FILE__, __LINE__, srcfname);
+ return 0;
+ }
+
+ std::fprintf (fout, "%s", locale);
+
+ std::fclose (fout);
+
+ // create a temporary character map file
+ char cmfname [256];
+ std::sprintf (cmfname, "%s%scharmap.src", locale_root, SLASH);
+
+ fout = std::fopen (cmfname, "w");
+
+ if (!fout) {
+ std::fprintf (stderr, "%s:%d: fopen(\"%s\", \"w\") failed\n",
+ __FILE__, __LINE__, cmfname);
+ return 0;
+ }
+
+ std::fprintf (fout, "%s", charmap);
+
+ std::fclose (fout);
+
+ locname = "test-locale";
+
+ // process the locale definition file and character map
+ if (0 == rw_localedef ("-w", srcfname, cmfname, locname))
+ locname = 0;
+
+ return locname;
}
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.cpp Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_diags.cpp - definitions of diagnostic option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
// expand _TEST_EXPORT macros
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.h (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_diags.h Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_diags.h - declarations of diagnostic option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
#ifndef RW_OPT_DIAGS_H_INCLUDED
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.cpp Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_lines.cpp - definitions of line option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
// expand _TEST_EXPORT macros
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.h (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_lines.h Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_lines.h - declarations of line option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
#ifndef RW_OPT_LINES_H_INCLUDED
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_types.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_types.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_types.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_types.cpp Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_types.cpp - definitions of type option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
// expand _TEST_EXPORT macros
Modified: incubator/stdcxx/branches/4.2.0/tests/src/opt_types.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/opt_types.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/opt_types.h (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/opt_types.h Tue Jun 26 16:58:07 2007
@@ -2,21 +2,28 @@
*
* opt_types.h - declarations of type option handlers
*
- * $Id:$
+ * $Id$
*
************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
#ifndef RW_OPT_TYPES_H_INCLUDED
Modified: incubator/stdcxx/branches/4.2.0/tests/src/thread.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/thread.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/thread.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/thread.cpp Tue Jun 26 16:58:07 2007
@@ -31,6 +31,7 @@
#include <rw_thread.h>
#include <stddef.h> // for size_t
+#include <string.h> // for memset()
/**************************************************************************/
@@ -381,7 +382,35 @@
// small buffer for thread ids when invoked with (thr_id == 0)
rw_thread_t id_buf [16];
- bool join = 0 == thr_id;
+ const bool join = 0 == thr_id;
+
+#ifndef _RWSTD_REENTRANT
+
+ // when not reentrant/thread safe emulate the creation
+ // of a single thread and then waiting for it to finish
+ // by simply calling the thread procedure
+
+ if (1 == nthrs && join) {
+
+ if (0 == thr_id) {
+ thr_id = id_buf;
+ memset (thr_id, 0, sizeof *thr_id);
+ }
+
+ // when the thr_arg pointer is 0 pass the address
+ // of each thread's id as the argument to thr_proc
+ void* const arg = thr_arg ? thr_arg [0] : (void*)(thr_id);
+
+ void* const thr_result = thr_proc (arg);
+
+ if (thr_arg)
+ thr_arg [0] = thr_result;
+
+ return 0;
+ }
+
+#endif // !_RWSTD_REENTRANT
+
bool delete_ids = false;
if (0 == thr_id) {
Modified: incubator/stdcxx/branches/4.2.0/tests/src/value.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/src/value.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/src/value.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/src/value.cpp Tue Jun 26 16:58:07 2007
@@ -455,18 +455,6 @@
typedef unsigned char UChar;
-// used to initialize an array of objects of type UserClass
-static const char *xinit_begin;
-
-static int xinit ()
-{
- if (xinit_begin)
- return UChar (*xinit_begin++);
-
- return 0;
-}
-
-
template <class T>
static T*
__rw_from_char (T*, const char *str, size_t len, bool sorted)
Modified: incubator/stdcxx/branches/4.2.0/tests/strings/21.cctype.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/strings/21.cctype.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/strings/21.cctype.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/strings/21.cctype.cpp Tue Jun 26 16:58:07 2007
@@ -7,16 +7,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/tests/strings/21.cwchar.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/strings/21.cwchar.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/strings/21.cwchar.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/strings/21.cwchar.cpp Tue Jun 26 16:58:07 2007
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2005 Rogue Wave Software.
+ * Copyright 2004-2005 Rogue Wave Software.
*
**************************************************************************/
@@ -87,6 +87,10 @@
/**************************************************************************/
+#ifdef _MSC_VER
+#include <crtdbg.h> // for _CrtSetReportMode()
+#endif
+
#include <cwchar>
#include <any.h> // for rw_any_t
#include <driver.h> // for rw_test(), ...
@@ -921,8 +925,19 @@
/* const */ int tm_buf [16] = { 0 };
const test_tm* tmb = (const test_tm*)&tm_buf;
+#ifdef _MSC_VER
+ // disable GUI window with error:
+ // Assertion failed: ("Zero length output buffer passed to strftime",0)
+ int oldmode = _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
+#endif
+
TEST (test_size_t, wcsftime, (wstr, size, L"", tmb), WCSFTIME, -1);
+#ifdef _MSC_VER
+ // restore error report mode
+ _CrtSetReportMode (_CRT_ASSERT, oldmode);
+#endif
+
TEST (test_wint_t, btowc, (i), BTOWC, -1);
TEST (int, wctob, (wi), WCTOB, -1);
@@ -968,7 +983,8 @@
// included here to avoid namespace pollution
#include <cstdarg> // for va_list
-#include <cstdio> // for FILE
+#include <cstdio> // for FILE, fopen()
+#include <file.h> // for DEV_NUL
#include <rw_printf.h> // for rw_stdout
namespace std {
@@ -1013,10 +1029,15 @@
// an incomplete type and casts between two non-void pointers
// require that the types be complete (in case they are related
// by inheritance and need to be adjusted)
- test_FILE* const fp = (test_FILE*)(void*)rw_stdout;
+ test_FILE* const fp = (test_FILE*)std::fopen (DEV_NULL, "w");
test_va_list va;
va_start (va, dummy);
+ // call fwide() first before any prior output since 7.19.2, p5
+ // of C99 prohibits wide character I/O functions from being called
+ // on a byte-oriented stream
+ TEST (int, fwide, (fp, i), FWIDE, -1);
+
TEST (int, fwprintf, (fp, L""), FWPRINTF, -1);
TEST (int, fwprintf, (fp, L"", uniqptr), FWPRINTF, -1);
@@ -1032,7 +1053,6 @@
TEST (test_wint_t, getwc, (fp), GETWC, -1);
TEST (test_wint_t, putwc, (L'\0', fp), PUTWC, -1);
TEST (test_wint_t, ungetwc, (wi, fp), UNGETWC, -1);
- TEST (int, fwide, (fp, i), FWIDE, -1);
_RWSTD_UNUSED (str);
_RWSTD_UNUSED (cstr);
Modified: incubator/stdcxx/branches/4.2.0/tests/strings/21.string.access.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/strings/21.string.access.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/strings/21.string.access.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/strings/21.string.access.cpp Tue Jun 26 16:58:07 2007
@@ -6,16 +6,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/tests/strings/21.string.push_back.mt.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/strings/21.string.push_back.mt.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/strings/21.string.push_back.mt.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/strings/21.string.push_back.mt.cpp Tue Jun 26 16:58:07 2007
@@ -28,8 +28,7 @@
**************************************************************************/
#include <string> // for string
-
-#include <cstdio> // for putc(), puts(), ...
+#include <cstddef> // for size_t
#include <driver.h> // for rw_test()
#include <rw_thread.h> // for rw_thread_pool(), ...
@@ -49,8 +48,14 @@
/**************************************************************************/
+#ifdef _RWSTD_REENTRANT
int rw_opt_nthreads = 4;
-int rw_opt_nloops = MAX_LOOPS;
+#else // if !defined (_RWSTD_REENTRANT)
+// in non-threaded builds use just one thread
+int rw_opt_nthreads = 1;
+#endif // _RWSTD_REENTRANT
+
+int rw_opt_nloops = MAX_LOOPS;
extern "C" {
@@ -93,12 +98,6 @@
// verify that the local copies have the expected data
RW_ASSERT (0 == rw_strncmp (expect0_data, local0.data ()));
RW_ASSERT (0 == rw_strncmp (expect1_data, local1.data ()));
-
- if (60 < rw_opt_nloops && 0 == i % (rw_opt_nloops / 60)) {
- // parentheses used to thwart macro expansion
- (std::putc)(to_append [thr_inx], stdout);
- std::fflush (stdout);
- }
}
return 0;
@@ -119,7 +118,9 @@
const int result = rw_thread_pool (0, std::size_t (rw_opt_nthreads),
0, thread_func, 0);
- std::puts ("");
+ rw_error (result == 0, 0, __LINE__,
+ "rw_thread_pool(0, %d, 0, %{#f}, 0) failed",
+ rw_opt_nthreads, thread_func);
rw_assert (0 == shared0.size (), 0, 0,
"shared empty string modifed: expected \"\", got %{#S}",
Modified: incubator/stdcxx/branches/4.2.0/tests/support/18.exception.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/support/18.exception.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/support/18.exception.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/support/18.exception.cpp Tue Jun 26 16:58:07 2007
@@ -6,22 +6,23 @@
*
***************************************************************************
*
- * Copyright 2006 The Apache Software Foundation or its licensors,
- * as applicable.
+ * 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
*
- * Copyright 2001-2006 Rogue Wave Software.
- *
- * Licensed 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
+ * 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.
+ * 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.
+ *
+ * Copyright 2001-2006 Rogue Wave Software.
*
**************************************************************************/
@@ -36,9 +37,8 @@
#include <stdexcept> // for exception classes
#include <typeinfo> // for bad_cast, bad_typeid
-#include <csetjmp> // for jmp_buf, longjmp(), setjmp()
#include <csignal> // for signal(), SIGABRT
-#include <cstdio> // for sprintf()
+#include <cstdio> // for size_t, sprintf()
#include <cstring> // for strcmp(), strlen()
#include <rw/_error.h> // for _RWSTD_ERROR_XXX constants
@@ -50,6 +50,27 @@
#include <driver.h>
+
+#ifdef _RWSTD_OS_LINUX
+ // use siglongjmp() and sigsetjmp() on Linux to avoid
+ // http://sourceware.org/bugzilla/show_bug.cgi?id=2351
+# include <setjmp.h> // for siglongjmp(), sigsetjmp()
+
+# define RW_JMP_BUF jmp_buf
+# define RW_SETJMP(env) sigsetjmp (env, 0)
+# define RW_LONGJMP(env, val) siglongjmp (env, val)
+#else // if !defined (_RWSTD_OS_LINUX)
+# include <csetjmp> // for longjmp(), setjmp()
+
+# define RW_JMP_BUF std::jmp_buf
+# ifdef setjmp
+# define RW_SETJMP(env) setjmp (env)
+# else
+# define RW_SETJMP(env) std::setjmp (env)
+# endif
+# define RW_LONGJMP(env, val) std::longjmp (env, val)
+#endif // _RWSTD_OS_LINUX
+
/**************************************************************************/
// check header <exception> synopsis
@@ -195,7 +216,7 @@
int expect_terminate; // terminate expected if 1
int expect_unexpected; // unexpected expected if 1
int expect_throw_proc; // throw_proc expected if 1
-std::jmp_buf env;
+RW_JMP_BUF jmpenv;
/**************************************************************************/
@@ -213,7 +234,7 @@
expect_abort = -1;
- std::longjmp (env, 1);
+ RW_LONGJMP (jmpenv, 1);
}
} // extern "C"
@@ -238,7 +259,7 @@
rw_assert (false, 0, __LINE__,
"std::terminate() not called or returned");
- std::longjmp (env, -1);
+ RW_LONGJMP (jmpenv, -1);
}
/**************************************************************************/
@@ -266,7 +287,7 @@
rw_assert (false, 0, __LINE__,
"std::terminate() not called or returned");
- std::longjmp (env, -1);
+ RW_LONGJMP (jmpenv, -1);
}
/**************************************************************************/
@@ -325,7 +346,7 @@
rw_assert (0, 0, __LINE__, "incompatible exception propagated");
}
- std::longjmp (env, -1);
+ RW_LONGJMP (jmpenv, -1);
#else
@@ -741,7 +762,9 @@
# endif // _RWSTD_NO_SETRLIMIT
// try to allocate a huge amount of memory to induce bad_alloc
- ::operator new (~0UL - 4096UL);
+ const std::size_t huge_amount = _RWSTD_SIZE_MAX - 4096;
+
+ ::operator new (huge_amount);
# ifndef _RWSTD_NO_SETRLIMIT
# if !defined (__HP_aCC)
@@ -903,7 +926,7 @@
try {
// jump back here if the induced exception causes
// a call to terminate() and/or raises SIGABRT
- if (0 == setjmp (env)) {
+ if (0 == RW_SETJMP (jmpenv)) {
// try to induce the standard exception
if (ex_id == induce_exception (ex_id, ex_name)) {
@@ -981,10 +1004,23 @@
"test of uncaught_exception() disabled"))
test_uncaught_exception ();
+ // exercise __rw::__rw_throw() and __rw::__rw_throw_proc()
+ if (rw_note (0 <= opt_rw_throw, 0, __LINE__,
+ "test of __rw_throw() disabled"))
+ test_rw_throw ();
+
+ // exercise the cooperation between the C++ standard library and
+ // the runtime support library when throwing standard exceptions
+ if (rw_note (0 <= opt_runtime, 0, __LINE__,
+ "test of runtime support disabled"))
+ test_runtime ();
+
+ // exercise the effects last to defer potential problems
+ // due to the tests returning (jumping) out of the handlers
if (rw_note (0 <= opt_effects, 0, __LINE__,
"test of effects disabled")) {
// test the effects of 18.6
- if (0 == setjmp (env)) {
+ if (0 == RW_SETJMP (jmpenv)) {
test_effects ();
}
@@ -999,17 +1035,6 @@
rw_error (-1 == expect_unexpected, 0, __LINE__,
"unexpected() was called unexpectedly");
}
-
- // exercise __rw::__rw_throw() and __rw::__rw_throw_proc()
- if (rw_note (0 <= opt_rw_throw, 0, __LINE__,
- "test of __rw_throw() disabled"))
- test_rw_throw ();
-
- // exercise the cooperation between the C++ standard library and
- // the runtime support library when throwing standard exceptions
- if (rw_note (0 <= opt_runtime, 0, __LINE__,
- "test of runtime support disabled"))
- test_runtime ();
return 0;
}
Modified: incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.shared.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.shared.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.shared.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.shared.cpp Tue Jun 26 16:58:07 2007
@@ -7,16 +7,23 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.weak.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.weak.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.weak.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/tr1.util/2.smartptr.weak.cpp Tue Jun 26 16:58:07 2007
@@ -7,17 +7,24 @@
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
+ *
**************************************************************************/
#include <cassert>
Modified: incubator/stdcxx/branches/4.2.0/tests/utilities/20.pairs.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/tests/utilities/20.pairs.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/tests/utilities/20.pairs.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/tests/utilities/20.pairs.cpp Tue Jun 26 16:58:07 2007
@@ -99,8 +99,6 @@
_RWSTD_UNUSED (pu);
}
-#ifndef _RWSTD_NO_INLINE_MEMBER_TEMPLATES
-
if (0) { // compile only
Pair *p0 = 0;
std::pair<long, double> p1 (*p0);
@@ -192,8 +190,6 @@
"called %d assignment operators, "
"expected 2", UserClass::n_total_op_assign_);
}
-
-#endif // _RWSTD_NO_INLINE_MEMBER_TEMPLATES
{
Modified: incubator/stdcxx/branches/4.2.0/util/aliases.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/aliases.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/aliases.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/aliases.cpp Tue Jun 26 16:58:07 2007
@@ -49,7 +49,9 @@
#ifndef _MSC_VER
-# include <langinfo.h>
+# ifndef _RWSTD_NO_NL_LANGINFO
+# include <langinfo.h>
+# endif
#endif // _MSC_VER
#include "aliases.h"
Modified: incubator/stdcxx/branches/4.2.0/util/aliases.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/aliases.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/aliases.h (original)
+++ incubator/stdcxx/branches/4.2.0/util/aliases.h Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* aliases.h
*
- * $Id: //stdlib/dev/source/stdlib/util/aliases.h#9 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/util/charmap.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/charmap.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/charmap.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/charmap.cpp Tue Jun 26 16:58:07 2007
@@ -32,7 +32,9 @@
// _XOPEN_SOURCE macro in assert.h selects a different declaration for
// iconv than the one used in comp test.
#ifndef _MSC_VER
-# include <iconv.h>
+# ifndef _RWSTD_NO_ICONV
+# include <iconv.h>
+# endif
# include _RWSTD_CERRNO
#else
# include <windows.h>
Modified: incubator/stdcxx/branches/4.2.0/util/charmap.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/charmap.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/charmap.h (original)
+++ incubator/stdcxx/branches/4.2.0/util/charmap.h Tue Jun 26 16:58:07 2007
@@ -36,7 +36,9 @@
#include <set>
#ifndef _MSC_VER
-# include <iconv.h>
+# ifndef _RWSTD_NO_ICONV
+# include <iconv.h>
+# endif
#endif // _MSC_VER
#include "scanner.h"
Modified: incubator/stdcxx/branches/4.2.0/util/display.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/display.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/display.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/display.cpp Tue Jun 26 16:58:07 2007
@@ -37,8 +37,8 @@
*/
static void print_header_plain ()
{
- puts ("NAME STATUS WARN ASSERTS FAILED PERCNT "
- "USER SYS REAL");
+ puts ("NAME STATUS WARN ASSERTS FAILED PERCNT"
+ " USER SYS REAL");
}
/**
@@ -47,7 +47,7 @@
static void print_target_plain (const struct target_opts*)
{
const char* const target_name = get_target ();
- printf ("%-25.25s ", target_name);
+ printf ("%-30.30s ", target_name);
fflush (stdout);
}
Modified: incubator/stdcxx/branches/4.2.0/util/iconv.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/iconv.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/iconv.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/iconv.cpp Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* iconv.cpp - Win32 implementation of the POSIX iconv facility
*
- * $Id: //stdlib/dev/source/stdlib/util/iconv.cpp#5 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/util/loc_exception.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/loc_exception.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/loc_exception.h (original)
+++ incubator/stdcxx/branches/4.2.0/util/loc_exception.h Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* loc_exception.h - exception class used in locale and localedef
*
- * $Id: //stdlib/dev/source/stdlib/util/loc_exception.h#8 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/util/locale.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/locale.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/locale.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/locale.cpp Tue Jun 26 16:58:07 2007
@@ -37,8 +37,12 @@
#ifndef _MSC_VER
# include <sys/mman.h> // for mmap()
# include <unistd.h> // for close ()
-# include <iconv.h>
-# include <langinfo.h>
+# ifndef _RWSTD_NO_ICONV
+# include <iconv.h>
+# endif
+# ifndef _RWSTD_NO_NL_LANGINFO
+# include <langinfo.h>
+# endif
#else
# include <io.h> // for open()
# include <windows.h>
Modified: incubator/stdcxx/branches/4.2.0/util/localedef.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/localedef.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/localedef.h (original)
+++ incubator/stdcxx/branches/4.2.0/util/localedef.h Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* localedef.h
*
- * $Id: //stdlib/dev/source/stdlib/util/localedef.h#93 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/util/memchk.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/memchk.h?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/memchk.h (original)
+++ incubator/stdcxx/branches/4.2.0/util/memchk.h Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* memchk.cpp - declarations of memory checking helper functions
*
- * $Id: //stdlib/dev/source/stdlib/util/memchk.h#2 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/
Modified: incubator/stdcxx/branches/4.2.0/util/output.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/output.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/output.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/output.cpp Tue Jun 26 16:58:07 2007
@@ -58,10 +58,14 @@
static void
check_test (FILE* data, struct target_status* status)
{
- unsigned r_lvl = 0, r_active = 0, r_total = 0;
- int fmt_ok = 0;
- unsigned fsm = 0;
- char tok;
+ unsigned r_lvl = 0; /* diagnostic severity level */
+ unsigned r_active = 0; /* number of active diagnostics */
+ unsigned r_total = 0; /* total number of diagnostics */
+
+ int fmt_ok = 0; /* is output format okay? */
+
+ unsigned fsm = 0; /* state */
+ char tok; /* current character */
const char* const target_name = get_target ();
@@ -69,7 +73,15 @@
assert (0 != data);
assert (0 != status);
- for (tok = fgetc (data); fsm < 6 && !feof (data); tok = fgetc (data)) {
+ tok = fgetc (data);
+
+ if (feof (data)) {
+ /* target produced no output (regression test?) */
+ status->status = ST_NO_OUTPUT;
+ return;
+ }
+
+ for ( ; fsm < 6 && !feof (data); tok = fgetc (data)) {
switch (tok) {
case '\n':
fsm = 1;
@@ -145,7 +157,15 @@
assert (0 != data);
assert (0 != status);
- for (tok = fgetc (data); !feof (data); tok = fgetc (data)) {
+ tok = fgetc (data);
+
+ if (feof (data)) {
+ /* target produced no output (regression test?) */
+ status->status = ST_NO_OUTPUT;
+ return;
+ }
+
+ for ( ; !feof (data); tok = fgetc (data)) {
switch (tok) {
case '\n':
fsm = 1;
Modified: incubator/stdcxx/branches/4.2.0/util/path.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/util/path.cpp?view=diff&rev=550991&r1=550990&r2=550991
==============================================================================
--- incubator/stdcxx/branches/4.2.0/util/path.cpp (original)
+++ incubator/stdcxx/branches/4.2.0/util/path.cpp Tue Jun 26 16:58:07 2007
@@ -2,20 +2,27 @@
*
* path.cpp
*
- * $Id: //stdlib/dev/source/stdlib/util/path.cpp#5 $
+ * $Id$
*
***************************************************************************
*
- * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave
- * Software division. Licensed 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.
+ * 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.
+ *
+ * Copyright 1994-2006 Rogue Wave Software.
*
**************************************************************************/