~vdupras/duskos

ref: 18d3f30bc4df7070cbd1aa68cce850255a11fb40 duskos/fs/tests/fs/boot.fs -rw-r--r-- 709 bytes
18d3f30bVirgil Dupras fs/boot: implement fat16close 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\ These tests rest on a few assumptions.
\ 1. The boot fs is a FAT16
\ 2. current drive has it at its 0th block
\ 3. It has only one FAT (no backup FAT)
\ 4. It has a 512 sector size
?f<< tests/harness.fs
?f<< fs/boot.fs
: readN ( fcursor n -- ) >r begin dup fat16getc drop next drop ;
testbegin
\ Tests for fs/boot
readFAT
readroot
S" tests" findindir readdir
S" fattest" findindir ( dirent )
openfile ( fcursor ) dup fat16getc 'T' #eq
dup $ff readN ( fcursor )
dup fat16getc 'f' #eq dup fat16getc 'o' #eq dup fat16getc 'o' #eq
dup $fd readN ( fcursor )
dup fat16getc 'b' #eq
dup $dfc readN ( fcursor )
dup fat16getc 'E' #eq dup fat16getc 'O' #eq dup fat16getc 'F' #eq
dup fat16getc 0 #eq
fat16close
testend