home *** CD-ROM | disk | FTP | other *** search
- (* This is a test program for the TSUNTH.TPU unit 25-Feb-89
- Updated 21-Mar-90, 23-Jul-90, 1-Aug-90, 5-Jan-91, 21-Jul-91 *)
-
- uses Dos, TSUNTH;
-
- procedure LOGO;
- begin
- writeln;
- writeln ('TSUNTH unit test by Prof. Timo Salmi, 21-Jul-91');
- writeln ('University of Vaasa, Finland, ts@chyde.uwasa.fi');
- writeln;
- end; (* logo *)
-
- (* Testing if graftabl is loaded *)
- procedure TEST1;
- begin
- if GRTABLFN then
- writeln ('GRAFTABL has been loaded')
- else
- writeln ('GRAFTABL has not been loaded');
- end; (* test1 *)
-
- (* Testing if c:\util is a directory *)
- procedure TEST2;
- var name : string;
- begin
- name := 'c:\util';
- writeln (name, ' is directory: ', ISDIRFN (name));
- Flush (output);
- end; (* test2 *)
-
- (* Testing copy *)
- procedure TEST3;
- var file1, file2 : string;
- status : byte;
- begin
- file1 := 'c:\command.com';
- file2 := 'f:\command.com';
- COPYFILE (file1, file2, status);
- if status = 0 then
- writeln (file1, ' copied to ', file2)
- else
- begin
- writeln ('Error in copying ', file1, ' to ', file2);
- writeln ('Status = ', status);
- end;
- end; (* test3 *)
-
- (* Is a math coprocessor present *)
- procedure TEST4;
- begin
- if MATHCOFN then
- writeln ('A math coprocessor is present')
- else
- writeln ('No math coprocessor present');
- end; (* test4 *)
-
- (* Number of serial ports *)
- procedure TEST5;
- begin
- writeln ('Number of serial ports ', RS232FN);
- Flush (output);
- end; (* test5 *)
-
- (* Number of parallel ports *)
- procedure TEST6;
- begin
- writeln ('Number of parallel ports ', PARPORFN);
- Flush (output);
- end; (* test6 *)
-
- (* Country code *)
- procedure TEST7;
- begin
- writeln ('The country code is ', COUNTRFN);
- Flush (output);
- end; (* test7 *)
-
- (* Processor chip type *)
- procedure TEST8;
- begin
- writeln ('The processor chip is ', CHIPFN);
- Flush (output);
- end; (* test8 *)
-
- (* Get ROM BIOS version *)
- procedure TEST9;
- begin
- writeln ('The ROM BIOS version (date) is ', ROMDTEFN);
- Flush (output);
- end; (* test9 *)
-
- (* Is an enhanced keyboard present *)
- procedure TEST10;
- begin
- if ISENHAFN then
- writeln ('Enhanced keyboard')
- else
- writeln ('Not an enhanced keyboard');
- end; (* test10 *)
-
- (* Last drive, and interleave values *)
- procedure TEST11;
- var lastdrive : char;
- interleave : byte;
- ch : char;
- begin
- lastdrive := LASTDRFN;
- writeln ('The last drive on this system is ', lastdrive);
- if lastdrive > 'B' then
- for ch := 'C' to lastdrive do
- writeln ('Drive ', ch, ' interleave is ', INTERLFN (ch));
- writeln;
- for ch := 'A' to lastdrive do
- writeln ('Drive ', ch, ' number of FATs is ', FATSFN (ch));
- end; (* test11 *)
-
- (* Test where the standard input comes from, and where does the standard
- output go to *)
- procedure TEST12;
- var s : string;
- con : text;
- begin
- { We must have a way to write messages to the screen irrespective of
- where the standard output is directed. }
- assign (con, 'con');
- rewrite (con);
- {}
- if PIPEDIFN then
- writeln (con, 'Input from redirection')
- else writeln (con, 'Input not from redirection');
- {}
- if PIPEDOFN then
- writeln (con, 'Output redirected')
- else writeln (con, 'Output not redirected');
- {}
- if PIPEDNFN then
- writeln (con, 'Output redirected to nul')
- else writeln (con, 'Output not redirected to nul');
- {}
- close (con);
- end; (* test12 *)
-
- (* Show date and time formats of your configuration *)
- procedure TEST13;
- begin
- writeln ('The country-dependent date format is ', DATEFMFN);
- writeln ('The country-dependent time format is ', TIMEFMFN);
- end; (* test13 *)
-
- procedure TEST14;
- const drive = 'A';
- begin
- writeln ('Number of cylinders on ', drive, ', is ', NRCYLFN(drive));
- end; (* test14 *)
-
- procedure TEST15;
- begin
- writeln ('The boot drive was ', BOOTDRFN);
- end; (* test15 *)
-
- (* Main program *)
- begin
- LOGO;
- TEST4;
- TEST5;
- TEST6;
- TEST7;
- TEST8;
- TEST9;
- TEST10;
- {}
- {... if you want the rest of the tests, just include them ...}
- {}
- write ('Press <═╝'); readln;
- end. (* tsunth.tst *)