;;;; mman.test --- Tests for mmap API. -*- scheme -*- ;;;; ;;;; Copyright 2022 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either ;;;; version 3 of the License, or (at your option) any later version. ;;;; ;;;; This library is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; Lesser General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU Lesser General Public ;;;; License along with this library; if not, write to the Free Software ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA (define-module (test-mman) #:use-module (test-suite lib) #:use-module (test-suite guile-test) #:use-module (rnrs bytevectors) #:declarative? #f ) (define (mmap-test-file) (data-file-name "foo.txt")) (define mmap-test-string "hello, world") (define (gen-mmap-test-file) (with-output-to-file (mmap-test-file) (lambda () (display mmap-test-string)))) (when (provided? 'mman) (gen-mmap-test-file) (with-test-prefix "mman" (pass-if "mman 1" (let ((bv (mmap 0 #x100))) (bytevector-u8-set! bv 0 34) (= (bytevector-u8-ref bv 0) 34))) )) ;; --- last line ---