Changeset: 76ac28656451 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76ac28656451
Modified Files:
gdk/gdk_bat.c
gdk/gdk_bbp.c
Branch: default
Log Message:
Enable property checking when assertions are disabled.
When a property check fails, we will then get a warning message on the
server console.
Also, property checking is now really only enabled when the
appropriate debug mask is set.
diffs (56 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2792,7 +2792,12 @@ BATmode(BAT *b, int mode)
* "set" property is not checked. Also note that the "nil" property
* is not actually used anywhere, but it is checked. */
-#ifndef NDEBUG
+#ifdef NDEBUG
+/* assertions are disabled, turn failing tests into a message */
+#undef assert
+#define assert(test) ((void) ((test) || fprintf(stderr, "WARNING: %s:%d:
assertion `%s' failed\n", __FILE__, __LINE__, #test)))
+#endif
+
static void
BATassertHeadProps(BAT *b)
{
@@ -2978,7 +2983,6 @@ BATassertHeadProps(BAT *b)
assert(!b->H->nil || seennil);
}
}
-#endif
/* Assert that properties are set correctly.
*
@@ -3023,7 +3027,6 @@ BATassertHeadProps(BAT *b)
void
BATassertProps(BAT *b)
{
-#ifndef NDEBUG
BAT *bm;
int bbpstatus;
@@ -3049,9 +3052,6 @@ BATassertProps(BAT *b)
BATassertHeadProps(b);
if (b->H != bm->H)
BATassertHeadProps(bm);
-#else
- (void) b;
-#endif
}
/* derive properties that can be derived with a simple scan: sorted,
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2229,7 +2229,8 @@ BBPkeepref(bat i)
if ((b = BBPdescriptor(i)) != NULL) {
BATsettrivprop(b);
- BATassertProps(b);
+ if (GDKdebug & (CHECKMASK | PROPMASK))
+ BATassertProps(b);
}
incref(i, TRUE, lock);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list