class MapUtilBlack : public CxxTest::TestSuite
{
public:
- void setUp() {}
- void tearDown() {}
+ void setUp() override {}
+ void tearDown() override {}
// Returns a map containing {"key"->"value", "other"->"entry"}.
static const std::map<string, string>& DefaultMap()
Context* d_context;
public:
- void setUp() { d_context = new Context(); }
+ void setUp() override { d_context = new Context(); }
- void tearDown() { delete d_context; }
+ void tearDown() override { delete d_context; }
// test at different sizes. this triggers grow() behavior differently.
// grow() was completely broken in revision 256
Context* d_context;
public:
- void setUp() {
+ void setUp() override
+ {
d_context = new Context;
// Debug.on("context");
// Debug.on("gc");
// Debug.on("pushpop");
}
- void tearDown() { delete d_context; }
+ void tearDown() override { delete d_context; }
// Returns the elements in a CDHashMap.
static std::map<int, int> GetElements(const CDHashMap<int, int>& map) {
Context* d_context;
-public:
+ public:
+ void setUp() override { d_context = new Context; }
- void setUp() {
- d_context = new Context;
- }
-
- void tearDown() {
- delete d_context;
- }
+ void tearDown() override { delete d_context; }
- void testUnreachableSaveAndRestore() {
+ void testUnreachableSaveAndRestore()
+ {
CDHashMap<int, int> map(d_context);
TS_ASSERT_THROWS_NOTHING(map.makeCurrent());
Context* d_context;
-public:
+ public:
+ void setUp() override { d_context = new Context; }
- void setUp() {
- d_context = new Context;
- }
-
- void tearDown() {
- delete d_context;
- }
+ void tearDown() override { delete d_context; }
- void testIntCDO() {
+ void testIntCDO()
+ {
// Test that push/pop maintains the original value
CDO<int> a1(d_context);
a1 = 5;
ContextNotifyObj(context, pre),
nCalls(0) {
}
-
- virtual ~MyContextNotifyObj() {}
- void contextNotifyPop() {
- ++nCalls;
- }
+ ~MyContextNotifyObj() override {}
+
+ void contextNotifyPop() override { ++nCalls; }
};
class MyContextObj : public ContextObj {
nSaves(0) {
}
- virtual ~MyContextObj() {
- destroy();
- }
+ ~MyContextObj() override { destroy(); }
- ContextObj* save(ContextMemoryManager* pcmm) {
+ ContextObj* save(ContextMemoryManager* pcmm) override
+ {
++nSaves;
return new(pcmm) MyContextObj(*this);
}
- void restore(ContextObj* contextObj) {
- nCalls = notify.nCalls;
- }
+ void restore(ContextObj* contextObj) override { nCalls = notify.nCalls; }
void makeCurrent() {
ContextObj::makeCurrent();
Context* d_context;
-public:
+ public:
+ void setUp() override { d_context = new Context; }
- void setUp() {
- d_context = new Context;
- }
-
- void tearDown() {
- delete d_context;
- }
+ void tearDown() override { delete d_context; }
- void testContextPushPop() {
+ void testContextPushPop()
+ {
// Test what happens when the context is popped below 0
// the interface doesn't declare any exceptions
d_context->push();
ContextMemoryManager* d_cmm;
-public:
+ public:
+ void setUp() override { d_cmm = new ContextMemoryManager(); }
- void setUp() {
- d_cmm = new ContextMemoryManager();
- }
-
- void testPushPop() {
+ void testPushPop()
+ {
#ifdef CVC4_DEBUG_CONTEXT_MEMORY_MANAGER
#warning "Using the debug context memory manager, omitting unit tests"
#else
#endif /* __CVC4__CONTEXT__CONTEXT_MM_H */
}
- void tearDown() {
- delete d_cmm;
- }
+ void tearDown() override { delete d_cmm; }
};
Context* d_context;
-public:
+ public:
+ void setUp() override { d_context = new Context; }
- void setUp() {
- d_context = new Context;
- }
-
- void tearDown() {
- delete d_context;
- }
+ void tearDown() override { delete d_context; }
- void testContextSimple() {
- Scope *s = d_context->getTopScope();
+ void testContextSimple()
+ {
+ Scope* s = d_context->getTopScope();
TS_ASSERT(s == d_context->getBottomScope());
TS_ASSERT(d_context->getLevel() == 0);
SmtEngine* d_smtEngine;
SmtScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_exprManager = new ExprManager();
d_nodeManager = NodeManager::fromExprManager(d_exprManager);
d_smtEngine = new SmtEngine(d_exprManager);
d_scope = new SmtScope(d_smtEngine);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_smtEngine;
delete d_exprManager;
TypeNode* d_booleanType;
SmtEngine* d_smtEngine;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_smtEngine = new SmtEngine(d_em);
d_booleanType = new TypeNode(d_nm->booleanType());
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_booleanType;
delete d_scope;
delete d_smtEngine;
return vars;
}
+ public:
+ void setUp() override { d_exprManager = new ExprManager; }
-public:
- void setUp() {
- d_exprManager = new ExprManager;
- }
-
-
- void tearDown() {
- try {
+ void tearDown() override
+ {
+ try
+ {
delete d_exprManager;
- } catch(Exception e) {
+ }
+ catch (Exception e)
+ {
cerr << "Exception during tearDown():" << endl << e;
- throw ;
+ throw;
}
}
Expr* r1;
Expr* r2;
-public:
-
- void setUp() {
- try {
-
- char *argv[2];
+ public:
+ void setUp() override
+ {
+ try
+ {
+ char* argv[2];
argv[0] = strdup("");
argv[1] = strdup("--output-language=ast");
Options::parseOptions(&opts, 2, argv);
d_em = new ExprManager(opts);
- a_bool = new Expr(d_em->mkVar("a",d_em->booleanType()));
+ a_bool = new Expr(d_em->mkVar("a", d_em->booleanType()));
b_bool = new Expr(d_em->mkVar("b", d_em->booleanType()));
c_bool_and = new Expr(d_em->mkExpr(AND, *a_bool, *b_bool));
and_op = new Expr(d_em->mkConst(AND));
plus_op = new Expr(d_em->mkConst(PLUS));
- fun_type = new Type(d_em->mkFunctionType(d_em->booleanType(), d_em->booleanType()));
+ fun_type = new Type(
+ d_em->mkFunctionType(d_em->booleanType(), d_em->booleanType()));
fun_op = new Expr(d_em->mkVar("f", *fun_type));
d_apply_fun_bool = new Expr(d_em->mkExpr(APPLY_UF, *fun_op, *a_bool));
null = new Expr();
i2 = new Expr(d_em->mkConst(Rational(23)));
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;
}
}
- void tearDown() {
+ void tearDown() override
+ {
try {
delete r2;
delete r1;
//easier to define in setup
int beyond;
Kind unknown;
-public:
- void setUp() {
+
+ public:
+ void setUp() override
+ {
undefined = UNDEFINED_KIND;
null = NULL_EXPR;
last = LAST_KIND;
- beyond = ((int) LAST_KIND) + 1;
- unknown = (Kind) beyond;
+ beyond = ((int)LAST_KIND) + 1;
+ unknown = (Kind)beyond;
}
TypeNode* d_realType;
public:
- void setUp() {
+ void setUp() override
+ {
char* argv[2];
argv[0] = strdup("");
argv[1] = strdup("--output-language=ast");
d_realType = new TypeNode(d_nodeManager->realType());
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_realType;
delete d_booleanType;
delete d_scope;
TypeNode* d_integerType;
TypeNode* d_realType;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_nm = new NodeManager(NULL);
d_scope = new NodeManagerScope(d_nm);
d_realType = new TypeNode(d_nm->realType());
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_integerType;
delete d_booleanType;
delete d_realType;
NodeManager* d_nodeManager;
NodeManagerScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_nodeManager = new NodeManager(NULL);
d_scope = new NodeManagerScope(d_nodeManager);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_nodeManager;
}
NodeManager* d_nm;
NodeManagerScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_nm = new NodeManager(NULL);
d_scope = new NodeManagerScope(d_nm);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_nm;
}
TypeNode* d_booleanType;
TypeNode* d_realType;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_nodeManager = new NodeManager(NULL);
d_scope = new NodeManagerScope(d_nodeManager);
d_booleanType = new TypeNode(d_nodeManager->booleanType());
d_realType = new TypeNode(d_nodeManager->realType());
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_booleanType;
delete d_scope;
delete d_nodeManager;
NodeManager* d_nm;
NodeManagerScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_nm = new NodeManager(NULL);
d_scope = new NodeManagerScope(d_nm);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_nm;
}
ExprManager* d_exprManager;
-public:
-
- void setUp() {
- try {
+ public:
+ void setUp() override
+ {
+ try
+ {
d_exprManager = new ExprManager;
- } catch(Exception e) {
+ }
+ catch (Exception e)
+ {
cerr << "Exception during setUp():" << endl << e;
throw;
}
}
- void tearDown() {
+ void tearDown() override
+ {
try {
delete d_exprManager;
} catch(Exception e) {
class TypeCardinalityPublic : public CxxTest::TestSuite {
ExprManager* d_em;
-public:
-
- void setUp() {
- d_em = new ExprManager();
- }
-
- void tearDown() {
- delete d_em;
- }
-
- void testTheBasics() {
- TS_ASSERT( d_em->booleanType().getCardinality().compare(2) == Cardinality::EQUAL );
- TS_ASSERT( d_em->integerType().getCardinality().compare(Cardinality::INTEGERS) == Cardinality::EQUAL );
- TS_ASSERT( d_em->realType().getCardinality().compare(Cardinality::REALS) == Cardinality::EQUAL );
+ public:
+ void setUp() override { d_em = new ExprManager(); }
+
+ void tearDown() override { delete d_em; }
+
+ void testTheBasics()
+ {
+ TS_ASSERT(d_em->booleanType().getCardinality().compare(2)
+ == Cardinality::EQUAL);
+ TS_ASSERT(
+ d_em->integerType().getCardinality().compare(Cardinality::INTEGERS)
+ == Cardinality::EQUAL);
+ TS_ASSERT(d_em->realType().getCardinality().compare(Cardinality::REALS)
+ == Cardinality::EQUAL);
}
void testArrays() {
NodeManagerScope* d_scope;
SmtEngine* d_smt;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = d_em->getNodeManager();
d_smt = new SmtEngine(d_em);
d_scope = new NodeManagerScope(d_nm);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_smt;
delete d_em;
class InteractiveShellBlack : public CxxTest::TestSuite
{
public:
- void setUp()
+ void setUp() override
{
d_sin = new stringstream;
d_sout = new stringstream;
d_solver.reset(new api::Solver(&d_options));
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_sin;
delete d_sout;
}
public:
Cvc4ParserTest() : ParserBlack(LANG_CVC4) { }
- void setUp() {
- super::setUp();
- }
+ void setUp() override { super::setUp(); }
- void tearDown() {
- super::tearDown();
- }
+ void tearDown() override { super::tearDown(); }
void testGoodCvc4Inputs() {
tryGoodInput(""); // empty string is OK
public:
Smt1ParserTest() : ParserBlack(LANG_SMTLIB_V1) { }
- void setUp() {
- super::setUp();
- }
+ void setUp() override { super::setUp(); }
- void tearDown() {
- super::tearDown();
- }
+ void tearDown() override { super::tearDown(); }
void testGoodSmt1Inputs() {
tryGoodInput(""); // empty string is OK
public:
Smt2ParserTest() : ParserBlack(LANG_SMTLIB_V2) { }
- void setUp() {
- super::setUp();
- }
+ void setUp() override { super::setUp(); }
- void tearDown() {
- super::tearDown();
- }
+ void tearDown() override { super::tearDown(); }
- virtual void setupContext(Parser& parser) {
+ void setupContext(Parser& parser) override
+ {
if(dynamic_cast<Smt2*>(&parser) != NULL){
dynamic_cast<Smt2*>(&parser)->addTheory(Smt2::THEORY_CORE);
}
class ParserBuilderBlack : public CxxTest::TestSuite
{
public:
- void setUp() { d_solver.reset(new api::Solver()); }
+ void setUp() override { d_solver.reset(new api::Solver()); }
- void tearDown() {}
+ void tearDown() override {}
void testEmptyFileInput()
{
public:
TheoryBVGaussWhite() {}
- void setUp()
+ void setUp() override
{
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_z_mul_nine = d_nm->mkNode(kind::BITVECTOR_MULT, d_z, d_nine);
}
- void tearDown()
+ void tearDown() override
{
(void)d_scope;
d_p = Node::null();
public:
FakeSatSolver() : d_nextVar(0), d_addClauseCalled(false) {}
- SatVariable newVar(bool theoryAtom, bool preRegister, bool canErase) {
+ SatVariable newVar(bool theoryAtom, bool preRegister, bool canErase) override
+ {
return d_nextVar++;
}
- SatVariable trueVar() { return d_nextVar++; }
+ SatVariable trueVar() override { return d_nextVar++; }
- SatVariable falseVar() { return d_nextVar++; }
+ SatVariable falseVar() override { return d_nextVar++; }
- ClauseId addClause(SatClause& c, bool lemma) {
+ ClauseId addClause(SatClause& c, bool lemma) override
+ {
d_addClauseCalled = true;
return ClauseIdUndef;
}
- ClauseId addXorClause(SatClause& clause, bool rhs, bool removable) {
+ ClauseId addXorClause(SatClause& clause, bool rhs, bool removable) override
+ {
d_addClauseCalled = true;
return ClauseIdUndef;
}
- bool nativeXor() { return false; }
+ bool nativeXor() override { return false; }
void reset() { d_addClauseCalled = false; }
unsigned int addClauseCalled() { return d_addClauseCalled; }
- unsigned getAssertionLevel() const { return 0; }
+ unsigned getAssertionLevel() const override { return 0; }
bool isDecision(Node) const { return false; }
bool spendResource() { return false; }
- void interrupt() {}
+ void interrupt() override {}
- SatValue solve() { return SAT_VALUE_UNKNOWN; }
+ SatValue solve() override { return SAT_VALUE_UNKNOWN; }
- SatValue solve(long unsigned int& resource) { return SAT_VALUE_UNKNOWN; }
+ SatValue solve(long unsigned int& resource) override
+ {
+ return SAT_VALUE_UNKNOWN;
+ }
- SatValue value(SatLiteral l) { return SAT_VALUE_UNKNOWN; }
+ SatValue value(SatLiteral l) override { return SAT_VALUE_UNKNOWN; }
- SatValue modelValue(SatLiteral l) { return SAT_VALUE_UNKNOWN; }
+ SatValue modelValue(SatLiteral l) override { return SAT_VALUE_UNKNOWN; }
bool properExplanation(SatLiteral lit, SatLiteral expl) const { return true; }
- bool ok() const { return true; }
+ bool ok() const override { return true; }
}; /* class FakeSatSolver */
SmtScope* d_scope;
SmtEngine* d_smt;
- void setUp() {
+ void setUp() override
+ {
d_exprManager = new ExprManager();
d_smt = new SmtEngine(d_exprManager);
d_smt->d_logic.lock();
d_satSolver, d_cnfRegistrar, d_cnfContext, d_smt->channels());
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_cnfStream;
delete d_cnfContext;
delete d_cnfRegistrar;
public:
TheoryEvaluatorWhite() {}
- void setUp()
+ void setUp() override
{
Options opts;
opts.setOutputLanguage(language::output::LANG_SMTLIB_V2);
d_scope = new SmtScope(d_smt);
}
- void tearDown()
+ void tearDown() override
{
delete d_scope;
delete d_smt;
}
}
- void setUp() {
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_smt = new SmtEngine(d_em);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_intType;
delete d_realType;
delete d_booleanType;
NodeManager* d_nm;
SmtScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_smt = new SmtEngine(d_em);
d_scope = new SmtScope(d_smt);
d_nm = NodeManager::fromExprManager(d_em);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_smt;
delete d_em;
TheoryBVWhite() {}
- void setUp() {
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_smt = new SmtEngine(d_em);
d_scope = new SmtScope(d_smt);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_smt;
delete d_em;
class BvInstantiatorWhite : public CxxTest::TestSuite
{
public:
- void setUp();
- void tearDown();
+ void setUp() override;
+ void tearDown() override;
void testGetPvCoeff();
void testNormalizePvMult();
public:
TheoryStringsRewriterWhite() {}
- void setUp()
+ void setUp() override
{
Options opts;
opts.setOutputLanguage(language::output::LANG_SMTLIB_V2);
d_scope = new SmtScope(d_smt);
}
- void tearDown()
+ void tearDown() override
{
delete d_scope;
delete d_smt;
return done();
}
- void check(Effort e) {
+ void check(Effort e) override
+ {
while(!done()) {
getWrapper();
}
}
- void presolve() {
- Unimplemented();
- }
- void preRegisterTerm(TNode n) {}
- void propagate(Effort level) {}
- Node explain(TNode n) { return Node::null(); }
+ void presolve() override { Unimplemented(); }
+ void preRegisterTerm(TNode n) override {}
+ void propagate(Effort level) override {}
+ Node explain(TNode n) override { return Node::null(); }
Node getValue(TNode n) { return Node::null(); }
- string identify() const { return "DummyTheory"; }
+ string identify() const override { return "DummyTheory"; }
};/* class DummyTheory */
class TheoryBlack : public CxxTest::TestSuite {
Node atom0;
Node atom1;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_smt = new SmtEngine(d_em);
d_smt->d_theoryEngine->d_theoryTable[THEORY_BUILTIN] = NULL;
d_smt->d_theoryEngine->d_theoryOut[THEORY_BUILTIN] = NULL;
- d_dummy = new DummyTheory(d_ctxt, d_uctxt, d_outputChannel, Valuation(NULL),
- *d_logicInfo);
+ d_dummy = new DummyTheory(
+ d_ctxt, d_uctxt, d_outputChannel, Valuation(NULL), *d_logicInfo);
d_outputChannel.clear();
atom0 = d_nm->mkConst(true);
atom1 = d_nm->mkConst(false);
}
- void tearDown() {
+ void tearDown() override
+ {
atom1 = Node::null();
atom0 = Node::null();
delete d_dummy;
NodeManager* d_nm;
NodeManagerScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_nm = NodeManager::fromExprManager(d_em);
d_scope = new NodeManagerScope(d_nm);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_em;
}
ExprManagerScope* d_scope;
public:
- void setUp() {
+ void setUp() override
+ {
d_em = new ExprManager();
d_scope = new ExprManagerScope(*d_em);
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_em;
}
using namespace std;
class BinaryHeapBlack : public CxxTest::TestSuite {
-public:
+ public:
+ void setUp() override {}
- void setUp() {
- }
-
- void tearDown() {
- }
+ void tearDown() override {}
/**
* Test a a series of simple heaps (push a few then pop all then do others).
* Done as a series to test if the heap structure falls into a bad state
* after prolonged use.
*/
- void testHeapSeries() {
+ void testHeapSeries()
+ {
BinaryHeap<int> heap;
// First test a heap of 1 element
public:
- void setUp()
+ void setUp() override
{
zero = BitVector(4);
one = zero.setBit(0);
ExprManager* d_em;
ExprManagerScope* d_scope;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
d_em = new ExprManager();
d_scope = new ExprManagerScope(*d_em);
Debug.on("datatypes");
Debug.on("groundterms");
}
- void tearDown() {
+ void tearDown() override
+ {
delete d_scope;
delete d_em;
}
using namespace std;
class ExceptionBlack : public CxxTest::TestSuite {
-public:
+ public:
+ void setUp() override {}
- void setUp() {
- }
-
- void tearDown() {
- }
+ void tearDown() override {}
// CVC4::Exception is a simple class, just test it all at once.
- void testExceptions() {
+ void testExceptions()
+ {
Exception e1;
Exception e2(string("foo!"));
Exception e3("bar!");
public:
EventListener(std::multiset<std::string>& events, std::string name)
: d_events(events), d_name(name) {}
- ~EventListener(){}
+ ~EventListener() override {}
- virtual void notify() { d_events.insert(d_name); }
+ void notify() override { d_events.insert(d_name); }
private:
std::multiset<std::string>& d_events;
return std::multiset<std::string>(arr, arr + len);
}
- void setUp() {
- d_events.clear();
- }
+ void setUp() override { d_events.clear(); }
- void tearDown() {
- d_events.clear();
- }
+ void tearDown() override { d_events.clear(); }
void testEmptyCollection() {
// Makes an new collection and tests that it is empty.
stringstream d_messageStream;
stringstream d_warningStream;
-public:
-
- void setUp() {
+ public:
+ void setUp() override
+ {
DebugChannel.setStream(&d_debugStream);
TraceChannel.setStream(&d_traceStream);
NoticeChannel.setStream(&d_noticeStream);
d_warningStream.str("");
}
- void tearDown() {
- }
+ void tearDown() override {}
void testOutput() {
Debug.on("foo");