{
// We cap it at UINT_MAX, preferring to terminate with a
// failure than run indefinitely.
- for (unsigned i = 0; i < UINT_MAX; ++i) {
+ for (unsigned i = 0; i < UINT_MAX; ++i)
+ {
list.push_back(i);
}
},
- bad_alloc);
+ bad_alloc&);
#endif /* CVC4_MEMORY_LIMITING_DISABLED */
}
ElementsAre(map, {{1, 2}, {3, 4}, {5, 6}, {9, 8}, {23, 317}}));
TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 317),
- AssertionException);
+ AssertionException&);
TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 472),
- AssertionException);
+ AssertionException&);
map.insert(23, 472);
TS_ASSERT(
ElementsAre(map, {{1, 2}, {3, 4}, {5, 6}, {9, 8}, {23, 472}}));
TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0),
- AssertionException);
+ AssertionException&);
map.insert(23, 1024);
TS_ASSERT(
TS_ASSERT(
ElementsAre(map, {{3, 4}, {5, 6}, {9, 8}, {23, 317}}));
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0), AssertionException);
+ TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0),
+ AssertionException&);
map.insert(23, 477);
TS_ASSERT(
d_context->pop();
}
- TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0), AssertionException);
+ TS_ASSERT_THROWS(map.insertAtContextLevelZero(23, 0), AssertionException&);
TS_ASSERT(
ElementsAre(map, {{3, 4}, {23, 317}}));
TS_ASSERT_THROWS_NOTHING(map.makeCurrent());
- TS_ASSERT_THROWS(map.update(), UnreachableCodeException);
+ TS_ASSERT_THROWS(map.update(), UnreachableCodeException&);
- TS_ASSERT_THROWS(map.save(d_context->getCMM()), UnreachableCodeException);
- TS_ASSERT_THROWS(map.restore(&map), UnreachableCodeException);
+ TS_ASSERT_THROWS(map.save(d_context->getCMM()), UnreachableCodeException&);
+ TS_ASSERT_THROWS(map.restore(&map), UnreachableCodeException&);
d_context->push();
- TS_ASSERT_THROWS(map.makeCurrent(), UnreachableCodeException);
+ TS_ASSERT_THROWS(map.makeCurrent(), UnreachableCodeException&);
}
};
d_context->push();
d_context->pop();
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS( d_context->pop(), AssertionException );
- TS_ASSERT_THROWS( d_context->pop(), AssertionException );
+ TS_ASSERT_THROWS(d_context->pop(), AssertionException&);
+ TS_ASSERT_THROWS(d_context->pop(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
}
// Try popping out of scope
- TS_ASSERT_THROWS(d_cmm->pop(), CVC4::AssertionException);
+ TS_ASSERT_THROWS(d_cmm->pop(), CVC4::AssertionException&);
#endif /* __CVC4__CONTEXT__CONTEXT_MM_H */
}
{
delete d_exprManager;
}
- catch (Exception e)
+ catch (Exception& e)
{
cerr << "Exception during tearDown():" << endl << e;
throw;
void testMkAssociativeTooFew() {
std::vector<Expr> vars = mkVars(d_exprManager->booleanType(), 1);
- TS_ASSERT_THROWS( d_exprManager->mkAssociative(AND,vars), IllegalArgumentException);
+ TS_ASSERT_THROWS(d_exprManager->mkAssociative(AND, vars),
+ IllegalArgumentException&);
}
void testMkAssociativeBadKind() {
std::vector<Expr> vars = mkVars(d_exprManager->integerType(), 10);
- TS_ASSERT_THROWS( d_exprManager->mkAssociative(LEQ,vars), IllegalArgumentException);
+ TS_ASSERT_THROWS(d_exprManager->mkAssociative(LEQ, vars),
+ IllegalArgumentException&);
}
};
r1 = new Expr(d_em->mkConst(Rational(1, 5)));
r2 = new Expr(d_em->mkConst(Rational("0")));
}
- catch (Exception e)
+ catch (Exception& e)
{
cerr << "Exception during setUp():" << endl << e;
throw;
delete a_bool;
delete d_em;
- } catch(Exception e) {
+ }
+ catch (Exception& e)
+ {
cerr << "Exception during tearDown():" << endl << e;
throw;
}
TS_ASSERT(d_apply_fun_bool->hasOperator());
TS_ASSERT(!null->hasOperator());
- TS_ASSERT_THROWS(a_bool->getOperator(), IllegalArgumentException);
- TS_ASSERT_THROWS(b_bool->getOperator(), IllegalArgumentException);
+ TS_ASSERT_THROWS(a_bool->getOperator(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(b_bool->getOperator(), IllegalArgumentException&);
TS_ASSERT(c_bool_and->getOperator() == *and_op);
- TS_ASSERT_THROWS(plus_op->getOperator(), IllegalArgumentException);
- TS_ASSERT_THROWS(and_op->getOperator(), IllegalArgumentException);
+ TS_ASSERT_THROWS(plus_op->getOperator(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(and_op->getOperator(), IllegalArgumentException&);
TS_ASSERT(d_apply_fun_bool->getOperator() == *fun_op);
- TS_ASSERT_THROWS(null->getOperator(), IllegalArgumentException);
+ TS_ASSERT_THROWS(null->getOperator(), IllegalArgumentException&);
}
void testGetType() {
TS_ASSERT(a_bool->getType(true) == d_em->booleanType());
TS_ASSERT(b_bool->getType(false) == d_em->booleanType());
TS_ASSERT(b_bool->getType(true) == d_em->booleanType());
- TS_ASSERT_THROWS(d_em->mkExpr(MULT,*a_bool,*b_bool).getType(true),
- TypeCheckingException);
-// These need better support for operators
-// TS_ASSERT(and_op->getType().isNull());
-// TS_ASSERT(plus_op->getType().isNull());
+ TS_ASSERT_THROWS(d_em->mkExpr(MULT, *a_bool, *b_bool).getType(true),
+ TypeCheckingException&);
+ // These need better support for operators
+ // TS_ASSERT(and_op->getType().isNull());
+ // TS_ASSERT(plus_op->getType().isNull());
TS_ASSERT(d_apply_fun_bool->getType() == d_em->booleanType());
TS_ASSERT(i1->getType().isInteger());
TS_ASSERT(i2->getType().isInteger());
/* template <class T>
const T& getConst() const; */
- TS_ASSERT_THROWS(a_bool->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(b_bool->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(c_bool_and->getConst<Kind>(), IllegalArgumentException);
+ TS_ASSERT_THROWS(a_bool->getConst<Kind>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(b_bool->getConst<Kind>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(c_bool_and->getConst<Kind>(), IllegalArgumentException&);
TS_ASSERT(and_op->getConst<Kind>() == AND);
- TS_ASSERT_THROWS(and_op->getConst<Rational>(), IllegalArgumentException);
+ TS_ASSERT_THROWS(and_op->getConst<Rational>(), IllegalArgumentException&);
TS_ASSERT(plus_op->getConst<Kind>() == PLUS);
- TS_ASSERT_THROWS(plus_op->getConst<Rational>(), IllegalArgumentException);
- TS_ASSERT_THROWS(d_apply_fun_bool->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(null->getConst<Kind>(), IllegalArgumentException);
+ TS_ASSERT_THROWS(plus_op->getConst<Rational>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(d_apply_fun_bool->getConst<Kind>(),
+ IllegalArgumentException&);
+ TS_ASSERT_THROWS(null->getConst<Kind>(), IllegalArgumentException&);
TS_ASSERT(i1->getConst<Rational>() == 0);
TS_ASSERT(i2->getConst<Rational>() == 23);
TS_ASSERT(r1->getConst<Rational>() == Rational(1, 5));
TS_ASSERT(r2->getConst<Rational>() == Rational("0"));
- TS_ASSERT_THROWS(i1->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(i2->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(r1->getConst<Kind>(), IllegalArgumentException);
- TS_ASSERT_THROWS(r2->getConst<Kind>(), IllegalArgumentException);
+ TS_ASSERT_THROWS(i1->getConst<Kind>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(i2->getConst<Kind>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(r1->getConst<Kind>(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(r2->getConst<Kind>(), IllegalArgumentException&);
}
void testGetExprManager() {
TS_ASSERT(!(AND ^ AND ^ AND).isEmpty());
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(~LAST_KIND, AssertArgumentException);
+ TS_ASSERT_THROWS(~LAST_KIND, AssertArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
// Basic bounds check on a node w/out children
- TS_ASSERT_THROWS(Node::null()[-1], AssertionException);
- TS_ASSERT_THROWS(Node::null()[0], AssertionException);
+ TS_ASSERT_THROWS(Node::null()[-1], AssertionException&);
+ TS_ASSERT_THROWS(Node::null()[0], AssertionException&);
#endif /* CVC4_ASSERTIONS */
// Basic access check
#ifdef CVC4_ASSERTIONS
// Bounds check on a node with children
- TS_ASSERT_THROWS(ite == ite[-1], AssertionException);
- TS_ASSERT_THROWS(ite == ite[4], AssertionException);
+ TS_ASSERT_THROWS(ite == ite[-1], AssertionException&);
+ TS_ASSERT_THROWS(ite == ite[4], AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
TS_ASSERT(f == fa.getOperator());
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(f.getOperator(), IllegalArgumentException);
- TS_ASSERT_THROWS(a.getOperator(), IllegalArgumentException);
+ TS_ASSERT_THROWS(f.getOperator(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(a.getOperator(), IllegalArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
}
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(testNaryExpForSize(AND, 0), AssertionException);
- TS_ASSERT_THROWS(testNaryExpForSize(AND, 1), AssertionException);
- TS_ASSERT_THROWS(testNaryExpForSize(NOT, 0), AssertionException);
- TS_ASSERT_THROWS(testNaryExpForSize(NOT, 2), AssertionException);
+ TS_ASSERT_THROWS(testNaryExpForSize(AND, 0), AssertionException&);
+ TS_ASSERT_THROWS(testNaryExpForSize(AND, 1), AssertionException&);
+ TS_ASSERT_THROWS(testNaryExpForSize(NOT, 0), AssertionException&);
+ TS_ASSERT_THROWS(testNaryExpForSize(NOT, 2), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
NodeBuilder<> def;
TS_ASSERT_EQUALS(def.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(def.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(def.begin(), AssertionException);
- TS_ASSERT_THROWS(def.end(), AssertionException);
+ TS_ASSERT_THROWS(def.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(def.begin(), AssertionException&);
+ TS_ASSERT_THROWS(def.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> spec(specKind);
NodeBuilder<> from_nm(d_nm);
TS_ASSERT_EQUALS(from_nm.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(from_nm.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(from_nm.begin(), AssertionException);
- TS_ASSERT_THROWS(from_nm.end(), AssertionException);
+ TS_ASSERT_THROWS(from_nm.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(from_nm.begin(), AssertionException&);
+ TS_ASSERT_THROWS(from_nm.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> from_nm_kind(d_nm, specKind);
NodeBuilder<K> ws;
TS_ASSERT_EQUALS(ws.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(ws.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(ws.begin(), AssertionException);
- TS_ASSERT_THROWS(ws.end(), AssertionException);
+ TS_ASSERT_THROWS(ws.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(ws.begin(), AssertionException&);
+ TS_ASSERT_THROWS(ws.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<K> ws_kind(specKind);
NodeBuilder<K> ws_from_nm(d_nm);
TS_ASSERT_EQUALS(ws_from_nm.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(ws_from_nm.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(ws_from_nm.begin(), AssertionException);
- TS_ASSERT_THROWS(ws_from_nm.end(), AssertionException);
+ TS_ASSERT_THROWS(ws_from_nm.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(ws_from_nm.begin(), AssertionException&);
+ TS_ASSERT_THROWS(ws_from_nm.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<K> ws_from_nm_kind(d_nm, specKind);
NodeBuilder<> copy(def);
TS_ASSERT_EQUALS(copy.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(copy.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(copy.begin(), AssertionException);
- TS_ASSERT_THROWS(copy.end(), AssertionException);
+ TS_ASSERT_THROWS(copy.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(copy.begin(), AssertionException&);
+ TS_ASSERT_THROWS(copy.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<K> cp_ws(ws);
TS_ASSERT_EQUALS(cp_ws.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(cp_ws.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(cp_ws.begin(), AssertionException);
- TS_ASSERT_THROWS(cp_ws.end(), AssertionException);
+ TS_ASSERT_THROWS(cp_ws.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(cp_ws.begin(), AssertionException&);
+ TS_ASSERT_THROWS(cp_ws.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<K-10> cp_from_larger(ws);
TS_ASSERT_EQUALS(cp_from_larger.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(cp_from_larger.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(cp_from_larger.begin(), AssertionException);
- TS_ASSERT_THROWS(cp_from_larger.end(), AssertionException);
+ TS_ASSERT_THROWS(cp_from_larger.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(cp_from_larger.begin(), AssertionException&);
+ TS_ASSERT_THROWS(cp_from_larger.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<K+10> cp_from_smaller(ws);
TS_ASSERT_EQUALS(cp_from_smaller.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(cp_from_smaller.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(cp_from_smaller.begin(), AssertionException);
- TS_ASSERT_THROWS(cp_from_smaller.end(), AssertionException);
+ TS_ASSERT_THROWS(cp_from_smaller.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(cp_from_smaller.begin(), AssertionException&);
+ TS_ASSERT_THROWS(cp_from_smaller.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
Node n = noKind;
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(noKind.getKind(), AssertionException);
+ TS_ASSERT_THROWS(noKind.getKind(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> spec(PLUS);
NodeBuilder<> nb;
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException);
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
nb << PLUS << x << x;
Node n = nb;// avoid warning on clear()
nb.clear();
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException);
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
nb.clear(PLUS);
TS_ASSERT_EQUALS(nb.getNumChildren(), 0u);
TS_ASSERT_EQUALS(nb.getNumChildren(), 6u);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS( nb << PLUS, AssertionException );
+ TS_ASSERT_THROWS(nb << PLUS, AssertionException&);
n = nb;
- TS_ASSERT_THROWS( nb.getNumChildren(), AssertionException );
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
TS_ASSERT_THROWS(arr[-1], AssertionException&);
- TS_ASSERT_THROWS(arr[0], AssertionException);
+ TS_ASSERT_THROWS(arr[0], AssertionException&);
#endif /* CVC4_ASSERTIONS */
arr << i_0;
#ifdef CVC4_ASSERTIONS
Node n = arr;
- TS_ASSERT_THROWS(arr[0], AssertionException);
+ TS_ASSERT_THROWS(arr[0], AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(nb.begin(), AssertionException);
- TS_ASSERT_THROWS(nb.end(), AssertionException);
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(nb.begin(), AssertionException&);
+ TS_ASSERT_THROWS(nb.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
nb << specKind;
TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(nb.begin(), AssertionException);
- TS_ASSERT_THROWS(nb.end(), AssertionException);
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(nb.begin(), AssertionException&);
+ TS_ASSERT_THROWS(nb.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
nb << specKind;
TS_ASSERT_EQUALS(nb.getKind(), UNDEFINED_KIND);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException);
- TS_ASSERT_THROWS(nb.begin(), AssertionException);
- TS_ASSERT_THROWS(nb.end(), AssertionException);
+ TS_ASSERT_THROWS(nb.getNumChildren(), AssertionException&);
+ TS_ASSERT_THROWS(nb.begin(), AssertionException&);
+ TS_ASSERT_THROWS(nb.end(), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
NodeBuilder<> spec(specKind);
- TS_ASSERT_THROWS( spec << PLUS, AssertionException );
+ TS_ASSERT_THROWS(spec << PLUS, AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> noSpec;
nb.clear(PLUS);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(n = nb, AssertionException);
+ TS_ASSERT_THROWS(n = nb, AssertionException&);
nb.clear(PLUS);
#endif /* CVC4_ASSERTIONS */
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS( nb << PLUS, AssertionException );
+ TS_ASSERT_THROWS(nb << PLUS, AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> testRef;
#ifdef CVC4_ASSERTIONS
NodeBuilder<> testTwo;
- TS_ASSERT_THROWS(testTwo << specKind << PLUS, AssertionException);
+ TS_ASSERT_THROWS(testTwo << specKind << PLUS, AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> testMixOrder1;
#ifdef CVC4_ASSERTIONS
Node n = nb;
- TS_ASSERT_THROWS(nb << n, AssertionException);
+ TS_ASSERT_THROWS(nb << n, AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> overflow(specKind);
Node q = d_nm->mkNode(AND, x, z, d_nm->mkNode(NOT, y));
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(d_nm->mkNode(XOR, y, x, x), AssertionException);
+ TS_ASSERT_THROWS(d_nm->mkNode(XOR, y, x, x), AssertionException&);
#endif /* CVC4_ASSERTIONS */
NodeBuilder<> b(specKind);
TS_ASSERT_EQUALS(nexplicit.getNumChildren(), K);
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(Node blah = implicit, AssertionException);
+ TS_ASSERT_THROWS(Node blah = implicit, AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
void testMkNodeTooFew() {
#ifdef CVC4_ASSERTIONS
Node x = d_nodeManager->mkSkolem( "x", d_nodeManager->booleanType() );
- TS_ASSERT_THROWS( d_nodeManager->mkNode(AND, x), AssertionException );
+ TS_ASSERT_THROWS(d_nodeManager->mkNode(AND, x), AssertionException&);
#endif
}
vars.push_back(skolem_j);
vars.push_back(orNode);
}
- TS_ASSERT_THROWS(d_nodeManager->mkNode(AND, vars), AssertionException);
+ TS_ASSERT_THROWS(d_nodeManager->mkNode(AND, vars), AssertionException&);
#endif
}
};
TS_ASSERT_THROWS_NOTHING(nb.realloc(25));
TS_ASSERT_THROWS_NOTHING(nb.realloc(256));
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.realloc(100), AssertionException);
+ TS_ASSERT_THROWS(nb.realloc(100), AssertionException&);
#endif /* CVC4_ASSERTIONS */
TS_ASSERT_THROWS_NOTHING(nb.realloc(257));
TS_ASSERT_THROWS_NOTHING(nb.realloc(4000));
TS_ASSERT_THROWS_NOTHING(nb.realloc(65536));
TS_ASSERT_THROWS_NOTHING(nb.realloc(67108863));
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS(nb.realloc(67108863), AssertionException);
+ TS_ASSERT_THROWS(nb.realloc(67108863), AssertionException&);
#endif /* CVC4_ASSERTIONS */
}
};
{
d_exprManager = new ExprManager;
}
- catch (Exception e)
+ catch (Exception& e)
{
cerr << "Exception during setUp():" << endl << e;
throw;
{
try {
delete d_exprManager;
- } catch(Exception e) {
+ }
+ catch (Exception& e)
+ {
cerr << "Exception during tearDown():" << endl << e;
throw;
}
void testBadPop() {
SymbolTable symtab;
// TODO: What kind of exception gets thrown here?
- TS_ASSERT_THROWS( symtab.popScope(), ScopeException );
+ TS_ASSERT_THROWS(symtab.popScope(), ScopeException&);
}
};/* class SymbolTableBlack */
LogicInfo info;
TS_ASSERT( !info.isLocked() );
- TS_ASSERT_THROWS( info.getLogicString(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_BUILTIN ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_BOOL ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_UF ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_ARITH ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_ARRAYS ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_BV ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_DATATYPES ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isTheoryEnabled( THEORY_QUANTIFIERS ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_BUILTIN ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_BOOL ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_UF ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_ARITH ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_ARRAYS ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_BV ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_DATATYPES ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( ! info.isPure( THEORY_QUANTIFIERS ), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.isQuantified(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.areIntegersUsed(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.areRealsUsed(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( !info.isLinear(), CVC4::IllegalArgumentException );
+ TS_ASSERT_THROWS(info.getLogicString(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_BUILTIN),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_BOOL),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_UF),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_ARITH),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_ARRAYS),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_BV),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_DATATYPES),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isTheoryEnabled(THEORY_QUANTIFIERS),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_BUILTIN),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_BOOL),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_UF), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_ARITH),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_ARRAYS),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_BV), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_DATATYPES),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isPure(THEORY_QUANTIFIERS),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isQuantified(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areIntegersUsed(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areRealsUsed(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(!info.isLinear(), CVC4::IllegalArgumentException&);
info.lock();
TS_ASSERT( info.isLocked() );
TS_ASSERT(info.areTranscendentalsUsed());
TS_ASSERT( !info.isLinear() );
- TS_ASSERT_THROWS( info.arithOnlyLinear(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableIntegers(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableQuantifiers(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableTheory(THEORY_BV), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableTheory(THEORY_DATATYPES), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.enableIntegers(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableReals(), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableTheory(THEORY_ARITH), CVC4::IllegalArgumentException );
- TS_ASSERT_THROWS( info.disableTheory(THEORY_UF), CVC4::IllegalArgumentException );
+ TS_ASSERT_THROWS(info.arithOnlyLinear(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableIntegers(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableQuantifiers(),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableTheory(THEORY_BV),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableTheory(THEORY_DATATYPES),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.enableIntegers(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableReals(), CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableTheory(THEORY_ARITH),
+ CVC4::IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.disableTheory(THEORY_UF),
+ CVC4::IllegalArgumentException&);
info = info.getUnlockedCopy();
TS_ASSERT( !info.isLocked() );
TS_ASSERT( !info.isTheoryEnabled( THEORY_BV ) );
TS_ASSERT( !info.isTheoryEnabled( THEORY_DATATYPES ) );
TS_ASSERT( info.isTheoryEnabled( THEORY_BOOL ) );
- TS_ASSERT_THROWS( info.isLinear(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.areIntegersUsed(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.isDifferenceLogic(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.areRealsUsed(), IllegalArgumentException );
- TS_ASSERT_THROWS(info.areTranscendentalsUsed(), IllegalArgumentException);
+ TS_ASSERT_THROWS(info.isLinear(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areIntegersUsed(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isDifferenceLogic(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areRealsUsed(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areTranscendentalsUsed(), IllegalArgumentException&);
// check copy is unchanged
info = info.getUnlockedCopy();
TS_ASSERT( !info.isTheoryEnabled( THEORY_BV ) );
TS_ASSERT( !info.isTheoryEnabled( THEORY_DATATYPES ) );
TS_ASSERT( info.isTheoryEnabled( THEORY_BOOL ) );
- TS_ASSERT_THROWS( info.isLinear(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.areIntegersUsed(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.isDifferenceLogic(), IllegalArgumentException );
- TS_ASSERT_THROWS( info.areRealsUsed(), IllegalArgumentException );
- TS_ASSERT_THROWS(info.areTranscendentalsUsed(), IllegalArgumentException);
+ TS_ASSERT_THROWS(info.isLinear(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areIntegersUsed(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.isDifferenceLogic(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areRealsUsed(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(info.areTranscendentalsUsed(), IllegalArgumentException&);
// check all-included logic
info = info.getUnlockedCopy();
TS_ASSERT( ! te.isFinished() );
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(true));
TS_ASSERT( ! te.isFinished() );
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
TS_ASSERT( te.isFinished() );
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
TS_ASSERT( te.isFinished() );
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
TS_ASSERT( te.isFinished() );
}
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, DatatypeType(datatype.toType()).getDatatype().getConstructor("green")));
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, DatatypeType(datatype.toType()).getDatatype().getConstructor("blue")));
TS_ASSERT_EQUALS(*++te, d_nm->mkNode(APPLY_CONSTRUCTOR, DatatypeType(datatype.toType()).getDatatype().getConstructor("violet")));
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
}
void testDatatypesInfinite1() {
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(BitVector(3u, 5u)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(BitVector(3u, 6u)));
TS_ASSERT_EQUALS(*++te, d_nm->mkConst(BitVector(3u, 7u)));
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
- TS_ASSERT_THROWS(*++te, NoMoreValuesException);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
+ TS_ASSERT_THROWS(*++te, NoMoreValuesException&);
}
};/* class TypeEnumeratorWhite */
TS_ASSERT_THROWS(
ArrayStoreAll(d_em->mkArrayType(d_em->integerType(), d_em->mkSort("U")),
d_em->mkConst(Rational(9, 2))),
- IllegalArgumentException);
+ IllegalArgumentException&);
}
void testConstError() {
void testAssert() {
#ifdef CVC4_ASSERTIONS
- TS_ASSERT_THROWS( Assert(false), AssertionException );
- TS_ASSERT_THROWS( AssertArgument(false, "x"), AssertArgumentException );
+ TS_ASSERT_THROWS(Assert(false), AssertionException&);
+ TS_ASSERT_THROWS(AssertArgument(false, "x"), AssertArgumentException&);
#else /* CVC4_ASSERTIONS */
TS_ASSERT_THROWS_NOTHING( Assert(false) );
TS_ASSERT_THROWS_NOTHING( AssertArgument(false, "x") );
#endif /* CVC4_ASSERTIONS */
TS_ASSERT_THROWS_NOTHING( Assert(true) );
- TS_ASSERT_THROWS( AlwaysAssert(false), AssertionException );
- TS_ASSERT_THROWS( Unreachable(), UnreachableCodeException );
- TS_ASSERT_THROWS( Unhandled(), UnhandledCaseException );
- TS_ASSERT_THROWS( Unimplemented(), UnimplementedOperationException );
- TS_ASSERT_THROWS( IllegalArgument("x"), IllegalArgumentException );
- TS_ASSERT_THROWS( CheckArgument(false, "x"), IllegalArgumentException );
- TS_ASSERT_THROWS( AlwaysAssertArgument(false, "x"),
- AssertArgumentException );
+ TS_ASSERT_THROWS(AlwaysAssert(false), AssertionException&);
+ TS_ASSERT_THROWS(Unreachable(), UnreachableCodeException&);
+ TS_ASSERT_THROWS(Unhandled(), UnhandledCaseException&);
+ TS_ASSERT_THROWS(Unimplemented(), UnimplementedOperationException&);
+ TS_ASSERT_THROWS(IllegalArgument("x"), IllegalArgumentException&);
+ TS_ASSERT_THROWS(CheckArgument(false, "x"), IllegalArgumentException&);
+ TS_ASSERT_THROWS(AlwaysAssertArgument(false, "x"),
+ AssertArgumentException&);
TS_ASSERT_THROWS_NOTHING( AssertArgument(true, "x") );
TS_ASSERT_THROWS_NOTHING( AssertArgument(true, "x") );
}
}
void testUnreachable() {
- TS_ASSERT_THROWS( Unreachable(), UnreachableCodeException );
- TS_ASSERT_THROWS( Unreachable("hello"), UnreachableCodeException );
- TS_ASSERT_THROWS( Unreachable("hello %s", "world"), UnreachableCodeException );
+ TS_ASSERT_THROWS(Unreachable(), UnreachableCodeException&);
+ TS_ASSERT_THROWS(Unreachable("hello"), UnreachableCodeException&);
+ TS_ASSERT_THROWS(Unreachable("hello %s", "world"),
+ UnreachableCodeException&);
int x = 5;
- TS_ASSERT_THROWS( Unhandled(), UnhandledCaseException );
- TS_ASSERT_THROWS( Unhandled(x), UnhandledCaseException );
- TS_ASSERT_THROWS( Unhandled("foo"), UnhandledCaseException );
- TS_ASSERT_THROWS( Unhandled("foo %s baz", "bar"), UnhandledCaseException );
+ TS_ASSERT_THROWS(Unhandled(), UnhandledCaseException&);
+ TS_ASSERT_THROWS(Unhandled(x), UnhandledCaseException&);
+ TS_ASSERT_THROWS(Unhandled("foo"), UnhandledCaseException&);
+ TS_ASSERT_THROWS(Unhandled("foo %s baz", "bar"), UnhandledCaseException&);
}
};
BitVector b = one.concat(zero);
TS_ASSERT_EQUALS(b.toString(), "00010000");
TS_ASSERT_EQUALS(b.extract(7, 4), one);
- TS_ASSERT_THROWS(b.extract(4, 7), IllegalArgumentException);
- TS_ASSERT_THROWS(b.extract(8, 3), IllegalArgumentException);
+ TS_ASSERT_THROWS(b.extract(4, 7), IllegalArgumentException&);
+ TS_ASSERT_THROWS(b.extract(8, 3), IllegalArgumentException&);
TS_ASSERT_EQUALS(b.concat(BitVector()), b);
}
TS_ASSERT(negOne.signedLessThanEq(negOne));
BitVector b = negOne.concat(negOne);
- TS_ASSERT_THROWS(b.unsignedLessThan(negOne), IllegalArgumentException);
- TS_ASSERT_THROWS(negOne.unsignedLessThanEq(b), IllegalArgumentException);
- TS_ASSERT_THROWS(b.signedLessThan(negOne), IllegalArgumentException);
- TS_ASSERT_THROWS(negOne.signedLessThanEq(b), IllegalArgumentException);
+ TS_ASSERT_THROWS(b.unsignedLessThan(negOne), IllegalArgumentException&);
+ TS_ASSERT_THROWS(negOne.unsignedLessThanEq(b), IllegalArgumentException&);
+ TS_ASSERT_THROWS(b.signedLessThan(negOne), IllegalArgumentException&);
+ TS_ASSERT_THROWS(negOne.signedLessThanEq(b), IllegalArgumentException&);
}
void testBitwiseOps()
TS_ASSERT_EQUALS(negOne.unsignedRemTotal(two), one);
BitVector b = negOne.concat(negOne);
- TS_ASSERT_THROWS(b + negOne, IllegalArgumentException);
- TS_ASSERT_THROWS(negOne * b, IllegalArgumentException);
- TS_ASSERT_THROWS(b.unsignedDivTotal(negOne), IllegalArgumentException);
- TS_ASSERT_THROWS(negOne.unsignedRemTotal(b), IllegalArgumentException);
+ TS_ASSERT_THROWS(b + negOne, IllegalArgumentException&);
+ TS_ASSERT_THROWS(negOne * b, IllegalArgumentException&);
+ TS_ASSERT_THROWS(b.unsignedDivTotal(negOne), IllegalArgumentException&);
+ TS_ASSERT_THROWS(negOne.unsignedRemTotal(b), IllegalArgumentException&);
}
void testExtendOps()
#ifdef CVC4_ASSERTIONS
in = Node();
- TS_ASSERT_THROWS( BooleanSimplification::negate(in), AssertArgumentException );
+ TS_ASSERT_THROWS(BooleanSimplification::negate(in),
+ AssertArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
in = d_nm->mkNode(kind::AND, a, b);
- TS_ASSERT_THROWS( BooleanSimplification::simplifyClause(in), AssertArgumentException );
+ TS_ASSERT_THROWS(BooleanSimplification::simplifyClause(in),
+ AssertArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
in = d_nm->mkNode(kind::OR, a, b);
- TS_ASSERT_THROWS( BooleanSimplification::simplifyHornClause(in), AssertArgumentException );
+ TS_ASSERT_THROWS(BooleanSimplification::simplifyHornClause(in),
+ AssertArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
#ifdef CVC4_ASSERTIONS
in = d_nm->mkNode(kind::OR, a, b);
- TS_ASSERT_THROWS( BooleanSimplification::simplifyConflict(in), AssertArgumentException );
+ TS_ASSERT_THROWS(BooleanSimplification::simplifyConflict(in),
+ AssertArgumentException&);
#endif /* CVC4_ASSERTIONS */
}
Cardinality two(2);
Cardinality invalid(0);
- TS_ASSERT_THROWS( invalid = Cardinality(-1), IllegalArgumentException);
- TS_ASSERT_THROWS( invalid = Cardinality(-2), IllegalArgumentException);
- TS_ASSERT_THROWS( invalid = Cardinality(Integer("-3983982192391747295721957")), IllegalArgumentException);
+ TS_ASSERT_THROWS(invalid = Cardinality(-1), IllegalArgumentException&);
+ TS_ASSERT_THROWS(invalid = Cardinality(-2), IllegalArgumentException&);
+ TS_ASSERT_THROWS(
+ invalid = Cardinality(Integer("-3983982192391747295721957")),
+ IllegalArgumentException&);
invalid = one; // test assignment
invalid = Cardinality(5); // test assignment to temporary
TS_ASSERT( two.getFiniteCardinality() == 2 );
TS_ASSERT( copy.getFiniteCardinality() == 1 );
TS_ASSERT( invalid.getFiniteCardinality() == 5 );
- TS_ASSERT_THROWS( big.getFiniteCardinality(), IllegalArgumentException );
- TS_ASSERT_THROWS( i.getFiniteCardinality(), IllegalArgumentException );
- TS_ASSERT_THROWS( r.getFiniteCardinality(), IllegalArgumentException );
-
- TS_ASSERT_THROWS( zero.getBethNumber(), IllegalArgumentException );
- TS_ASSERT_THROWS( one.getBethNumber(), IllegalArgumentException );
- TS_ASSERT_THROWS( two.getBethNumber(), IllegalArgumentException );
- TS_ASSERT_THROWS( copy.getBethNumber(), IllegalArgumentException );
- TS_ASSERT_THROWS( invalid.getBethNumber(), IllegalArgumentException );
- TS_ASSERT_THROWS( big.getBethNumber(), IllegalArgumentException );
+ TS_ASSERT_THROWS(big.getFiniteCardinality(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(i.getFiniteCardinality(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(r.getFiniteCardinality(), IllegalArgumentException&);
+
+ TS_ASSERT_THROWS(zero.getBethNumber(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(one.getBethNumber(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(two.getBethNumber(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(copy.getBethNumber(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(invalid.getBethNumber(), IllegalArgumentException&);
+ TS_ASSERT_THROWS(big.getBethNumber(), IllegalArgumentException&);
TS_ASSERT( i.getBethNumber() == 0 );
TS_ASSERT( r.getBethNumber() == 1 );
TS_ASSERT( x.compare(y) == Cardinality::LESS );
TS_ASSERT( y.compare(z) == Cardinality::LESS );
- TS_ASSERT_THROWS( big.getBethNumber(), IllegalArgumentException );
+ TS_ASSERT_THROWS(big.getBethNumber(), IllegalArgumentException&);
TS_ASSERT( x.getBethNumber() == 0 );
TS_ASSERT( y.getBethNumber() == 1 );
TS_ASSERT( z.getBethNumber() == 2 );
const Datatype& colorsDT = colorsType.getDatatype();
TS_ASSERT(colorsDT.getConstructor("blue") == ctor);
TS_ASSERT(colorsDT["blue"].getConstructor() == ctor);
- TS_ASSERT_THROWS(colorsDT["blue"].getSelector("foo"), IllegalArgumentException);
- TS_ASSERT_THROWS(colorsDT["blue"]["foo"], IllegalArgumentException);
+ TS_ASSERT_THROWS(colorsDT["blue"].getSelector("foo"),
+ IllegalArgumentException&);
+ TS_ASSERT_THROWS(colorsDT["blue"]["foo"], IllegalArgumentException&);
TS_ASSERT(! colorsType.getDatatype().isParametric());
TS_ASSERT(colorsType.getDatatype().isFinite());
Expr ctor = treeType.getDatatype()[1].getConstructor();
TS_ASSERT(treeType.getConstructor("leaf") == ctor);
TS_ASSERT(treeType.getConstructor("leaf") == ctor);
- TS_ASSERT_THROWS(treeType.getConstructor("leff"), IllegalArgumentException);
+ TS_ASSERT_THROWS(treeType.getConstructor("leff"),
+ IllegalArgumentException&);
TS_ASSERT(! treeType.getDatatype().isParametric());
TS_ASSERT(! treeType.getDatatype().isFinite());
}
void testParseErrors() {
- TS_ASSERT_THROWS(Integer("abracadabra"), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("+-1"), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("-+1"), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("5i"), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("10xyz"), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("0xff", 10), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("#x5", 0), std::invalid_argument);
- TS_ASSERT_THROWS(Integer("0b123", 0), std::invalid_argument);
+ TS_ASSERT_THROWS(Integer("abracadabra"), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("+-1"), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("-+1"), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("5i"), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("10xyz"), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("0xff", 10), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("#x5", 0), std::invalid_argument&);
+ TS_ASSERT_THROWS(Integer("0b123", 0), std::invalid_argument&);
}
void testPow() {