/[gzz]/gzz/gzz/modules/email/AddressBookBinder.java
ViewVC logotype

Diff of /gzz/gzz/modules/email/AddressBookBinder.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by benja, Tue Oct 8 18:48:10 2002 UTC revision 1.2 by benja, Wed Oct 9 22:44:32 2002 UTC
# Line 62  public class AddressBookBinder { Line 62  public class AddressBookBinder {
62                  return c.s(d_2, dir);                  return c.s(d_2, dir);
63          }          }
64    
65          public void test(Space s) {          public void testInsertRow(Space s) {
66                  Cell home = s.getHomeCell();                  Cell home = s.getHomeCell();
67                  Dim d_1 = s.getDim(Ids.d_1);                  Dim d_1 = s.getDim(Ids.d_1);
68                  Dim d_2 = s.getDim(Ids.d_2);                  Dim d_2 = s.getDim(Ids.d_2);
# Line 99  public class AddressBookBinder { Line 99  public class AddressBookBinder {
99                       throw new Error();                       throw new Error();
100    
101          }          }
102            
103            public Cell deleteRow(Cell c) {
104                    Dim d_1 = c.space.getDim(Ids.d_1);
105                    Dim d_2 = c.space.getDim(Ids.d_2);
106                    
107                    Cell x = c.s(d_2, -1);
108                    if(x == null) x = c.s(d_2, 1);
109                    if(x == null) x = c.space.getHomeCell();
110                
111                    while(c.s(d_1, -1) != null) {
112                        c.s(d_1, -1).delete();
113                    }
114                    
115                    while(c.s(d_1, 1) != null) {
116                        c.s(d_1, 1).delete();
117                    }
118                    
119                    c.delete();
120                    
121                    return x;
122            }
123            
124            public void testDeleteRow(Space s) {
125                    Cell home = s.getHomeCell();
126                    Dim d_1 = s.getDim(Ids.d_1);
127                    Dim d_2 = s.getDim(Ids.d_2);
128                    
129                    Cell a = home.N(d_1, 1);
130                    Cell b = home.N(d_2, 1);
131                    Cell c = b.N(d_2, 1);
132                    Cell d = a.N(d_2, 1);
133                    Cell e = b.N(d_1, 1);
134                    
135                    d.connect(d_2, 1, e);
136                    d.connect(d_1, -1, c);
137                
138                    Cell x = deleteRow(e);
139                    
140                    if(!x.equals(d))
141                        throw new Error();
142                        
143                    if(!x.s(d_1, -1).equals(c))
144                        throw new Error();
145                        
146                    if(!c.s(d_2, -1).equals(home))
147                        throw new Error();
148                        
149                    if(!home.s(d_1, 1).equals(a))
150                        throw new Error();
151                        
152                    if(!a.s(d_2, 1).equals(d))
153                        throw new Error();
154                        
155                    if(c.s(d_2, 1) != null)
156                        throw new Error();
157                        
158                    if(d.s(d_2, 1) != null)
159                        throw new Error();
160            }
161  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26