~vdupras/duskos

ref: 2e0d6f71ebc7994b028ddd77772c007a68deed34 duskos/fs/tests/fs/boot.fs -rw-r--r-- 686 bytes
2e0d6f71Virgil Dupras fs/boot: add findpath 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
\ 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/fattest" findpath ( 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