/[storm]/storm/org/nongnu/storm/BlockId.test
ViewVC logotype

Diff of /storm/org/nongnu/storm/BlockId.test

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

revision 1.6 by benja, Tue Apr 15 08:48:11 2003 UTC revision 1.7 by benja, Tue Apr 15 09:33:41 2003 UTC
# Line 122  def check2(id, data): Line 122  def check2(id, data):
122      except BlockId.WrongIdException: return 0      except BlockId.WrongIdException: return 0
123      else: return 1      else: return 1
124    
125    def check3(id, data):
126        s = java.io.ByteArrayInputStream(data)
127        s2 = id.getCheckedInputStream(s)
128    
129        try: s2.close()
130        except BlockId.WrongIdException: return 0
131        else: return 1
132    
133    
134  def testCheck():  def testCheck():
135      id_1 = BlockId(uri_1)      id_1 = BlockId(uri_1)
# Line 139  def testCheck(): Line 147  def testCheck():
147            
148      assert check2(id_3, data_3)      assert check2(id_3, data_3)
149      assert (not check2(id_1, data_3)) and (not check2(id_2, data_3))      assert (not check2(id_1, data_3)) and (not check2(id_2, data_3))
150    
151        assert check3(id_2, data_2)
152        assert (not check3(id_1, data_2)) and (not check3(id_3, data_2))
153        
154        assert check3(id_3, data_3)
155        assert (not check3(id_1, data_3)) and (not check3(id_2, data_3))

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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