diff options
author | Tim King <taking@cs.nyu.edu> | 2018-08-13 09:25:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 09:25:26 -0700 |
commit | 957b02e415f60e725da569f1d7c0e2d1276cb3fa (patch) | |
tree | e588e05f4c1fb2320f7902618f49d188d043517d /test/unit | |
parent | b62055f1204a0846eef728b2b62e5fc77df4048c (diff) |
Removing support for T* and const T* attributes. (#2297)
* Removing support for T* and const T* attributes. These are unused.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/expr/attribute_black.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/test/unit/expr/attribute_black.h b/test/unit/expr/attribute_black.h index 971c28684..afc99ef32 100644 --- a/test/unit/expr/attribute_black.h +++ b/test/unit/expr/attribute_black.h @@ -57,36 +57,6 @@ public: delete d_exprManager; } - class MyData { - public: - static int count; - MyData() { count ++; } - ~MyData() { count --; } - }; - - struct MyDataAttributeId {}; - - struct MyDataCleanupFunction { - static void cleanup(MyData* myData){ - delete myData; - } - }; - - typedef expr::Attribute<MyDataAttributeId, MyData*, MyDataCleanupFunction> MyDataAttribute; - - void testDeallocation() { - TypeNode booleanType = d_nodeManager->booleanType(); - Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); - MyData* data; - MyData* data1; - MyDataAttribute attr; - TS_ASSERT(!node->getAttribute(attr, data)); - node->setAttribute(attr, new MyData()); - TS_ASSERT(node->getAttribute(attr, data1)); - TS_ASSERT(MyData::count == 1); - delete node; - } - struct PrimitiveIntAttributeId {}; typedef expr::Attribute<PrimitiveIntAttributeId,uint64_t> PrimitiveIntAttribute; void testInts(){ @@ -125,56 +95,6 @@ public: delete node; } - class Foo { - int d_bar; - public: - Foo(int b) : d_bar(b) {} - int getBar() const { return d_bar; } - }; - - struct PtrAttributeId {}; - - typedef expr::Attribute<PtrAttributeId, Foo*> PtrAttribute; - void testPtrs(){ - TypeNode booleanType = d_nodeManager->booleanType(); - Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); - - Foo* val = new Foo(63489); - Foo* data0 = NULL; - Foo* data1 = NULL; - - PtrAttribute attr; - TS_ASSERT(!node->getAttribute(attr, data0)); - node->setAttribute(attr, val); - TS_ASSERT(node->getAttribute(attr, data1)); - TS_ASSERT_EQUALS(data1, val); - - delete node; - delete val; - } - - - struct ConstPtrAttributeId {}; - - typedef expr::Attribute<ConstPtrAttributeId, const Foo*> ConstPtrAttribute; - void testConstPtrs(){ - TypeNode booleanType = d_nodeManager->booleanType(); - Node* node = new Node(d_nodeManager->mkSkolem("b", booleanType)); - - const Foo* val = new Foo(63489); - const Foo* data0 = NULL; - const Foo* data1 = NULL; - - ConstPtrAttribute attr; - TS_ASSERT(!node->getAttribute(attr, data0)); - node->setAttribute(attr, val); - TS_ASSERT(node->getAttribute(attr, data1)); - TS_ASSERT_EQUALS(data1, val); - - delete node; - delete val; - } - struct StringAttributeId {}; typedef expr::Attribute<StringAttributeId, std::string> StringAttribute; void testStrings(){ @@ -215,5 +135,3 @@ public: } }; - -int AttributeBlack::MyData::count = 0; |