Commits

David Krentzlin committed ca77df1

added regression test for the bug that made sendfile fail for files > 1 mebibyte

Comments (0)

Files changed (2)

 
  (let* ((mb-buffer (generate-buffer (mebibytes 1)))
         (mb-checksum (buffer-checksum mb-buffer)))
+
+
+   (define (stream-mb-buffer)
+     (call-with-temporary-file/checksum
+      mb-buffer
+      (lambda (temp-file _)
+        (stream-file temp-file sendfile))))
  
    (test-group "sendfile main interface"
                (test "sendfile"
                      mb-checksum
-                     (call-with-temporary-file/checksum
-                      mb-buffer
-                      (lambda (temp-file _)
-                        (stream-file temp-file sendfile)))))
+                     (stream-mb-buffer)))
 
-   (test-group "regression"               
+
+   (test-group "forcing implementation"
+               (parameterize ((force-implementation 'read-write))
+                 (test "read-write"
+                       mb-checksum
+                       (stream-mb-buffer))))
+
+   (test-group "bugs"               
                (call-with-buffer/checksum
                 (kibibytes 1)
                 (lambda (buffer checksum)

tests/test-helper.scm

     (lambda (tempfile-path)
       (proc tempfile-path (buffer-checksum content)))))
 
-
-
 (define (mebibytes amount)
   (* amount (kibibytes 1024)))