Browse Source

fix test to work even if CPPFLAGS contains -DNDEBUG

Mike Frysinger 17 years ago
parent
commit
ddea243aab
1 changed files with 4 additions and 4 deletions
  1. 4 4
      test/assert/assert.c

+ 4 - 4
test/assert/assert.c

@@ -6,6 +6,8 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
+#undef NDEBUG
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -14,7 +16,7 @@
 
 int got_abort;
 
-void aborthandler(int junk)
+static void aborthandler(int junk)
 {
 	got_abort = 1;
 }
@@ -29,9 +31,7 @@ int main(int argc, char *argv[])
 	assert(0 == 0);
 	TEST_NUMERIC(got_abort, 0);
 
-#ifndef NDEBUG
-# define NDEBUG
-#endif
+#define NDEBUG
 	got_abort = 0;
 	printf("Don't worry -- This next test is supposed to print an assert message:\n");
 	fprintf(stderr, "\t");