#! /bin/sh
exec ../src/sizzle -qs $0 $*
!#
;; test/uvector.scm -- tests for uniform vector primitives
;;
;; Copyright (C) 2000 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
;;
;; This is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; 
;; This software 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 General Public License for more details.
;; 
;; You should have received a copy of the GNU General Public License
;; along with this package; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.  


;; Load the test framework.

(load "test-suite.scm")

;; Actual tests.

(begin-section "s8vector functions")

(begin-sub-section "s8vector?")
(pass-if (s8vector? '#s8()) #t eq?)
(pass-if (s8vector? '#s8(1 2 3)) #t eq?)
(pass-if (s8vector? '#s8(-1 -2 -3)) #t eq?)

(begin-sub-section "make-s8vector")
(pass-if (make-s8vector 0) '#s8() equal?)
(pass-if (s8vector-length (make-s8vector 10)) 10 =)
(pass-if (make-s8vector 2 3) '#s8(3 3) equal?)

(begin-sub-section "s8vector")
(pass-if (s8vector 1 2 3) '#s8(1 2 3) equal?)
(pass-if (s8vector -1 -2 -3) '#s8(-1 -2 -3) equal?)

(begin-sub-section "s8vector-length")
(pass-if (s8vector-length '#s8()) 0 =)
(pass-if (s8vector-length '#s8(42 41 40 39)) 4 =)

(begin-sub-section "s8vector-ref")
(pass-if (s8vector-ref '#s8(1 -2 0) 0) 1 =)
(pass-if (s8vector-ref '#s8(1 -2 0) 1) -2 =)
(pass-if (s8vector-ref '#s8(1 -2 0) 2) 0 =)

(begin-sub-section "s8vector-set!")
(define a-test-s8vector (make-s8vector 4 23))
(s8vector-set! a-test-s8vector 0 11)
(pass-if a-test-s8vector '#s8(11 23 23 23) equal?)
(s8vector-set! a-test-s8vector 3 11)
(pass-if a-test-s8vector '#s8(11 23 23 11) equal?)

(begin-sub-section "s8vector->list")
(pass-if (s8vector->list '#s8()) '() equal?)
(pass-if (s8vector->list '#s8(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->s8vector")
(pass-if (list->s8vector '()) '#s8() equal?)
(pass-if (list->s8vector '(42 24 42 24 42)) '#s8(42 24 42 24 42) equal?)

(begin-sub-section "s8vector-fill!")
(define s8vector-fill-s (make-s8vector 4 -12))
(define s8vector-fill-a (make-s8vector 0))
(s8vector-fill! s8vector-fill-s 13)
(pass-if s8vector-fill-s '#s8(13 13 13 13) equal?)
(s8vector-fill! s8vector-fill-s 1)
(pass-if s8vector-fill-s '#s8(1 1 1 1) equal?)
(s8vector-fill! s8vector-fill-a 23)
(pass-if s8vector-fill-a '#s8() equal?)

(begin-section "u8vector functions")

(begin-sub-section "u8vector?")
(pass-if (u8vector? '#u8()) #t eq?)
(pass-if (u8vector? '#u8(1 2 3)) #t eq?)
(pass-if (u8vector? '#u8(1 2 3)) #t eq?)

(begin-sub-section "make-u8vector")
(pass-if (make-u8vector 0) '#u8() equal?)
(pass-if (u8vector-length (make-u8vector 10)) 10 =)
(pass-if (make-u8vector 2 3) '#u8(3 3) equal?)

(begin-sub-section "u8vector")
(pass-if (u8vector 1 2 3) '#u8(1 2 3) equal?)
(pass-if (u8vector 1 2 3) '#u8(1 2 3) equal?)

(begin-sub-section "u8vector-length")
(pass-if (u8vector-length '#u8()) 0 =)
(pass-if (u8vector-length '#u8(42 41 40 39)) 4 =)

(begin-sub-section "u8vector-ref")
(pass-if (u8vector-ref '#u8(1 2 0) 0) 1 =)
(pass-if (u8vector-ref '#u8(1 2 0) 1) 2 =)
(pass-if (u8vector-ref '#u8(1 2 0) 2) 0 =)

(begin-sub-section "u8vector-set!")
(define a-test-u8vector (make-u8vector 4 23))
(u8vector-set! a-test-u8vector 0 11)
(pass-if a-test-u8vector '#u8(11 23 23 23) equal?)
(u8vector-set! a-test-u8vector 3 11)
(pass-if a-test-u8vector '#u8(11 23 23 11) equal?)

(begin-sub-section "u8vector->list")
(pass-if (u8vector->list '#u8()) '() equal?)
(pass-if (u8vector->list '#u8(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->u8vector")
(pass-if (list->u8vector '()) '#u8() equal?)
(pass-if (list->u8vector '(42 24 42 24 42)) '#u8(42 24 42 24 42) equal?)

(begin-sub-section "u8vector-fill!")
(define u8vector-fill-s (make-u8vector 4 12))
(define u8vector-fill-a (make-u8vector 0))
(u8vector-fill! u8vector-fill-s 13)
(pass-if u8vector-fill-s '#u8(13 13 13 13) equal?)
(u8vector-fill! u8vector-fill-s 1)
(pass-if u8vector-fill-s '#u8(1 1 1 1) equal?)
(u8vector-fill! u8vector-fill-a 23)
(pass-if u8vector-fill-a '#u8() equal?)

(begin-section "s16vector functions")

(begin-sub-section "s16vector?")
(pass-if (s16vector? '#s16()) #t eq?)
(pass-if (s16vector? '#s16(1 2 3)) #t eq?)
(pass-if (s16vector? '#s16(-1 -2 -3)) #t eq?)

(begin-sub-section "make-s16vector")
(pass-if (make-s16vector 0) '#s16() equal?)
(pass-if (s16vector-length (make-s16vector 10)) 10 =)
(pass-if (make-s16vector 2 3) '#s16(3 3) equal?)

(begin-sub-section "s16vector")
(pass-if (s16vector 1 2 3) '#s16(1 2 3) equal?)
(pass-if (s16vector -1 -2 -3) '#s16(-1 -2 -3) equal?)

(begin-sub-section "s16vector-length")
(pass-if (s16vector-length '#s16()) 0 =)
(pass-if (s16vector-length '#s16(42 41 40 39)) 4 =)

(begin-sub-section "s16vector-ref")
(pass-if (s16vector-ref '#s16(1 -2 0) 0) 1 =)
(pass-if (s16vector-ref '#s16(1 -2 0) 1) -2 =)
(pass-if (s16vector-ref '#s16(1 -2 0) 2) 0 =)

(begin-sub-section "s16vector-set!")
(define a-test-s16vector (make-s16vector 4 23))
(s16vector-set! a-test-s16vector 0 11)
(pass-if a-test-s16vector '#s16(11 23 23 23) equal?)
(s16vector-set! a-test-s16vector 3 11)
(pass-if a-test-s16vector '#s16(11 23 23 11) equal?)

(begin-sub-section "s16vector->list")
(pass-if (s16vector->list '#s16()) '() equal?)
(pass-if (s16vector->list '#s16(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->s16vector")
(pass-if (list->s16vector '()) '#s16() equal?)
(pass-if (list->s16vector '(42 24 42 24 42)) '#s16(42 24 42 24 42) equal?)

(begin-sub-section "s16vector-fill!")
(define s16vector-fill-s (make-s16vector 4 -12))
(define s16vector-fill-a (make-s16vector 0))
(s16vector-fill! s16vector-fill-s 13)
(pass-if s16vector-fill-s '#s16(13 13 13 13) equal?)
(s16vector-fill! s16vector-fill-s 1)
(pass-if s16vector-fill-s '#s16(1 1 1 1) equal?)
(s16vector-fill! s16vector-fill-a 23)
(pass-if s16vector-fill-a '#s16() equal?)

(begin-section "u16vector functions")

(begin-sub-section "u16vector?")
(pass-if (u16vector? '#u16()) #t eq?)
(pass-if (u16vector? '#u16(1 2 3)) #t eq?)
(pass-if (u16vector? '#u16(1 2 3)) #t eq?)

(begin-sub-section "make-u16vector")
(pass-if (make-u16vector 0) '#u16() equal?)
(pass-if (u16vector-length (make-u16vector 10)) 10 =)
(pass-if (make-u16vector 2 3) '#u16(3 3) equal?)

(begin-sub-section "u16vector")
(pass-if (u16vector 1 2 3) '#u16(1 2 3) equal?)
(pass-if (u16vector 1 2 3) '#u16(1 2 3) equal?)

(begin-sub-section "u16vector-length")
(pass-if (u16vector-length '#u16()) 0 =)
(pass-if (u16vector-length '#u16(42 41 40 39)) 4 =)

(begin-sub-section "u16vector-ref")
(pass-if (u16vector-ref '#u16(1 2 0) 0) 1 =)
(pass-if (u16vector-ref '#u16(1 2 0) 1) 2 =)
(pass-if (u16vector-ref '#u16(1 2 0) 2) 0 =)

(begin-sub-section "u16vector-set!")
(define a-test-u16vector (make-u16vector 4 23))
(u16vector-set! a-test-u16vector 0 11)
(pass-if a-test-u16vector '#u16(11 23 23 23) equal?)
(u16vector-set! a-test-u16vector 3 11)
(pass-if a-test-u16vector '#u16(11 23 23 11) equal?)

(begin-sub-section "u16vector->list")
(pass-if (u16vector->list '#u16()) '() equal?)
(pass-if (u16vector->list '#u16(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->u16vector")
(pass-if (list->u16vector '()) '#u16() equal?)
(pass-if (list->u16vector '(42 24 42 24 42)) '#u16(42 24 42 24 42) equal?)

(begin-sub-section "u16vector-fill!")
(define u16vector-fill-s (make-u16vector 4 12))
(define u16vector-fill-a (make-u16vector 0))
(u16vector-fill! u16vector-fill-s 13)
(pass-if u16vector-fill-s '#u16(13 13 13 13) equal?)
(u16vector-fill! u16vector-fill-s 1)
(pass-if u16vector-fill-s '#u16(1 1 1 1) equal?)
(u16vector-fill! u16vector-fill-a 23)
(pass-if u16vector-fill-a '#u16() equal?)

(begin-section "s32vector functions")

(begin-sub-section "s32vector?")
(pass-if (s32vector? '#s32()) #t eq?)
(pass-if (s32vector? '#s32(1 2 3)) #t eq?)
(pass-if (s32vector? '#s32(-1 -2 -3)) #t eq?)

(begin-sub-section "make-s32vector")
(pass-if (make-s32vector 0) '#s32() equal?)
(pass-if (s32vector-length (make-s32vector 10)) 10 =)
(pass-if (make-s32vector 2 3) '#s32(3 3) equal?)

(begin-sub-section "s32vector")
(pass-if (s32vector 1 2 3) '#s32(1 2 3) equal?)
(pass-if (s32vector -1 -2 -3) '#s32(-1 -2 -3) equal?)

(begin-sub-section "s32vector-length")
(pass-if (s32vector-length '#s32()) 0 =)
(pass-if (s32vector-length '#s32(42 41 40 39)) 4 =)

(begin-sub-section "s32vector-ref")
(pass-if (s32vector-ref '#s32(1 -2 0) 0) 1 =)
(pass-if (s32vector-ref '#s32(1 -2 0) 1) -2 =)
(pass-if (s32vector-ref '#s32(1 -2 0) 2) 0 =)

(begin-sub-section "s32vector-set!")
(define a-test-s32vector (make-s32vector 4 23))
(s32vector-set! a-test-s32vector 0 11)
(pass-if a-test-s32vector '#s32(11 23 23 23) equal?)
(s32vector-set! a-test-s32vector 3 11)
(pass-if a-test-s32vector '#s32(11 23 23 11) equal?)

(begin-sub-section "s32vector->list")
(pass-if (s32vector->list '#s32()) '() equal?)
(pass-if (s32vector->list '#s32(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->s32vector")
(pass-if (list->s32vector '()) '#s32() equal?)
(pass-if (list->s32vector '(42 24 42 24 42)) '#s32(42 24 42 24 42) equal?)

(begin-sub-section "s32vector-fill!")
(define s32vector-fill-s (make-s32vector 4 -12))
(define s32vector-fill-a (make-s32vector 0))
(s32vector-fill! s32vector-fill-s 13)
(pass-if s32vector-fill-s '#s32(13 13 13 13) equal?)
(s32vector-fill! s32vector-fill-s 1)
(pass-if s32vector-fill-s '#s32(1 1 1 1) equal?)
(s32vector-fill! s32vector-fill-a 23)
(pass-if s32vector-fill-a '#s32() equal?)

(begin-section "u32vector functions")

(begin-sub-section "u32vector?")
(pass-if (u32vector? '#u32()) #t eq?)
(pass-if (u32vector? '#u32(1 2 3)) #t eq?)
(pass-if (u32vector? '#u32(1 2 3)) #t eq?)

(begin-sub-section "make-u32vector")
(pass-if (make-u32vector 0) '#u32() equal?)
(pass-if (u32vector-length (make-u32vector 10)) 10 =)
(pass-if (make-u32vector 2 3) '#u32(3 3) equal?)

(begin-sub-section "u32vector")
(pass-if (u32vector 1 2 3) '#u32(1 2 3) equal?)
(pass-if (u32vector 1 2 3) '#u32(1 2 3) equal?)

(begin-sub-section "u32vector-length")
(pass-if (u32vector-length '#u32()) 0 =)
(pass-if (u32vector-length '#u32(42 41 40 39)) 4 =)

(begin-sub-section "u32vector-ref")
(pass-if (u32vector-ref '#u32(1 2 0) 0) 1 =)
(pass-if (u32vector-ref '#u32(1 2 0) 1) 2 =)
(pass-if (u32vector-ref '#u32(1 -2 0) 2) 0 =)

(begin-sub-section "u32vector-set!")
(define a-test-u32vector (make-u32vector 4 23))
(u32vector-set! a-test-u32vector 0 11)
(pass-if a-test-u32vector '#u32(11 23 23 23) equal?)
(u32vector-set! a-test-u32vector 3 11)
(pass-if a-test-u32vector '#u32(11 23 23 11) equal?)

(begin-sub-section "u32vector->list")
(pass-if (u32vector->list '#u32()) '() equal?)
(pass-if (u32vector->list '#u32(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->u32vector")
(pass-if (list->u32vector '()) '#u32() equal?)
(pass-if (list->u32vector '(42 24 42 24 42)) '#u32(42 24 42 24 42) equal?)

(begin-sub-section "u32vector-fill!")
(define u32vector-fill-s (make-u32vector 4 12))
(define u32vector-fill-a (make-u32vector 0))
(u32vector-fill! u32vector-fill-s 13)
(pass-if u32vector-fill-s '#u32(13 13 13 13) equal?)
(u32vector-fill! u32vector-fill-s 1)
(pass-if u32vector-fill-s '#u32(1 1 1 1) equal?)
(u32vector-fill! u32vector-fill-a 23)
(pass-if u32vector-fill-a '#u32() equal?)

(begin-section "s64vector functions")

(begin-sub-section "s64vector?")
(pass-if (s64vector? '#s64()) #t eq?)
(pass-if (s64vector? '#s64(1 2 3)) #t eq?)
(pass-if (s64vector? '#s64(-1 -2 -3)) #t eq?)

(begin-sub-section "make-s64vector")
(pass-if (make-s64vector 0) '#s64() equal?)
(pass-if (s64vector-length (make-s64vector 10)) 10 =)
(pass-if (make-s64vector 2 3) '#s64(3 3) equal?)

(begin-sub-section "s64vector")
(pass-if (s64vector 1 2 3) '#s64(1 2 3) equal?)
(pass-if (s64vector -1 -2 -3) '#s64(-1 -2 -3) equal?)

(begin-sub-section "s64vector-length")
(pass-if (s64vector-length '#s64()) 0 =)
(pass-if (s64vector-length '#s64(42 41 40 39)) 4 =)

(begin-sub-section "s64vector-ref")
(pass-if (s64vector-ref '#s64(1 -2 0) 0) 1 =)
(pass-if (s64vector-ref '#s64(1 -2 0) 1) -2 =)
(pass-if (s64vector-ref '#s64(1 -2 0) 2) 0 =)

(begin-sub-section "s64vector-set!")
(define a-test-s64vector (make-s64vector 4 23))
(s64vector-set! a-test-s64vector 0 11)
(pass-if a-test-s64vector '#s64(11 23 23 23) equal?)
(s64vector-set! a-test-s64vector 3 11)
(pass-if a-test-s64vector '#s64(11 23 23 11) equal?)

(begin-sub-section "s64vector->list")
(pass-if (s64vector->list '#s64()) '() equal?)
(pass-if (s64vector->list '#s64(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->s64vector")
(pass-if (list->s64vector '()) '#s64() equal?)
(pass-if (list->s64vector '(42 24 42 24 42)) '#s64(42 24 42 24 42) equal?)

(begin-sub-section "s64vector-fill!")
(define s64vector-fill-s (make-s64vector 4 -12))
(define s64vector-fill-a (make-s64vector 0))
(s64vector-fill! s64vector-fill-s 13)
(pass-if s64vector-fill-s '#s64(13 13 13 13) equal?)
(s64vector-fill! s64vector-fill-s 1)
(pass-if s64vector-fill-s '#s64(1 1 1 1) equal?)
(s64vector-fill! s64vector-fill-a 23)
(pass-if s64vector-fill-a '#s64() equal?)

(begin-section "u64vector functions")

(begin-sub-section "u64vector?")
(pass-if (u64vector? '#u64()) #t eq?)
(pass-if (u64vector? '#u64(1 2 3)) #t eq?)
(pass-if (u64vector? '#u64(1 2 3)) #t eq?)

(begin-sub-section "make-u64vector")
(pass-if (make-u64vector 0) '#u64() equal?)
(pass-if (u64vector-length (make-u64vector 10)) 10 =)
(pass-if (make-u64vector 2 3) '#u64(3 3) equal?)

(begin-sub-section "u64vector")
(pass-if (u64vector 1 2 3) '#u64(1 2 3) equal?)
(pass-if (u64vector 1 2 3) '#u64(1 2 3) equal?)

(begin-sub-section "u64vector-length")
(pass-if (u64vector-length '#u64()) 0 =)
(pass-if (u64vector-length '#u64(42 41 40 39)) 4 =)

(begin-sub-section "u64vector-ref")
(pass-if (u64vector-ref '#u64(1 2 0) 0) 1 =)
(pass-if (u64vector-ref '#u64(1 2 0) 1) 2 =)
(pass-if (u64vector-ref '#u64(1 -2 0) 2) 0 =)

(begin-sub-section "u64vector-set!")
(define a-test-u64vector (make-u64vector 4 23))
(u64vector-set! a-test-u64vector 0 11)
(pass-if a-test-u64vector '#u64(11 23 23 23) equal?)
(u64vector-set! a-test-u64vector 3 11)
(pass-if a-test-u64vector '#u64(11 23 23 11) equal?)

(begin-sub-section "u64vector->list")
(pass-if (u64vector->list '#u64()) '() equal?)
(pass-if (u64vector->list '#u64(1 2 3)) '(1 2 3) equal?)

(begin-sub-section "list->u64vector")
(pass-if (list->u64vector '()) '#u64() equal?)
(pass-if (list->u64vector '(42 24 42 24 42)) '#u64(42 24 42 24 42) equal?)

(begin-sub-section "u64vector-fill!")
(define u64vector-fill-s (make-u64vector 4 12))
(define u64vector-fill-a (make-u64vector 0))
(u64vector-fill! u64vector-fill-s 13)
(pass-if u64vector-fill-s '#u64(13 13 13 13) equal?)
(u64vector-fill! u64vector-fill-s 1)
(pass-if u64vector-fill-s '#u64(1 1 1 1) equal?)
(u64vector-fill! u64vector-fill-a 23)
(pass-if u64vector-fill-a '#u64() equal?)

(begin-section "f32vector functions")

(begin-sub-section "f32vector?")
(pass-if (f32vector? '#f32()) #t eq?)
(pass-if (f32vector? '#f32(1.1 2.2 3.3)) #t eq?)
(pass-if (f32vector? '#f32(1 2 3)) #t eq?)

(begin-sub-section "make-f32vector")
(pass-if (make-f32vector 0) '#f32() equal?)
(pass-if (f32vector-length (make-f32vector 10)) 10 =)
(pass-if (make-f32vector 2 3.2) '#f32(3.2 3.2) equal?)

(begin-sub-section "f32vector")
(pass-if (f32vector 1 2 3) '#f32(1 2 3) equal?)
(pass-if (f32vector 1.1 2.2 3.3) '#f32(1.1 2.2 3.3) equal?)
(pass-if (f32vector -1.1 -2.2 -3.3) '#f32(-1.1 -2.2 -3.3) equal?)

(begin-sub-section "f32vector-length")
(pass-if (f32vector-length '#f32()) 0 =)
(pass-if (f32vector-length '#f32(42.1 -41.6 40 -39.99999)) 4 =)

(begin-sub-section "f32vector-ref")
(pass-if (f32vector-ref '#f32(1 2 0) 0) 1 =)
(pass-if (f32vector-ref '#f32(1 -2 0) 1) -2 =)
(pass-if (f32vector-ref '#f32(1 -2 0) 2) 0 =)

(begin-sub-section "f32vector-set!")
(define a-test-f32vector (make-f32vector 4 23.5))
(f32vector-set! a-test-f32vector 0 11.1)
(pass-if a-test-f32vector '#f32(11.1 23.5 23.5 23.5) equal?)
(f32vector-set! a-test-f32vector 3 11.2)
(pass-if a-test-f32vector '#f32(11.1 23.5 23.5 11.2) equal?)

(begin-sub-section "f32vector->list")
(pass-if (f32vector->list '#f32()) '() equal?)
(pass-if (f32vector->list '#f32(1.0 2.0 -3.0)) '(1.0 2.0 -3.0) equal?)

(begin-sub-section "list->f32vector")
(pass-if (list->f32vector '()) '#f32() equal?)
(pass-if (list->f32vector '(42.1 24 42.2 24 42)) '#f32(42.1 24 42.2 24 42)
	 equal?)

(begin-sub-section "f32vector-fill!")
(define f32vector-fill-s (make-f32vector 4 12.2))
(define f32vector-fill-a (make-f32vector 0))
(f32vector-fill! f32vector-fill-s 13.3)
(pass-if f32vector-fill-s '#f32(13.3 13.3 13.3 13.3) equal?)
(f32vector-fill! f32vector-fill-s 1.0)
(pass-if f32vector-fill-s '#f32(1.0 1.0 1.0 1.0) equal?)
(f32vector-fill! f32vector-fill-a 23.3)
(pass-if f32vector-fill-a '#f32() equal?)

(begin-section "f64vector functions")

(begin-sub-section "f64vector?")
(pass-if (f64vector? '#f64()) #t eq?)
(pass-if (f64vector? '#f64(1.1 2.2 3.3)) #t eq?)
(pass-if (f64vector? '#f64(1 2 3)) #t eq?)

(begin-sub-section "make-f64vector")
(pass-if (make-f64vector 0) '#f64() equal?)
(pass-if (f64vector-length (make-f64vector 10)) 10 =)
(pass-if (make-f64vector 2 3.2) '#f64(3.2 3.2) equal?)

(begin-sub-section "f64vector")
(pass-if (f64vector 1 2 3) '#f64(1 2 3) equal?)
(pass-if (f64vector 1.1 2.2 3.3) '#f64(1.1 2.2 3.3) equal?)
(pass-if (f64vector -1.1 -2.2 -3.3) '#f64(-1.1 -2.2 -3.3) equal?)

(begin-sub-section "f64vector-length")
(pass-if (f64vector-length '#f64()) 0 =)
(pass-if (f64vector-length '#f64(42.1 -41.6 40 -39.99999)) 4 =)

(begin-sub-section "f64vector-ref")
(pass-if (f64vector-ref '#f64(1.1 2 0) 0) 1.1 =)
(pass-if (f64vector-ref '#f64(1 -2.1 0) 1) -2.1 =)
(pass-if (f64vector-ref '#f64(1 -2 0) 2) 0 =)

(begin-sub-section "f64vector-set!")
(define a-test-f64vector (make-f64vector 4 23.5))
(f64vector-set! a-test-f64vector 0 11.1)
(pass-if a-test-f64vector '#f64(11.1 23.5 23.5 23.5) equal?)
(f64vector-set! a-test-f64vector 3 11.2)
(pass-if a-test-f64vector '#f64(11.1 23.5 23.5 11.2) equal?)

(begin-sub-section "f64vector->list")
(pass-if (f64vector->list '#f64()) '() equal?)
(pass-if (f64vector->list '#f64(1.1 2.2 -3.3)) '(1.1 2.2 -3.3) equal?)

(begin-sub-section "list->f64vector")
(pass-if (list->f64vector '()) '#f64() equal?)
(pass-if (list->f64vector '(42.1 24 42.2 24 42)) '#f64(42.1 24 42.2 24 42)
	 equal?)

(begin-sub-section "f64vector-fill!")
(define f64vector-fill-s (make-f64vector 4 12.2))
(define f64vector-fill-a (make-f64vector 0))
(f64vector-fill! f64vector-fill-s 13.3)
(pass-if f64vector-fill-s '#f64(13.3 13.3 13.3 13.3) equal?)
(f64vector-fill! f64vector-fill-s 1.0)
(pass-if f64vector-fill-s '#f64(1.0 1.0 1.0 1.0) equal?)
(f64vector-fill! f64vector-fill-a 23.3)
(pass-if f64vector-fill-a '#f64() equal?)

(begin-section "uniform vector/string conversion")

(begin-sub-section "s8vector->string")
(pass-if (s8vector->string '#s8()) "" string=?)
(pass-if (s8vector->string '#s8(33 34 35)) "!\"#" string=?)

(begin-sub-section "u8vector->string")
(pass-if (u8vector->string '#u8()) "" string=?)
(pass-if (u8vector->string '#u8(33 34 35)) "!\"#" string=?)

(begin-sub-section "string->s8vector")
(pass-if (string->s8vector "") #s8() equal?)
(pass-if (string->s8vector "foobar") #s8(102 111 111 98 97 114) equal?)

(begin-sub-section "string->u8vector")
(pass-if (string->u8vector "") #u8() equal?)
(pass-if (string->u8vector "foobar") #u8(102 111 111 98 97 114) equal?)

(test-summary)

