[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Make FEC build, link -- doesnt work right yet.



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv6866/lib/mixminion

Modified Files:
	test.py 
Log Message:
Make FEC build, link -- doesnt work right yet.

Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- test.py	7 Jul 2003 19:27:15 -0000	1.130
+++ test.py	7 Jul 2003 23:46:51 -0000	1.131
@@ -841,6 +841,32 @@
         self.assertEquals(p.encode_key(0), p2.encode_key(0))
 
 #----------------------------------------------------------------------
+class MinionlibFECTests(unittest.TestCase):
+    def test_good_fec(self):
+        eq = self.assertEquals
+        f3_5 = _ml.FEC_generate(3,5)
+        eq((3,5), f3_5.getParameters())
+        inp = [ "Amidst the mists   ",
+                "and coolests frosts",
+                "with barest wrists " ]
+
+        eq(inp[0], f3_5.encode(0, inp))
+        eq(inp[1], f3_5.encode(1, inp))
+        eq(inp[2], f3_5.encode(2, inp))
+                
+        ch1 = f3_5.encode(3, inp)
+        ch2 = f3_5.encode(4, inp)
+        
+        print inp
+
+        eq("".join(inp), f3_5.decode([(0, inp[0]), (1, inp[1]), (2, inp[2])]))
+        print inp
+        eq("".join(inp), f3_5.decode([(0, inp[0]), (1, inp[1]), (3, ch1)]))
+
+        print "HERE"
+
+
+#----------------------------------------------------------------------
 
 class CryptoTests(unittest.TestCase):
     """Tests for Python cryptographic library"""
@@ -6043,11 +6069,12 @@
     tc = loader.loadTestsFromTestCase
 
     if 0:
-        suite.addTest(tc(ModuleTests))
+        suite.addTest(tc(MinionlibFECTests))
         return suite
 
     suite.addTest(tc(MiscTests))
     suite.addTest(tc(MinionlibCryptoTests))
+    suite.addTest(tc(MinionlibFECTests))
     suite.addTest(tc(CryptoTests))
     suite.addTest(tc(PacketTests))
     suite.addTest(tc(LogTests))