beginings of test for CDO. one fail
authorDejan Jovanović <dejan.jovanovic@gmail.com>
Tue, 2 Feb 2010 22:01:59 +0000 (22:01 +0000)
committerDejan Jovanović <dejan.jovanovic@gmail.com>
Tue, 2 Feb 2010 22:01:59 +0000 (22:01 +0000)
src/context/context.h
test/unit/Makefile.am
test/unit/context/context_black.h [new file with mode: 0644]

index c59955f8dd7c21641125fbb6fbda58bf6314a71a..2a4b2df2f13a03bdc2beb0da698f3911e98b4058 100644 (file)
@@ -314,13 +314,6 @@ class ContextObj {
    */
   ContextObj* restoreAndContinue();
 
-  /**
-   * Disable delete: objects allocated with new(ContextMemorymanager) should
-   * never be deleted.  Objects allocated with new(bool) should be deleted by
-   * calling deleteSelf().
-   */
-  static void operator delete(void* pMem) { }
-
 protected:
   /**
    * This is a method that must be implemented by all classes inheriting from
@@ -398,6 +391,15 @@ public:
    */
   void deleteSelf() { ::operator delete(this); }
 
+  /**
+   * Disable delete: objects allocated with new(ContextMemorymanager) should
+   * never be deleted.  Objects allocated with new(bool) should be deleted by
+   * calling deleteSelf().
+   */
+  static void operator delete(void* pMem) {
+    AlwaysAssert(false, "Not Allowed!");
+  }
+
 }; /* class ContextObj */
 
   /**
index dfe345afe958a0c4965f328151439023c4603e6c..9984a9111c36035be976aa8de069347e3b5d13b5 100644 (file)
@@ -2,7 +2,8 @@
 UNIT_TESTS = \
        expr/node_white \
        expr/node_black \
-       parser/parser_black
+       parser/parser_black \
+       context/context_black
 
 # Things that aren't tests but that tests rely on and need to
 # go into the distribution
diff --git a/test/unit/context/context_black.h b/test/unit/context/context_black.h
new file mode 100644 (file)
index 0000000..44ed52d
--- /dev/null
@@ -0,0 +1,43 @@
+/*********************                                           -*- C++ -*-  */
+/** node_black.h
+ ** Original author: mdeters
+ ** Major contributors: none
+ ** Minor contributors (to current version): dejan
+ ** This file is part of the CVC4 prototype.
+ ** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
+ ** Courant Institute of Mathematical Sciences
+ ** New York University
+ ** See the file COPYING in the top-level source directory for licensing
+ ** information.
+ **
+ ** Black box testing of CVC4::Node.
+ **/
+
+#include <cxxtest/TestSuite.h>
+
+//Used in some of the tests
+#include <vector>
+#include "context/context.h"
+
+using namespace std;
+using namespace CVC4::context;
+
+class ContextBlack : public CxxTest::TestSuite {
+private:
+
+  Context* d_context;
+
+public:
+
+  void setUp() {
+    d_context = new Context();
+  }
+
+  void testIntCDO() {
+    CDO<int> a1(d_context);
+  }
+
+  void tearDown(){
+    delete d_context;
+  }
+};