From patchwork Sat Jun 26 20:14:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] libstdc++-v3: add more verifications to testsuite Date: Sat, 26 Jun 2010 10:14:02 -0000 From: Paolo Carlini X-Patchwork-Id: 57067 Message-Id: <4C265F8A.2070306@oracle.com> To: Kees Cook Cc: gcc-patches@gcc.gnu.org On 06/26/2010 12:50 AM, Kees Cook wrote: > Hello, > > Here is a patch that adds additional tests to the libstdc++-v3 test suite. > Ubuntu builds packages with -D_FORTIFY_SOURCE=2, so running the suite > shows a few minor warnings. This cleans them up by providing additional > sanity checks around freopen, fgets, and fwrite, as already done in other > places in the testsuite. > > v2: > - Adjusted to not use "!= NULL", as recommended by Paolo Carlini. > Thanks, applied to mainline together with the below small tweak to testsuite_hooks.h (otherwise testsuite/27_io/objects/char/9661-1.cc spuriously fails) Paolo. ///////////////// Index: testsuite/util/testsuite_hooks.h =================================================================== --- testsuite/util/testsuite_hooks.h (revision 161439) +++ testsuite/util/testsuite_hooks.h (working copy) @@ -1,7 +1,8 @@ // -*- C++ -*- // Utility subroutines for the C++ library testsuite. // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +// 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -59,7 +60,7 @@ # include # define VERIFY(fn) assert(fn) #else -# define VERIFY(fn) test &= (fn) +# define VERIFY(fn) test &= bool(fn) #endif #ifdef _GLIBCXX_HAVE_UNISTD_H