summaryrefslogtreecommitdiff
path: root/test/unit/context
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/context')
-rw-r--r--test/unit/context/cdmap_black.h20
-rw-r--r--test/unit/context/cdmap_white.h11
-rw-r--r--test/unit/context/cdo_black.h2
-rw-r--r--test/unit/context/context_black.h8
-rw-r--r--test/unit/context/context_mm_black.h5
-rw-r--r--test/unit/context/context_white.h4
6 files changed, 23 insertions, 27 deletions
diff --git a/test/unit/context/cdmap_black.h b/test/unit/context/cdmap_black.h
index 6c5ecdf08..96c575218 100644
--- a/test/unit/context/cdmap_black.h
+++ b/test/unit/context/cdmap_black.h
@@ -18,12 +18,12 @@
#include <map>
-#include "base/cvc4_assert.h"
-#include "context/context.h"
+#include "base/check.h"
#include "context/cdhashmap.h"
#include "context/cdlist.h"
+#include "context/context.h"
+#include "test_utils.h"
-using CVC4::AssertionException;
using CVC4::context::Context;
using CVC4::context::CDHashMap;
@@ -163,10 +163,8 @@ class CDMapBlack : public CxxTest::TestSuite {
TS_ASSERT(
ElementsAre(map, {{1, 2}, {3, 4}, {5, 6}, {9, 8}, {23, 317}}));
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 317),
- AssertionException&);
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 472),
- AssertionException&);
+ TS_UTILS_EXPECT_ABORT(map.insertAtContextLevelZero(23, 317));
+ TS_UTILS_EXPECT_ABORT(map.insertAtContextLevelZero(23, 472));
map.insert(23, 472);
TS_ASSERT(
@@ -177,8 +175,7 @@ class CDMapBlack : public CxxTest::TestSuite {
TS_ASSERT(
ElementsAre(map, {{1, 2}, {3, 4}, {5, 6}, {9, 8}, {23, 472}}));
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0),
- AssertionException&);
+ TS_UTILS_EXPECT_ABORT(map.insertAtContextLevelZero(23, 0));
map.insert(23, 1024);
TS_ASSERT(
@@ -194,8 +191,7 @@ class CDMapBlack : public CxxTest::TestSuite {
TS_ASSERT(
ElementsAre(map, {{3, 4}, {5, 6}, {9, 8}, {23, 317}}));
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0),
- AssertionException&);
+ TS_UTILS_EXPECT_ABORT(map.insertAtContextLevelZero(23, 0));
map.insert(23, 477);
TS_ASSERT(
@@ -203,7 +199,7 @@ class CDMapBlack : public CxxTest::TestSuite {
d_context->pop();
}
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0), AssertionException&);
+ TS_UTILS_EXPECT_ABORT(map.insertAtContextLevelZero(23, 0));
TS_ASSERT(
ElementsAre(map, {{3, 4}, {23, 317}}));
diff --git a/test/unit/context/cdmap_white.h b/test/unit/context/cdmap_white.h
index 1a1f683bc..d22ecc7f1 100644
--- a/test/unit/context/cdmap_white.h
+++ b/test/unit/context/cdmap_white.h
@@ -16,8 +16,9 @@
#include <cxxtest/TestSuite.h>
-#include "base/cvc4_assert.h"
+#include "base/check.h"
#include "context/cdhashmap.h"
+#include "test_utils.h"
using namespace std;
using namespace CVC4;
@@ -38,12 +39,12 @@ class CDMapWhite : public CxxTest::TestSuite {
TS_ASSERT_THROWS_NOTHING(map.makeCurrent());
- TS_ASSERT_THROWS(map.update(), UnreachableCodeException&);
+ TS_UTILS_EXPECT_ABORT(map.update());
- TS_ASSERT_THROWS(map.save(d_context->getCMM()), UnreachableCodeException&);
- TS_ASSERT_THROWS(map.restore(&map), UnreachableCodeException&);
+ TS_UTILS_EXPECT_ABORT(map.save(d_context->getCMM()));
+ TS_UTILS_EXPECT_ABORT(map.restore(&map));
d_context->push();
- TS_ASSERT_THROWS(map.makeCurrent(), UnreachableCodeException&);
+ TS_UTILS_EXPECT_ABORT(map.makeCurrent());
}
};
diff --git a/test/unit/context/cdo_black.h b/test/unit/context/cdo_black.h
index 4f927abfc..4e1efb7b1 100644
--- a/test/unit/context/cdo_black.h
+++ b/test/unit/context/cdo_black.h
@@ -19,7 +19,7 @@
#include <iostream>
#include <vector>
-#include "base/cvc4_assert.h"
+#include "base/check.h"
#include "context/cdlist.h"
#include "context/cdo.h"
#include "context/context.h"
diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h
index 3659d3494..258c3fd9b 100644
--- a/test/unit/context/context_black.h
+++ b/test/unit/context/context_black.h
@@ -19,11 +19,11 @@
#include <iostream>
#include <vector>
-#include "base/cvc4_assert.h"
+#include "base/exception.h"
#include "context/cdlist.h"
#include "context/cdo.h"
#include "context/context.h"
-
+#include "test_utils.h"
using namespace std;
using namespace CVC4;
@@ -106,8 +106,8 @@ private:
d_context->push();
d_context->pop();
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(d_context->pop(), AssertionException&);
- TS_ASSERT_THROWS(d_context->pop(), AssertionException&);
+ TS_UTILS_EXPECT_ABORT(d_context->pop());
+ TS_UTILS_EXPECT_ABORT(d_context->pop());
#endif /* CVC4_ASSERTIONS */
}
diff --git a/test/unit/context/context_mm_black.h b/test/unit/context/context_mm_black.h
index 15f9b09de..cd5ff8242 100644
--- a/test/unit/context/context_mm_black.h
+++ b/test/unit/context/context_mm_black.h
@@ -22,8 +22,7 @@
#include <iostream>
#include "context/context_mm.h"
-
-#include "base/cvc4_assert.h"
+#include "test_utils.h"
using namespace std;
using namespace CVC4::context;
@@ -90,7 +89,7 @@ private:
}
// Try popping out of scope
- TS_ASSERT_THROWS(d_cmm->pop(), CVC4::AssertionException&);
+ TS_UTILS_EXPECT_ABORT(d_cmm->pop());
#endif /* __CVC4__CONTEXT__CONTEXT_MM_H */
}
diff --git a/test/unit/context/context_white.h b/test/unit/context/context_white.h
index 515ffb848..87ff73cce 100644
--- a/test/unit/context/context_white.h
+++ b/test/unit/context/context_white.h
@@ -16,9 +16,9 @@
#include <cxxtest/TestSuite.h>
-#include "base/cvc4_assert.h"
-#include "context/context.h"
+#include "base/check.h"
#include "context/cdo.h"
+#include "context/context.h"
using namespace std;
using namespace CVC4;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback