summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2018-08-13 09:25:26 -0700
committerGitHub <noreply@github.com>2018-08-13 09:25:26 -0700
commit957b02e415f60e725da569f1d7c0e2d1276cb3fa (patch)
treee588e05f4c1fb2320f7902618f49d188d043517d /test/unit
parentb62055f1204a0846eef728b2b62e5fc77df4048c (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.h82
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback