#include "test_api.h"
-using namespace CVC4::api;
+namespace CVC4 {
+
+using namespace api;
+
+namespace test {
class TestApiResultBlack : public TestApi
{
TEST_F(TestApiResultBlack, isNull)
{
- Result res_null;
+ CVC4::api::Result res_null;
ASSERT_TRUE(res_null.isNull());
ASSERT_FALSE(res_null.isSat());
ASSERT_FALSE(res_null.isUnsat());
Sort u_sort = d_solver.mkUninterpretedSort("u");
Term x = d_solver.mkVar(u_sort, "x");
d_solver.assertFormula(x.eqTerm(x));
- Result res = d_solver.checkSat();
+ CVC4::api::Result res = d_solver.checkSat();
ASSERT_FALSE(res.isNull());
}
Sort u_sort = d_solver.mkUninterpretedSort("u");
Term x = d_solver.mkVar(u_sort, "x");
d_solver.assertFormula(x.eqTerm(x));
- Result res;
- Result res2 = d_solver.checkSat();
- Result res3 = d_solver.checkSat();
+ CVC4::api::Result res;
+ CVC4::api::Result res2 = d_solver.checkSat();
+ CVC4::api::Result res3 = d_solver.checkSat();
res = res2;
EXPECT_EQ(res, res2);
EXPECT_EQ(res3, res2);
Sort u_sort = d_solver.mkUninterpretedSort("u");
Term x = d_solver.mkVar(u_sort, "x");
d_solver.assertFormula(x.eqTerm(x));
- Result res = d_solver.checkSat();
+ CVC4::api::Result res = d_solver.checkSat();
ASSERT_TRUE(res.isSat());
ASSERT_FALSE(res.isSatUnknown());
}
Sort u_sort = d_solver.mkUninterpretedSort("u");
Term x = d_solver.mkVar(u_sort, "x");
d_solver.assertFormula(x.eqTerm(x).notTerm());
- Result res = d_solver.checkSat();
+ CVC4::api::Result res = d_solver.checkSat();
ASSERT_TRUE(res.isUnsat());
ASSERT_FALSE(res.isSatUnknown());
}
Sort int_sort = d_solver.getIntegerSort();
Term x = d_solver.mkVar(int_sort, "x");
d_solver.assertFormula(x.eqTerm(x).notTerm());
- Result res = d_solver.checkSat();
+ CVC4::api::Result res = d_solver.checkSat();
ASSERT_FALSE(res.isSat());
ASSERT_TRUE(res.isSatUnknown());
}
Term a = x.eqTerm(y).notTerm();
Term b = x.eqTerm(y);
d_solver.assertFormula(a);
- Result entailed = d_solver.checkEntailed(a);
+ CVC4::api::Result entailed = d_solver.checkEntailed(a);
ASSERT_TRUE(entailed.isEntailed());
ASSERT_FALSE(entailed.isEntailmentUnknown());
- Result not_entailed = d_solver.checkEntailed(b);
+ CVC4::api::Result not_entailed = d_solver.checkEntailed(b);
ASSERT_TRUE(not_entailed.isNotEntailed());
ASSERT_FALSE(not_entailed.isEntailmentUnknown());
}
Sort int_sort = d_solver.getIntegerSort();
Term x = d_solver.mkVar(int_sort, "x");
d_solver.assertFormula(x.eqTerm(x).notTerm());
- Result res = d_solver.checkEntailed(x.eqTerm(x));
+ CVC4::api::Result res = d_solver.checkEntailed(x.eqTerm(x));
ASSERT_FALSE(res.isEntailed());
ASSERT_TRUE(res.isEntailmentUnknown());
EXPECT_EQ(res.getUnknownExplanation(), "UNKNOWN_REASON");
}
+} // namespace test
+} // namespace CVC4
--- /dev/null
+/********************* */
+/*! \file test_context.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Aina Niemetz
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
+ ** in the top-level source directory and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Header for context unit tests.
+ **/
+
+#ifndef CVC4__TEST__UNIT__TEST_CONTEXT_H
+#define CVC4__TEST__UNIT__TEST_CONTEXT_H
+
+#include "context/context.h"
+#include "test.h"
+
+namespace CVC4 {
+namespace test {
+
+class TestContext : public TestInternal
+{
+ protected:
+ void SetUp() override { d_context.reset(new CVC4::context::Context()); }
+ std::unique_ptr<CVC4::context::Context> d_context;
+};
+
+} // namespace test
+} // namespace CVC4
+#endif