2 * Unit test suite for file functions
4 * Copyright 2002 Bill Currie
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "wine/test.h"
28 static void test_fdopen( void )
30 static char buffer[] = {0,1,2,3,4,5,6,7,8,9};
34 fd = open ("fdopen.tst", O_WRONLY | O_CREAT | O_BINARY);
35 write (fd, buffer, sizeof (buffer));
38 fd = open ("fdopen.tst", O_RDONLY | O_BINARY);
39 lseek (fd, 5, SEEK_SET);
40 file = fdopen (fd, "rb");
41 ok (fread (buffer, 1, sizeof (buffer), file) == 5, "read wrong byte count");
42 ok (memcmp (buffer, buffer + 5, 5) == 0, "read wrong bytes");
44 unlink ("fdopen.tst");