Unit testing

Jakob Eriksson jakob at vmlinux.org
Wed Apr 24 14:02:13 CDT 2002

#include "winbase.h"
#include "winerror.h"
#include "wine/test.h"

static void test__hread(void)
	LPCSTR lpPathName = "testfile.txt";
	HFILE filehandle;
	filehandle = _lcreat(lpPathName, 0);

	ok(filehandle != HFILE_ERROR, "_lcreat failed.");

	/*    _hwrite();*/
	ok(DeleteFileA(lpPathName) != 0, "DeleteFile failed.");


this is my, of course very incomplete test for _hread().

But it doesn't even compile and I don't understand why.
I get this error:
../../programs/winetest/runtest -q -P wine -M kernel32.dll -T ../.. tests/atom.pl && touch tests/atom.ok
Could not stat /mnt/fd0 (No such file or directory), ignoring drive A:
gcc -c -I. -I. -I../../include -I../../include  -g -O2 -Wall -mpreferred-stack-boundary=2 -fPIC -D__WINE__  -D_REEN
TRANT -I/usr/X11R6/include -o tests/file.o tests/file.c
ld -r ../../programs/winetest/wtmain.o tests/testlist.o tests/alloc.o tests/directory.o tests/path.o tests/process.
o tests/thread.o tests/file.o -o tests/kernel32_test.tmp.o
tests/file.o: In function `func_alloc':
/home/jakov/src/WINE/wine/dlls/kernel/tests/file.c(.text+0x7c): multiple definition of `func_alloc'
tests/alloc.o(.text+0xe80):/home/jakov/src/WINE/wine/dlls/kernel/tests/alloc.c: first defined here
ld: Warning: size of symbol `func_alloc' changed from 39 to 24 in tests/file.o
make: *** [tests/kernel32_test.tmp.o] Error 1

What's func_alloc got to do with anything? What is it?

Jakob Eriksson

The wages of sin
  is debugging.
		  	-- Ron Jeffries

More information about the wine-devel mailing list