2 * Unit test suite for string functions.
4 * Copyright 2004 Uwe Bonnes
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
21 #include "wine/test.h"
26 static void* (*pmemcpy)(void *, const void *, size_t n);
27 static int* (*pmemcmp)(void *, const void *, size_t n);
29 #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
30 #define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
36 static const char xilstring[]="c:/xilinx";
37 int nLen=strlen(xilstring);
38 HMODULE hMsvcrt = LoadLibraryA("msvcrt.dll");
39 ok(hMsvcrt != 0, "LoadLibraryA failed\n");
40 SET(pmemcpy,"memcpy");
41 SET(pmemcmp,"memcmp");
43 /* MSVCRT memcpy behaves like memmove for overlapping moves,
44 MFC42 CString::Insert seems to rely on that behaviour */
46 ok(mem != NULL, "memory not allocated for size 0\n");
47 strcpy((char*)mem,xilstring);
48 pmemcpy((char*)mem+5, mem,nLen+1);
49 ok(pmemcmp((char*)mem+5,xilstring, nLen) == 0,
50 "Got result %s\n",(char*)mem+5);