advpack/tests: Fixed failure when "ProgramFilesDir" is != "C:\Program Files".

This commit is contained in:
Detlef Riekenberg 2006-01-23 17:29:41 +01:00 committed by Alexandre Julliard
parent 2ba20dd78b
commit c824e8bc5b
2 changed files with 16 additions and 4 deletions

View File

@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
TESTDLL = advpack.dll TESTDLL = advpack.dll
IMPORTS = cabinet user32 kernel32 IMPORTS = cabinet user32 advapi32 kernel32
CTESTS = \ CTESTS = \
advpack.c \ advpack.c \

View File

@ -25,7 +25,7 @@
#include <assert.h> #include <assert.h>
#include "wine/test.h" #include "wine/test.h"
#define TEST_STRING1 "C:\\Program Files\\Application Name" #define TEST_STRING1 "\\Application Name"
#define TEST_STRING2 "%49001%\\Application Name" #define TEST_STRING2 "%49001%\\Application Name"
static HRESULT (WINAPI *pGetVersionFromFile)(LPSTR,LPDWORD,LPDWORD,BOOL); static HRESULT (WINAPI *pGetVersionFromFile)(LPSTR,LPDWORD,LPDWORD,BOOL);
@ -224,8 +224,20 @@ static void translateinfstring_test()
if(hr == ERROR_SUCCESS) if(hr == ERROR_SUCCESS)
todo_wine todo_wine
{ {
ok(!strcmp(buffer, TEST_STRING1), "Expected %s, got %s\n", TEST_STRING1, buffer); HKEY key;
ok(dwSize == 34, "Expected size 34, got %ld\n", dwSize); DWORD len = MAX_PATH;
char cmpbuffer[MAX_PATH];
LONG res = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", &key);
if(res == ERROR_SUCCESS) {
res = RegQueryValueExA(key, "ProgramFilesDir", NULL, NULL, (LPBYTE)cmpbuffer, &len);
if(res == ERROR_SUCCESS) {
strcat(cmpbuffer, TEST_STRING1);
ok(!strcmp(buffer, cmpbuffer), "Expected '%s', got '%s'\n", cmpbuffer, buffer);
ok(dwSize == (strlen(cmpbuffer)+1), "Expected size %d, got %ld\n",
strlen(cmpbuffer)+1, dwSize);
}
RegCloseKey(key);
}
} }
buffer[0] = 0; buffer[0] = 0;