[patch, libstdc++, testsuite] Modify tests to use tmpnam()
Janis Johnson
janis187@us.ibm.com
Wed Mar 3 22:14:00 GMT 2010
On Wed, 2010-03-03 at 13:35 -0800, Steve Ellcey wrote:
> I took a look at two libstdc++ tests that are failing for me on IA64
> HP-UX and found that the problem was related to running the tests over
> NFS. Both tests are using mkfifo to create pipe's in the current
> working directory and that works for me on a local filesystem but fails
> over NFS. I am not sure if that is an HP-UX bug or not, but I would
> like to change the tests to use tmpnam to create the pipes, this fixes
> the problem on IA64 HP-UX and causes no regressions. There are already
> tests (27_io/headers/cstdio/macros.cc and
> 27_io/headers/cstdio/functions_std.cc) that check for the existence of
> the L_tmpnam macro and the tmpnam function so using them in these
> tests shouldn't be a problem.
>
> OK for checkin?
tmpnam is declared, and L_tmpnam is defined, in <cstdio> which is
already included in 9661-1.cc but not 7.cc. Unless there's an
objection from a libstdc++ maintainer the patch is OK if you
include <cstdio> in 7.cc.
Janis
>
> Steve Ellcey
> sje@cup.hp.com
>
> 2010-03-03 Steve Ellcey <sje@cup.hp.com>
>
> * testsuite/27_io/objects/wchar_t/7.cc: Use tmpnam.
> * testsuite/27_io/objects/wchar_t/9661-1.cc: Ditto.
>
>
> Index: testsuite/27_io/objects/wchar_t/7.cc
> ===================================================================
> --- testsuite/27_io/objects/wchar_t/7.cc (revision 157186)
> +++ testsuite/27_io/objects/wchar_t/7.cc (working copy)
> @@ -44,7 +44,8 @@ bool test07()
> using namespace __gnu_test;
> bool test __attribute__((unused)) = true;
>
> - const char* name = "tmp_fifo4";
> + char name[L_tmpnam];
> + tmpnam(name);
>
> signal(SIGPIPE, SIG_IGN);
>
> Index: testsuite/27_io/objects/wchar_t/9661-1.cc
> ===================================================================
> --- testsuite/27_io/objects/wchar_t/9661-1.cc (revision 157186)
> +++ testsuite/27_io/objects/wchar_t/9661-1.cc (working copy)
> @@ -44,7 +44,8 @@ bool test01()
>
> bool test __attribute__((unused)) = true;
>
> - const char* name = "tmp_fifo5";
> + char name[L_tmpnam];
> + tmpnam(name);
>
> signal(SIGPIPE, SIG_IGN);
>
More information about the Gcc-patches
mailing list