#include "expr/node.h"
#include "expr/node_builder.h"
#include "expr/node_value.h"
-#include "test_expr.h"
+#include "test_node.h"
namespace CVC4 {
namespace test {
-class TestExprBlackAttribute : public TestExprBlack
+class TestExprBlackAttribute : public TestNode
{
protected:
struct PrimitiveIntAttributeId
#include "expr/node_value.h"
#include "smt/smt_engine.h"
#include "smt/smt_engine_scope.h"
-#include "test_expr.h"
+#include "test_node.h"
#include "theory/theory.h"
#include "theory/theory_engine.h"
#include "theory/uf/theory_uf.h"
using TestFlag4 = Attribute<Test4, bool>;
using TestFlag5 = Attribute<Test5, bool>;
-class TestExprWhiteAttribute : public TestExprWhite
+class TestExprWhiteAttribute : public TestNode
{
protected:
void SetUp() override
{
- TestExprWhite::SetUp();
+ TestNode::SetUp();
d_booleanType.reset(new TypeNode(d_nodeManager->booleanType()));
}
std::unique_ptr<TypeNode> d_booleanType;
#include <string>
#include "expr/kind.h"
-#include "test_expr.h"
+#include "test.h"
namespace CVC4 {
namespace test {
-class TestExprBlackKind : public TestExprBlack
+class TestExprBlackKind : public TestInternal
{
protected:
void SetUp() override
{
- undefined = UNDEFINED_KIND;
- null = NULL_EXPR;
- last = LAST_KIND;
- beyond = ((int32_t)LAST_KIND) + 1;
- unknown = (Kind)beyond;
+ d_undefined = UNDEFINED_KIND;
+ d_null = NULL_EXPR;
+ d_last = LAST_KIND;
+ d_beyond = ((int32_t)LAST_KIND) + 1;
+ d_unknown = (Kind)d_beyond;
}
bool string_is_as_expected(Kind k, const char* s)
return act.str() == exp.str();
}
- Kind undefined;
- Kind unknown;
- Kind null;
- Kind last;
- int32_t beyond;
+ Kind d_undefined;
+ Kind d_unknown;
+ Kind d_null;
+ Kind d_last;
+ int32_t d_beyond;
};
TEST_F(TestExprBlackKind, equality)
{
- ASSERT_EQ(undefined, UNDEFINED_KIND);
- ASSERT_EQ(last, LAST_KIND);
+ ASSERT_EQ(d_undefined, UNDEFINED_KIND);
+ ASSERT_EQ(d_last, LAST_KIND);
}
TEST_F(TestExprBlackKind, order)
{
- ASSERT_LT((int32_t)undefined, (int32_t)null);
- ASSERT_LT((int32_t)null, (int32_t)last);
- ASSERT_LT((int32_t)undefined, (int32_t)last);
- ASSERT_LT((int32_t)last, (int32_t)unknown);
+ ASSERT_LT((int32_t)d_undefined, (int32_t)d_null);
+ ASSERT_LT((int32_t)d_null, (int32_t)d_last);
+ ASSERT_LT((int32_t)d_undefined, (int32_t)d_last);
+ ASSERT_LT((int32_t)d_last, (int32_t)d_unknown);
}
TEST_F(TestExprBlackKind, output)
{
- ASSERT_TRUE(string_is_as_expected(undefined, "UNDEFINED_KIND"));
- ASSERT_TRUE(string_is_as_expected(null, "NULL"));
- ASSERT_TRUE(string_is_as_expected(last, "LAST_KIND"));
+ ASSERT_TRUE(string_is_as_expected(d_undefined, "UNDEFINED_KIND"));
+ ASSERT_TRUE(string_is_as_expected(d_null, "NULL"));
+ ASSERT_TRUE(string_is_as_expected(d_last, "LAST_KIND"));
}
TEST_F(TestExprBlackKind, output_concat)
{
std::stringstream act, exp;
- act << undefined << null << last << unknown;
+ act << d_undefined << d_null << d_last << d_unknown;
exp << "UNDEFINED_KIND"
<< "NULL"
<< "LAST_KIND"
#include <string>
#include "expr/kind_map.h"
-#include "test_expr.h"
+#include "test.h"
namespace CVC4 {
namespace test {
-class TestExprBlackKindMap : public TestExprBlack
+class TestExprBlackKindMap : public TestInternal
{
};
+++ /dev/null
-/********************* */
-/*! \file test_expr.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 Common header for Expr unit tests.
- **/
-
-#ifndef CVC4__TEST__UNIT__TEST_EXPR_H
-#define CVC4__TEST__UNIT__TEST_EXPR_H
-
-#include "expr/expr_manager.h"
-#include "expr/node_manager.h"
-#include "smt/smt_engine.h"
-#include "smt/smt_engine_scope.h"
-#include "test.h"
-#include "test_api.h"
-
-namespace CVC4 {
-namespace test {
-
-class TestExprBlack : public TestApi
-{
- protected:
- void SetUp() override
- {
- d_exprManager = d_solver.getExprManager();
- d_nodeManager = NodeManager::fromExprManager(d_exprManager);
- d_smtEngine = d_solver.getSmtEngine();
- d_scope.reset(new smt::SmtScope(d_smtEngine));
- }
- std::unique_ptr<smt::SmtScope> d_scope;
- ExprManager* d_exprManager;
- NodeManager* d_nodeManager;
- SmtEngine* d_smtEngine;
-};
-
-class TestExprWhite : public TestApi
-{
- protected:
- void SetUp() override
- {
- d_nodeManager.reset(new NodeManager(nullptr));
- d_scope.reset(new NodeManagerScope(d_nodeManager.get()));
- }
- std::unique_ptr<NodeManager> d_nodeManager;
- std::unique_ptr<NodeManagerScope> d_scope;
-};
-
-} // namespace test
-} // namespace CVC4
-#endif
#include "expr/dtype_cons.h"
#include "expr/expr.h"
#include "expr/type_node.h"
-#include "test_expr.h"
+#include "test_smt.h"
namespace CVC4 {
namespace test {
-class TestUtilBlackDatatype : public TestExprBlack
+class TestUtilBlackDatatype : public TestSmt
{
public:
void SetUp() override
{
- TestExprBlack::SetUp();
+ TestSmt::SetUp();
Debug.on("datatypes");
Debug.on("groundterms");
}