Louis. Lenders : kernel32: Add 2 simple tests for GetLongPathNameW.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 2 15:00:41 CDT 2006
Module: wine
Branch: master
Commit: ed4b6e91cb7fa7ca316b0c9300670d3d4ffbf06e
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=ed4b6e91cb7fa7ca316b0c9300670d3d4ffbf06e
Author: Louis. Lenders <xerox_xerox2000 at yahoo.co.uk>
Date: Fri Sep 29 08:21:31 2006 +0100
kernel32: Add 2 simple tests for GetLongPathNameW.
---
dlls/kernel32/tests/path.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 12d3500..e348865 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -50,6 +50,7 @@ static const CHAR funny_chars[]="!@#$%^&
static const CHAR is_char_ok[] ="11111110111111111011";
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR,LPSTR,DWORD);
+static DWORD (WINAPI *pGetLongPathNameW)(LPWSTR,LPWSTR,DWORD);
/* a structure to deal with wine todos somewhat cleanly */
typedef struct {
@@ -929,14 +930,37 @@ static void test_GetTempPath(void)
SetEnvironmentVariableA("TMP", save_TMP);
}
+static void test_GetLongPathNameW(void)
+{
+ DWORD length;
+ WCHAR empty[MAX_PATH];
+
+ SetLastError(0xdeadbeef);
+ length = pGetLongPathNameW(NULL,NULL,0);
+ if(pGetLongPathNameW)
+ {
+ ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length);
+ ok(GetLastError()==ERROR_INVALID_PARAMETER,"GetLastError returned %lx but expected ERROR_INVALID_PARAMETER",GetLastError());
+
+ SetLastError(0xdeadbeef);
+ empty[0]=0;
+ length = pGetLongPathNameW(empty,NULL,0);
+ ok(0==length,"GetLongPathNameW returned %ld but expected 0\n",length);
+ ok(GetLastError()==ERROR_PATH_NOT_FOUND,"GetLastError returned %lx but expected ERROR_PATH_NOT_FOUND\n",GetLastError());
+ }
+}
+
START_TEST(path)
{
CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive;
pGetLongPathNameA = (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
"GetLongPathNameA" );
+ pGetLongPathNameW = (void*)GetProcAddress(GetModuleHandleA("kernel32.dll") ,
+ "GetLongPathNameW" );
test_InitPathA(curdir, &curDrive, &otherDrive);
test_CurrentDirectoryA(origdir,curdir);
test_PathNameA(curdir, curDrive, otherDrive);
test_CleanupPathA(origdir,curdir);
test_GetTempPath();
+ test_GetLongPathNameW();
}
More information about the wine-cvs
mailing list