summary refs log tree commit diff stats
path: root/tests/manyloc
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-02-23 04:31:53 -0800
committerGitHub <noreply@github.com>2021-02-23 13:31:53 +0100
commit5d95137ce040edd181e56bc132ce319e59bd1ee4 (patch)
treeb17fa6e6298cbc4d5d24fef398b754c88b783681 /tests/manyloc
parentb1a3651ae4e2db9ea46ab5c6c82f554d963d8506 (diff)
downloadNim-5d95137ce040edd181e56bc132ce319e59bd1ee4.tar.gz
remove tests/deps/ (#17132)
* remove tests/deps/

* fix tests

* fix tests/manyloc/keineschweine/lib/zlib_helpers.nim

* fixup
Diffstat (limited to 'tests/manyloc')
-rw-r--r--tests/manyloc/keineschweine/lib/zlib_helpers.nim15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/manyloc/keineschweine/lib/zlib_helpers.nim b/tests/manyloc/keineschweine/lib/zlib_helpers.nim
index 895f41759..e51c000c8 100644
--- a/tests/manyloc/keineschweine/lib/zlib_helpers.nim
+++ b/tests/manyloc/keineschweine/lib/zlib_helpers.nim
@@ -1,21 +1,26 @@
+# xxx this test is bad (echo instead of error, etc)
+
 import zip/zlib
 
 proc compress*(source: string): string =
   var
     sourcelen = source.len
-    destlen = sourcelen + (sourcelen.float * 0.1).int + 16
+    destLen = sourcelen + (sourcelen.float * 0.1).int + 16
   result = ""
   result.setLen destLen
-  var res = zlib.compress(cstring(result), addr destLen, cstring(source), sourceLen)
+  # see http://www.zlib.net/zlib-1.2.11.tar.gz for correct definitions
+  var destLen2 = destLen.Ulongf
+  var res = zlib.compress(cstring(result), addr destLen2, cstring(source), sourceLen.Ulong)
   if res != Z_OK:
     echo "Error occurred: ", res
-  elif destLen < result.len:
-    result.setLen(destLen)
+  elif destLen2.int < result.len:
+    result.setLen(destLen2.int)
 
 proc uncompress*(source: string, destLen: var int): string =
   result = ""
   result.setLen destLen
-  var res = zlib.uncompress(cstring(result), addr destLen, cstring(source), source.len)
+  var destLen2 = destLen.Ulongf
+  var res = zlib.uncompress(cstring(result), addr destLen2, cstring(source), source.len.Ulong)
   if res != Z_OK:
     echo "Error occurred: ", res