summaryrefslogtreecommitdiff
path: root/test/unit/expr/node_builder_black.h
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-03-12 23:52:14 +0000
committerMorgan Deters <mdeters@gmail.com>2010-03-12 23:52:14 +0000
commitc8e9b1d6422b56476a2efb3fbaf19bce66de4c2b (patch)
treeaa2b6400b7a5663599eff687310c509156ca788d /test/unit/expr/node_builder_black.h
parent856567b63c56b238db8a5bb84ad0da7990c1f1eb (diff)
* src/context/cdmap.h: rename orderedIterator to iterator, do away
with old iterator (closes bug #47). * src/context/cdset.h: implemented. * src/expr/node_builder.h: fixed all the strict-aliasing warnings. * Remove Node::hash() and Expr::hash() (they had been aliases for getId()). There's now a NodeValue::internalHash(), for internal expr package purposes only, that doesn't depend on the ID. That's the only hashing of Nodes or Exprs. * Automake-quiet generation of kind.h, theoryof_table.h, and CVC and SMT parsers. * various minor code cleanups.
Diffstat (limited to 'test/unit/expr/node_builder_black.h')
-rw-r--r--test/unit/expr/node_builder_black.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/expr/node_builder_black.h b/test/unit/expr/node_builder_black.h
index ab3c1c842..46e524f59 100644
--- a/test/unit/expr/node_builder_black.h
+++ b/test/unit/expr/node_builder_black.h
@@ -647,4 +647,25 @@ public:
TS_ASSERT_EQUALS(Node(- a + b), d_nm->mkNode(PLUS, d_nm->mkNode(UMINUS, a), b));
TS_ASSERT_EQUALS(Node(- a * b), d_nm->mkNode(MULT, d_nm->mkNode(UMINUS, a), b));
}
+
+ /**
+ * This tests the "stack builder"
+ */
+ void testStackBuilder() {
+ try {
+ for(unsigned i = 0; i < 100; ++i) {
+ size_t n = 1 + (rand() % 50);
+
+ // make a builder "b" with a backing store for n children
+ makeStackNodeBuilder(b, n);
+
+ // build one-past-the-end
+ for(size_t j = 0; j <= n; ++j) {
+ b << Node::null();
+ }
+ }
+ } catch(Exception e) {
+ std::cout << e;
+ }
+ }
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback