source: project/release/5/memory-mapped-files/trunk/tests/run.scm @ 33430

Last change on this file since 33430 was 33430, checked in by sjamaan, 4 years ago

memory-mapped-files: use (chicken memory) instead of lolevel for move-memory! procedure in tests

File size: 557 bytes
1(use memory-mapped-files files posix (chicken memory))
4(let ((tnpfilpn (create-temporary-file)))
5  (let ((tmpfilno (file-open tnpfilpn (+ open/rdwr open/creat)))
6        (data "abcde")
7        (size 5))
8    (file-write tmpfilno data)
9    (let ((mmap (map-file-to-memory #f size prot/read (+ map/shared map/file) tmpfilno))
10          (str (make-string size)))
11      (move-memory! (memory-mapped-file-pointer mmap) str size)
12      (assert (blob=? (string->blob data) (string->blob str)))
13      (unmap-file-from-memory mmap)
14      (delete-file* tnpfilpn))))
Note: See TracBrowser for help on using the repository browser.