gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz lava/gzz/zzutil/Containment.java lava/test/...


From: Benja Fallenstein
Subject: [Gzz-commits] gzz lava/gzz/zzutil/Containment.java lava/test/...
Date: Mon, 25 Nov 2002 18:52:51 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      02/11/25 18:52:51

Modified files:
        lava/gzz/zzutil: Containment.java 
        lava/test/gzz/storm/impl: ZipPool.test 
        test           : testutil.py 
Added files:
        lava/gzz/potion/potions: Break.java Clone.java 
        lava/gzz/zzutil: Connection.java Place.java 
        lava/test/gzz/zzutil: Containment.test 
Removed files:
        lava/gzz/potion/potions: README 

Log message:
        potion work; containment half done

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/Break.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/potion/potions/Clone.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/zzutil/Connection.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/zzutil/Place.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/gzz/zzutil/Containment.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/test/gzz/storm/impl/ZipPool.test.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/lava/test/gzz/zzutil/Containment.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/testutil.py.diff?tr1=1.41&tr2=1.42&r1=text&r2=text

Patches:
Index: gzz/lava/gzz/zzutil/Containment.java
diff -u gzz/lava/gzz/zzutil/Containment.java:1.3 
gzz/lava/gzz/zzutil/Containment.java:1.4
--- gzz/lava/gzz/zzutil/Containment.java:1.3    Thu Nov  7 17:52:42 2002
+++ gzz/lava/gzz/zzutil/Containment.java        Mon Nov 25 18:52:50 2002
@@ -33,15 +33,43 @@
      *  structure and joins the text of the different cells
      *  together.
      */
-    public String getContainedText(Cell c) {
-       return null;
+    public static String getContainedText(Cell c) {
+       Dim d_contain = c.space.getDim(Ids.d_contain);
+       Dim d_contain_list = c.space.getDim(Ids.d_contain_list);
+
+       String s = c.t();
+       Cell head = c.s(d_contain);
+       if(head == null) return s;
+
+       Cell x = head;
+       do {
+           s += getContainedText(x);
+           x = x.s(d_contain_list);
+       } while(x != null && !x.equals(head));
+
+       return s;
     }
 
     /** Get the contents of this cell as an Enfilade1D,
      *  as specified by the containment mechanism.
      */
-    public Enfilade1D getContainedEnfilade(Cell c) {
-       return null;
+    public static Enfilade1D getContainedEnfilade(Cell c) {
+       VStreamCellTexter t = (VStreamCellTexter)c.space.getCellTexter();
+       Dim d_contain = c.space.getDim(Ids.d_contain);
+       Dim d_contain_list = c.space.getDim(Ids.d_contain_list);
+
+       Enfilade1D enf = t.getEnfilade(c, null);
+
+       Cell head = c.s(d_contain);
+       if(head == null) return enf;
+
+       Cell x = head;
+       do {
+           enf = enf.plus(getContainedEnfilade(x));
+           x = x.s(d_contain_list);
+       } while(x != null && !x.equals(head));
+
+       return enf;
     }
 
     /** Add the 'add' cell to the end of the list of cells
@@ -54,7 +82,7 @@
      *        (i.e., has a connection on d..contain-list, or
      *        a connection negwards on d.contain).
      */
-    public void addContainedCell(Cell add, Cell into) 
+    public static void addContainedCell(Cell add, Cell into) 
                                throws IllegalArgumentException {
     }
 }
Index: gzz/lava/test/gzz/storm/impl/ZipPool.test
diff -u gzz/lava/test/gzz/storm/impl/ZipPool.test:1.2 
gzz/lava/test/gzz/storm/impl/ZipPool.test:1.3
--- gzz/lava/test/gzz/storm/impl/ZipPool.test:1.2       Mon Nov 25 11:12:10 2002
+++ gzz/lava/test/gzz/storm/impl/ZipPool.test   Mon Nov 25 18:52:50 2002
@@ -19,7 +19,6 @@
 import java, gzz
 
 file = gzz.util.TempFileUtil.tmpFile(java.io.File("."));
-print file.__class__
 
 s = gzz.storm.StormPoolTest()
 p = gzz.storm.impl.ZipPool(file)
Index: gzz/test/testutil.py
diff -u gzz/test/testutil.py:1.41 gzz/test/testutil.py:1.42
--- gzz/test/testutil.py:1.41   Thu Nov 21 09:35:11 2002
+++ gzz/test/testutil.py        Mon Nov 25 18:52:51 2002
@@ -37,6 +37,7 @@
 from gzz.client import GraphicsAPI
 import gzz.util.saveimage
 import re
+import test.tools.tools as tools
 
 true = 1
 false = 0
@@ -120,6 +121,12 @@
     unittestObject.fail(msg)
 """, "testutil", 'exec')
 
+def space():
+    """
+    Convenience method for creating new spaces in tests.
+    """
+    return gzz.impl.ModularSpace(*tools.spaceArgList())
+
 
 def load(file):
     """Load a file into a class (currently simplistic)."""
@@ -146,6 +153,7 @@
             self.module = imp.new_module(%s)
            self.module.unittestObject = self
            self.module.needGL = needGL
+            self.module.space = space
            exec faildefs in self.module.__dict__
             exec self.code in self.module.__dict__
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]