Removed Gfx_ShowViewPorts method implementation, as it was identical to
[AROS.git] / test / dos / fread.c
blob212befd49c7d45ccdd3979fd1ad5116379ab04ae
1 #include <proto/dos.h>
2 #include <stdio.h>
3 #include "test.h"
6 BPTR fh = BNULL;
8 static void closehandles()
10 if (fh != BNULL) Close(fh);
11 fh = BNULL;
13 int main()
15 LONG result = 0;
16 LONG ioerr = 0;
17 TEXT buffer[16];
19 fh = Open("T:a", MODE_NEWFILE);
21 /* Invalid parameters */
22 SetIoErr(0);
23 result = FRead(fh, buffer, 0, 0);
24 ioerr = IoErr();
25 TEST((result == 0));
26 TEST((ioerr == 0));
28 /* EOF */
29 SetIoErr(0);
30 result = FRead(fh, buffer, 1, 1);
31 ioerr = IoErr();
32 TEST((result == 0));
33 TEST((ioerr == 0));
35 /* BNULL file handle */
36 SetIoErr(0);
37 result = FRead(BNULL, buffer, 1, 1);
38 ioerr = IoErr();
39 TEST((result == 0));
40 TEST((ioerr == 0));
42 cleanup();
44 return OK;
47 void cleanup()
49 closehandles();