Commits

Jeff Hardy committed 2392a06

Change Crc signature to handle some edge cases.

Comments (0)

Files changed (4)

IronPython.Zlib/IronPython.Zlib.csproj

     <Compile Include="ZlibModule.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="license.txt" />
+    <Content Include="readme.txt" />
+    <Content Include="run_tests.py" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

IronPython.Zlib/IronPython.Zlib.suo

Binary file modified.

IronPython.Zlib/ZlibModule.cs

             return crc32(data, 0);
         }
 
-        public static int crc32(string data, uint value)
+        public static int crc32(string data, long value)
         {
-            return (int)Crc32.Calculate(value, Latin1.GetBytes(data));
+            return (int)Crc32.Calculate((uint)value, Latin1.GetBytes(data));
         }
 
         #endregion

IronPython.Zlib/run_tests.py

 import sys
 p = r'C:\Users\Jeff\Documents\Repositories\python\Lib'
 if p not in sys.path:
-    sys.path.append(p)
+    sys.path.insert(0, p)
 
-import clr
-clr.AddReference('IronPython.Zlib')
+#import clr
+#clr.AddReferenceToFileAndPath(r'C:\Users\Jeff\Documents\Repositories\code\IronPython.Zlib\bin\Debug\IronPython.Zlib.dll')
 
 import zlib
+import gzip
+import tarfile
 
-from test import test_zlib
-test_zlib.test_main()
+f = tarfile.open(r'C:\Users\Jeff\Documents\Repositories\simplejson-2.0.6.tar.gz')
+
+#from test import test_zlib
+#test_zlib.test_main()
+
+#from test import test_gzip
+#test_gzip.test_main()
+
+#from test import test_zipfile
+#test_zipfile.test_main()
+
+#from test import test_tarfile
+#test_tarfile.test_main()
 
 #~ lipsum = """
 #~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vel nisl quis neque venenatis volutpat. Pellentesque viverra placerat lectus. Vestibulum eleifend purus eget diam. Etiam porta, nisi a commodo hendrerit, orci odio feugiat quam, posuere molestie felis velit ullamcorper sem. Aenean pretium posuere turpis. Donec dapibus arcu ut neque. Praesent pretium tempor nisi. Etiam dapibus, arcu eget semper tincidunt, diam mi suscipit felis, non congue orci neque blandit ligula. Suspendisse potenti. Quisque auctor ligula sit amet ipsum. Sed convallis arcu quis arcu. Cras bibendum ligula sit amet tellus. Curabitur et nulla vel libero tempus facilisis. Nullam gravida, ligula id venenatis ornare, justo lacus pretium diam, aliquet ullamcorper leo turpis id quam. Fusce quis magna. Donec facilisis velit ut risus. Mauris eros. Ut luctus turpis eget dolor dictum suscipit.