Ilya Basin : shell32/tests: CommandLineToArgvW("") shouldn' t truncate returned exe path.
Alexandre Julliard
julliard at winehq.org
Mon Jul 26 13:22:40 CDT 2010
Module: wine
Branch: master
Commit: 3b545300b85ca23c53dfb56478182b29e37c9beb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3b545300b85ca23c53dfb56478182b29e37c9beb
Author: Ilya Basin <basinilya at gmail.com>
Date: Sat Jul 24 20:42:15 2010 +0400
shell32/tests: CommandLineToArgvW("") shouldn't truncate returned exe path.
---
dlls/shell32/tests/shlexec.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index b883d0b..47f640f 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -2118,8 +2118,9 @@ static void test_commandline(void)
static const WCHAR chkfmt3[] = {'\\','\"','%','s','\"',0};
static const WCHAR chkfmt4[] = {'%','s','=','%','s','\"',' ','%','s','\"',0};
WCHAR cmdline[255];
- LPWSTR *args = (LPWSTR*)0xdeadcafe;
+ LPWSTR *args = (LPWSTR*)0xdeadcafe, pbuf;
INT numargs = -1;
+ size_t buflen;
wsprintfW(cmdline,fmt1,one,two,three,four);
args=CommandLineToArgvW(cmdline,&numargs);
@@ -2170,6 +2171,15 @@ static void test_commandline(void)
wsprintfW(cmdline,fmt6);
args=CommandLineToArgvW(cmdline,&numargs);
ok(numargs == 1, "expected 1 args, got %i\n",numargs);
+ if (numargs == 1) {
+ buflen = max(lstrlenW(args[0])+1,256);
+ pbuf = HeapAlloc(GetProcessHeap(), 0, buflen*sizeof(pbuf[0]));
+ GetModuleFileNameW(NULL, pbuf, buflen);
+ pbuf[buflen-1] = 0;
+ /* check args[0] is module file name */
+ ok(lstrcmpW(args[0],pbuf)==0, "wrong path to the current executable\n");
+ HeapFree(GetProcessHeap(), 0, pbuf);
+ }
}
START_TEST(shlexec)
More information about the wine-cvs
mailing list