Sort::~Sort() {}
-Sort& Sort::operator=(const Sort& s)
-{
- if (this != &s)
- {
- *d_type = *s.d_type;
- }
- return *this;
-}
-
bool Sort::operator==(const Sort& s) const { return *d_type == *s.d_type; }
bool Sort::operator!=(const Sort& s) const { return *d_type != *s.d_type; }
Term::~Term() {}
-Term& Term::operator=(const Term& t)
-{
- if (this != &t)
- {
- *d_expr = *t.d_expr;
- }
- return *this;
-}
-
bool Term::operator==(const Term& t) const { return *d_expr == *t.d_expr; }
bool Term::operator!=(const Term& t) const { return *d_expr != *t.d_expr; }
OpTerm::~OpTerm() {}
-OpTerm& OpTerm::operator=(const OpTerm& t)
-{
- if (this != &t)
- {
- *d_expr = *t.d_expr;
- }
- return *this;
-}
-
bool OpTerm::operator==(const OpTerm& t) const { return *d_expr == *t.d_expr; }
bool OpTerm::operator!=(const OpTerm& t) const { return *d_expr != *t.d_expr; }
*/
~Sort();
- /**
- * Assignment operator.
- * @param s the sort to assign to this sort
- * @return this sort after assignment
- */
- Sort& operator=(const Sort& s);
-
/**
* Comparison for structural equality.
* @param s the sort to compare to
*/
~Term();
- /**
- * Assignment operator, makes a copy of the given term.
- * Both terms must belong to the same solver object.
- * @param t the term to assign
- * @return the reference to this term after assignment
- */
- Term& operator=(const Term& t);
-
/**
* Syntactic equality operator.
* Return true if both terms are syntactically identical.
*/
~OpTerm();
- /**
- * Assignment operator, makes a copy of the given operator term.
- * Both terms must belong to the same solver object.
- * @param t the term to assign
- * @return the reference to this operator term after assignment
- */
- OpTerm& operator=(const OpTerm& t);
-
/**
* Syntactic equality operator.
* Return true if both operator terms are syntactically identical.
# Add unit tests
cvc4_add_unit_test_black(api_guards_black api)
+cvc4_add_unit_test_black(term_black api)
--- /dev/null
+/********************* */
+/*! \file term_black.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Andres Noetzli
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2018 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 Black box testing of the Term class
+ **/
+
+#include <cxxtest/TestSuite.h>
+
+#include "api/cvc4cpp.h"
+
+using namespace CVC4::api;
+
+class TermBlack : public CxxTest::TestSuite
+{
+ public:
+ void setUp() override {}
+ void tearDown() override {}
+
+ void testTermAssignment()
+ {
+ Term t1 = d_solver.mkReal(1);
+ Term t2 = t1;
+ t2 = d_solver.mkReal(2);
+ TS_ASSERT_EQUALS(t1, d_solver.mkReal(1));
+ }
+
+ private:
+ Solver d_solver;
+};