summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-04-25 07:59:57 +0000
committerMorgan Deters <mdeters@gmail.com>2011-04-25 07:59:57 +0000
commitde164c9308f6461472b95c23aae68d9d9686d8ae (patch)
tree01d3796de59abe09fc05b043179840a915988f87 /test
parentcb7363eef352200615e1a0d3729cea8b2c74d265 (diff)
small unit test fix; was broken only in non-assertion, non-CLN builds
Diffstat (limited to 'test')
-rw-r--r--test/unit/util/integer_black.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/util/integer_black.h b/test/unit/util/integer_black.h
index 66e29a01b..5b8397f66 100644
--- a/test/unit/util/integer_black.h
+++ b/test/unit/util/integer_black.h
@@ -300,11 +300,25 @@ public:
unsigned long ul = numeric_limits<unsigned long>::max();
Integer i(ul);
TS_ASSERT(i.getUnsignedLong() == ul);
+#if defined(CVC4_ASSERTIONS) || defined(CVC4_CLN_IMP)
+ // CLN comes with exceptions built-in, and in assertion-enabled
+ // GMP builds, we check it
TS_ASSERT_THROWS_ANYTHING(i.getLong());
+#else /* CVC4_ASSERTIONS || CVC4_CLN_IMP */
+ // otherwise we look for the expected overflow; if it doesn't
+ // happen, something's fishy...
+ TS_ASSERT( Integer(i.getLong()) != i );
+#endif /* CVC4_ASSERTIONS || CVC4_CLN_IMP */
unsigned long ulplus1 = ul + 1;
TS_ASSERT(ulplus1 == 0);
i = i + 1;
+#if defined(CVC4_ASSERTIONS) || defined(CVC4_CLN_IMP)
+ // again, CLN || assertions will throw...
TS_ASSERT_THROWS_ANYTHING(i.getUnsignedLong());
+#else /* CVC4_ASSERTIONS || CVC4_CLN_IMP */
+ // otherwise expect the overflow
+ TS_ASSERT( Integer(i.getUnsignedLong()) != i );
+#endif /* CVC4_ASSERTIONS || CVC4_CLN_IMP */
}
void testTestBit() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback