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";
27 fname
= "/tmp/gnash_fileio_ext_test";
29 if (file
.fopen
(fname
, "w+")) {
30 pass
("FileIO::open()");
32 fail
("FileIO::open()");
35 if (file
.fputs
(buf
)) {
36 pass
("FileIO::fputs()");
38 fail
("FileIO::fputs()");
44 if (file
.fseek
(0) == 0) {
45 pass
("FileIO::fseek()");
47 fail
("FileIO::fseek()");
50 if (file
.fflush
() == 0) {
51 pass
("FileIO::fflush()");
53 fail
("FileIO::fflush()");
56 if ((xxx
> 0) && (file
.ftell
() == 0)) {
57 pass
("FileIO::ftell()");
59 fail
("FileIO::ftell()");
64 pass
("FileIO::fgetc()");
66 fail
("FileIO::fgetc()");
71 if (y
== "ello World!\n") {
72 pass
("FileIO::fgets()");
74 fail
("FileIO::fgets()");
80 //file.read(buf, count);
82 // These tests use standard I/O
83 if (file
.putchar
('X')) {
84 pass
("FileIO::putchar()");
86 fail
("FileIO::putchar()");
90 pass
("FileIO::puts()");
92 fail
("FileIO::puts()");
96 // We can't test thigns automatically if we need user input, so thes
99 // a = file.getchar();
101 // pass("FileIO::getchar()");
103 // fail("FileIO::getchar()");
109 // pass("FileIO::gets()");
111 // fail("FileIO::gets()");
115 var ret
= file
.unlink
(fname
);
116 if ( true === ret
) {
117 pass
("FileIO::unlink()");
119 fail
("FileIO::unlink(" + fname
+ ") returned " + ret
);