From d70a63324c95210f1d78c2efc46395d2369d2e2b Mon Sep 17 00:00:00 2001 From: Tim King Date: Fri, 14 Jul 2017 16:56:11 -0700 Subject: Removing the unused CDAttribute. This makes CDHashMap::obliterate unused. Removing it as well. --- test/unit/expr/attribute_black.h | 60 ----------------- test/unit/expr/attribute_white.h | 137 --------------------------------------- 2 files changed, 197 deletions(-) (limited to 'test/unit/expr') diff --git a/test/unit/expr/attribute_black.h b/test/unit/expr/attribute_black.h index d919bcbe3..d3f043f36 100644 --- a/test/unit/expr/attribute_black.h +++ b/test/unit/expr/attribute_black.h @@ -88,10 +88,7 @@ public: } struct PrimitiveIntAttributeId {}; - struct CDPrimitiveIntAttributeId {}; - typedef expr::Attribute PrimitiveIntAttribute; - typedef expr::CDAttribute CDPrimitiveIntAttribute; void testInts(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -105,21 +102,12 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - uint64_t data2 = 0; - uint64_t data3 = 0; - CDPrimitiveIntAttribute cdattr; - TS_ASSERT(!node->getAttribute(cdattr, data2)); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT_EQUALS(data3, val); delete node; } struct TNodeAttributeId {}; - struct CDTNodeAttributeId {}; typedef expr::Attribute TNodeAttribute; - typedef expr::CDAttribute CDTNodeAttribute; void testTNodes(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -134,13 +122,6 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - TNode data2; - TNode data3; - CDTNodeAttribute cdattr; - TS_ASSERT(!node->getAttribute(cdattr, data2)); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT_EQUALS(data3, val); delete node; } @@ -152,10 +133,8 @@ public: }; struct PtrAttributeId {}; - struct CDPtrAttributeId {}; typedef expr::Attribute PtrAttribute; - typedef expr::CDAttribute CDPtrAttribute; void testPtrs(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -170,25 +149,14 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - Foo* data2 = NULL; - Foo* data3 = NULL; - CDPtrAttribute cdattr; - TS_ASSERT(!node->getAttribute(cdattr, data2)); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT(data3 != NULL); - TS_ASSERT_EQUALS(63489, data3->getBar()); - TS_ASSERT_EQUALS(data3, val); delete node; delete val; } struct ConstPtrAttributeId {}; - struct CDConstPtrAttributeId {}; typedef expr::Attribute ConstPtrAttribute; - typedef expr::CDAttribute CDConstPtrAttribute; void testConstPtrs(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -203,22 +171,12 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - const Foo* data2 = NULL; - const Foo* data3 = NULL; - CDConstPtrAttribute cdattr; - TS_ASSERT(!node->getAttribute(cdattr, data2)); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT_EQUALS(data3, val); delete node; delete val; } struct StringAttributeId {}; - struct CDStringAttributeId {}; - typedef expr::Attribute StringAttribute; - typedef expr::CDAttribute CDStringAttribute; void testStrings(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -233,21 +191,11 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - std::string data2; - std::string data3; - CDStringAttribute cdattr; - TS_ASSERT(!node->getAttribute(cdattr, data2)); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT_EQUALS(data3, val); delete node; } struct BoolAttributeId {}; - struct CDBoolAttributeId {}; - typedef expr::Attribute BoolAttribute; - typedef expr::CDAttribute CDBoolAttribute; void testBools(){ TypeNode booleanType = d_nodeManager->booleanType(); Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); @@ -263,14 +211,6 @@ public: TS_ASSERT(node->getAttribute(attr, data1)); TS_ASSERT_EQUALS(data1, val); - bool data2 = false; - bool data3 = false; - CDBoolAttribute cdattr; - TS_ASSERT(node->getAttribute(cdattr, data2)); - TS_ASSERT_EQUALS(false, data2); - node->setAttribute(cdattr, val); - TS_ASSERT(node->getAttribute(cdattr, data3)); - TS_ASSERT_EQUALS(data3, val); delete node; } diff --git a/test/unit/expr/attribute_white.h b/test/unit/expr/attribute_white.h index e4786b8e3..60a83b5c7 100644 --- a/test/unit/expr/attribute_white.h +++ b/test/unit/expr/attribute_white.h @@ -47,18 +47,12 @@ struct Test5; typedef Attribute TestStringAttr1; typedef Attribute TestStringAttr2; -// it would be nice to have CDAttribute<> for context-dependence -typedef CDAttribute TestCDFlag; - typedef Attribute TestFlag1; typedef Attribute TestFlag2; typedef Attribute TestFlag3; typedef Attribute TestFlag4; typedef Attribute TestFlag5; -typedef CDAttribute TestFlag1cd; -typedef CDAttribute TestFlag2cd; - class AttributeWhite : public CxxTest::TestSuite { ExprManager* d_em; @@ -127,11 +121,6 @@ public: TS_ASSERT_DIFFERS(TestFlag4::s_id, TestFlag5::s_id); lastId = attr::LastAttributeId::getId(); - TS_ASSERT_LESS_THAN(TestFlag1cd::s_id, lastId); - TS_ASSERT_LESS_THAN(TestFlag2cd::s_id, lastId); - TS_ASSERT_DIFFERS(TestFlag1cd::s_id, TestFlag2cd::s_id); - cout << "1: " << TestFlag1cd::s_id << endl; - cout << "2: " << TestFlag2cd::s_id << endl; lastId = attr::LastAttributeId::getId(); // TS_ASSERT_LESS_THAN(theory::PreRewriteCache::s_id, lastId); @@ -149,132 +138,6 @@ public: TS_ASSERT_LESS_THAN(TypeAttr::s_id, lastId); } - void testCDAttributes() { - //Debug.on("cdboolattr"); - - Node a = d_nm->mkVar(*d_booleanType); - Node b = d_nm->mkVar(*d_booleanType); - Node c = d_nm->mkVar(*d_booleanType); - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - d_smtEngine->push(); // level 1 - - // test that all boolean flags are FALSE to start - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - // test that they all HAVE the boolean attributes - TS_ASSERT(a.hasAttribute(TestFlag1cd())); - TS_ASSERT(b.hasAttribute(TestFlag1cd())); - TS_ASSERT(c.hasAttribute(TestFlag1cd())); - - // test two-arg version of hasAttribute() - bool bb = false; - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(a.getAttribute(TestFlag1cd(), bb)); - TS_ASSERT(! bb); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(b.getAttribute(TestFlag1cd(), bb)); - TS_ASSERT(! bb); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(c.getAttribute(TestFlag1cd(), bb)); - TS_ASSERT(! bb); - - // setting boolean flags - Debug("cdboolattr") << "set flag 1 on a to T\n"; - a.setAttribute(TestFlag1cd(), true); - Debug("cdboolattr") << "set flag 1 on b to F\n"; - b.setAttribute(TestFlag1cd(), false); - Debug("cdboolattr") << "set flag 1 on c to F\n"; - c.setAttribute(TestFlag1cd(), false); - - Debug("cdboolattr") << "get flag 1 on a (should be T)\n"; - TS_ASSERT(a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - d_smtEngine->push(); // level 2 - - Debug("cdboolattr") << "get flag 1 on a (should be T)\n"; - TS_ASSERT(a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - Debug("cdboolattr") << "set flag 1 on a to F\n"; - a.setAttribute(TestFlag1cd(), false); - Debug("cdboolattr") << "set flag 1 on b to T\n"; - b.setAttribute(TestFlag1cd(), true); - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be T)\n"; - TS_ASSERT(b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - d_smtEngine->push(); // level 3 - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be T)\n"; - TS_ASSERT(b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - Debug("cdboolattr") << "set flag 1 on c to T\n"; - c.setAttribute(TestFlag1cd(), true); - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be T)\n"; - TS_ASSERT(b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be T)\n"; - TS_ASSERT(c.getAttribute(TestFlag1cd())); - - d_smtEngine->pop(); // level 2 - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be T)\n"; - TS_ASSERT(b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - d_smtEngine->pop(); // level 1 - - Debug("cdboolattr") << "get flag 1 on a (should be T)\n"; - TS_ASSERT(a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - d_smtEngine->pop(); // level 0 - - Debug("cdboolattr") << "get flag 1 on a (should be F)\n"; - TS_ASSERT(! a.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on b (should be F)\n"; - TS_ASSERT(! b.getAttribute(TestFlag1cd())); - Debug("cdboolattr") << "get flag 1 on c (should be F)\n"; - TS_ASSERT(! c.getAttribute(TestFlag1cd())); - - TS_ASSERT_THROWS( d_smtEngine->pop(), ModalException ); - } - void testAttributes() { //Debug.on("boolattr"); -- cgit v1.2.3