From b6767a49b4b4ad83418462aa67ab7432a382e51a Mon Sep 17 00:00:00 2001 From: Brent Verner Date: Mon, 14 Aug 2000 20:56:06 +0000 Subject: [PATCH] debug_assert.h: new file 2000-08-14 Brent Verner * testsuite/debug_assert.h: new file * testsuite/*/*.cc: s/test\s*&=([^;]+);/VERIFY($1);/g changed conditional #include to unconditional #include * mkcheck.in: added $SRC_DIR/testsuite to include search path for testsuite compile command. From-SVN: r35688 --- libstdc++-v3/testsuite/debug_assert.h | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 libstdc++-v3/testsuite/debug_assert.h diff --git a/libstdc++-v3/testsuite/debug_assert.h b/libstdc++-v3/testsuite/debug_assert.h new file mode 100644 index 00000000000..dbd6e984056 --- /dev/null +++ b/libstdc++-v3/testsuite/debug_assert.h @@ -0,0 +1,51 @@ +// 20000810 Brent Verner +// +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. +// +// +// Purpose: +// This file is included in the various testsuite programs to provide +// #define(able) assert() behavior for debugging/testing. It may be +// a suitable location for other furry woodland creatures as well. +// +// Notes: +// If you find yourself compiling small test progs as much as I +// do, you can move this file to a location your compiler(s) +// will find, and possibly add more cheap debugging stuff... +// + +#ifndef _CPP_DEBUG_ASSERT_H +#define _CPP_DEBUG_ASSERT_H + +#ifdef DEBUG_ASSERT +# include +# define VERIFY(fn) assert(fn) + +#else +# define VERIFY(fn) test &= (fn) +// should we define this here to make sure no 'unexpected' failures +// happen, or do we require that it be defined in any scope where +// the VERIFY macro is used??? +// +// static bool test = true; +#endif + + +#endif // _CPP_DEBUG_ASSERT_H + -- 2.30.2