aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Verner <brent@rcfile.org>2000-08-14 20:56:06 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2000-08-14 20:56:06 +0000
commitb6767a49b4b4ad83418462aa67ab7432a382e51a (patch)
treecec8fbc5f766f37fb828c98249647ace0bbc4fca
parente49a1d2e073c02fafe4fc80147966c1f0c11488f (diff)
downloadgcc-b6767a49b4b4ad83418462aa67ab7432a382e51a.zip
gcc-b6767a49b4b4ad83418462aa67ab7432a382e51a.tar.gz
gcc-b6767a49b4b4ad83418462aa67ab7432a382e51a.tar.bz2
debug_assert.h: new file
2000-08-14 Brent Verner <brent@rcfile.org> * testsuite/debug_assert.h: new file * testsuite/*/*.cc: s/test\s*&=([^;]+);/VERIFY($1);/g changed conditional #include <c?assert.?h?> to unconditional #include <debug_assert.h> * mkcheck.in: added $SRC_DIR/testsuite to include search path for testsuite compile command. From-SVN: r35688
-rw-r--r--libstdc++-v3/testsuite/debug_assert.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/debug_assert.h b/libstdc++-v3/testsuite/debug_assert.h
new file mode 100644
index 0000000..dbd6e98
--- /dev/null
+++ b/libstdc++-v3/testsuite/debug_assert.h
@@ -0,0 +1,51 @@
+// 20000810 Brent Verner <brent@rcfile.org>
+//
+// 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 <cassert>
+# 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
+