summaryrefslogtreecommitdiff
path: root/test/unit/context/context_black.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/context/context_black.h')
-rw-r--r--test/unit/context/context_black.h45
1 files changed, 8 insertions, 37 deletions
diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h
index 64ad2d7f7..f06ed9f42 100644
--- a/test/unit/context/context_black.h
+++ b/test/unit/context/context_black.h
@@ -10,17 +10,20 @@
** See the file COPYING in the top-level source directory for licensing
** information.
**
- ** Black box testing of CVC4::Node.
+ ** Black box testing of CVC4::context::Context.
**/
#include <cxxtest/TestSuite.h>
-//Used in some of the tests
#include <vector>
#include <iostream>
#include "context/context.h"
+#include "context/cdlist.h"
+#include "context/cdo.h"
+#include "util/Assert.h"
using namespace std;
+using namespace CVC4;
using namespace CVC4::context;
class ContextBlack : public CxxTest::TestSuite {
@@ -31,7 +34,7 @@ private:
public:
void setUp() {
- d_context = new Context();
+ d_context = new Context;
}
void testIntCDO() {
@@ -53,40 +56,8 @@ public:
// the interface doesn't declare any exceptions
d_context->push();
d_context->pop();
-// d_context->pop();
-// d_context->pop();
- }
-
- // test at different sizes. this triggers grow() behavior differently.
- // grow() is completely broken in revision 256; fix forthcoming by Tim
- void testCDList10() { listTest(10); }
- void testCDList15() { listTest(15); }
- void testCDList20() { listTest(20); }
- void testCDList35() { listTest(35); }
- void testCDList50() { listTest(50); }
- void testCDList99() { listTest(99); }
-
- void listTest(int N) {
- CDList<int> list(d_context);
-
- TS_ASSERT(list.empty());
- for(int i = 0; i < N; ++i) {
- TS_ASSERT(list.size() == i);
- list.push_back(i);
- TS_ASSERT(!list.empty());
- TS_ASSERT(list.back() == i);
- int i2 = 0;
- for(CDList<int>::const_iterator j = list.begin();
- j != list.end();
- ++j) {
- TS_ASSERT(*j == i2++);
- }
- }
- TS_ASSERT(list.size() == N);
-
- for(int i = 0; i < N; ++i) {
- TS_ASSERT(list[i] == i);
- }
+ TS_ASSERT_THROWS( d_context->pop(), AssertionException );
+ TS_ASSERT_THROWS( d_context->pop(), AssertionException );
}
void tearDown() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback