2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 buf
= "Hello World!\n";
28 if (file
.fopen
("/tmp/x", "w+")) {
29 pass
("FileIO::open()");
31 fail
("FileIO::open()");
34 if (file
.fputs
(buf
)) {
35 pass
("FileIO::fputs()");
37 fail
("FileIO::fputs()");
43 if (file
.fseek
(0) == 0) {
44 pass
("FileIO::fseek()");
46 fail
("FileIO::fseek()");
49 if (file
.fflush
() == 0) {
50 pass
("FileIO::fflush()");
52 fail
("FileIO::fflush()");
55 if ((xxx
> 0) && (file
.ftell
() == 0)) {
56 pass
("FileIO::ftell()");
58 fail
("FileIO::ftell()");
63 pass
("FileIO::fgetc()");
65 fail
("FileIO::fgetc()");
70 if (y
== "ello World!\n") {
71 pass
("FileIO::fgets()");
73 fail
("FileIO::fgets()");
79 //file.read(buf, count);
81 // These tests use standard I/O
82 if (file
.putchar
('X')) {
83 pass
("FileIO::putchar()");
85 fail
("FileIO::putchar()");
89 pass
("FileIO::puts()");
91 fail
("FileIO::puts()");
95 // We can't test thigns automatically if we need user input, so thes
98 // a = file.getchar();
100 // pass("FileIO::getchar()");
102 // fail("FileIO::getchar()");
108 // pass("FileIO::gets()");
110 // fail("FileIO::gets()");