All it does is write a string loads of times to a file to make 50MB worth of data. Then reads the file back in line by line (about 500bytes per line string) and compares the string in the file to the string in RAM.. then repeats for the whole file.
So if the file is corrupted at any point, the program would report a failure.
I think part of the slowness is a string comparison rather than binary stuff.
Code: Select all
ID=freewind
WINDOW OPEN ID,"" ,20,20,300,150,1
print "CRAPPY HARD DRIVE TESTER V2.01"
'create string
DIM A$,B$,A,C$,P,C,SZ,MB
A$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-*!"
B$=""
FOR A=1 TO 13
B$=B$+A$
NEXT A
SZ=100000 ' 50MB
PRINT ""
PRINT " SAVING "+STR$(SZ) +" SECTORS "
PRINT ""
OPEN "BLAH.TXT" for OUTPUT AS #3
FOR A=1 TO SZ
C=C+1
print #3,B$
IF C>5000 THEN PRINT "."; : C=0
NEXT A
close #3
PRINT ""
PRINT " READING & CHECKING SECTOR"
OPEN "BLAH.TXT" FOR INPUT AS #4
F=0
C=0
PRINT ""
FOR A=1 TO SZ
LINE INPUT #4,C$
IF C>5000 THEN PRINT "."; : C=0
IF C$ = B$ THEN
F=F+1
ELSE
PRINT "FAILED":END
END IF
C=C+1
NEXT A
PRINT ""
CLOSE #4
IF F=SZ THEN
PRINT " TESTED OK"
ELSE
PRINT " FAILED" :END
END IF
PRINT ""
END