wine-staging/patches/advapi32-RegCopyTree/0001-advapi32-tests-Improve-RegDeleteTree-tests.patch
2016-02-15 09:22:18 +01:00

56 lines
2.3 KiB
Diff

From 33d8e5aac7dfedd9230ef340eeef57398282147c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 15 Feb 2016 03:38:48 +0100
Subject: advapi32/tests: Improve RegDeleteTree tests.
---
dlls/advapi32/tests/registry.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index ef5d989..183e538 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -41,7 +41,7 @@ static const char * sTestpath2 = "%FOO%\\subdir1";
static const DWORD ptr_size = 8 * sizeof(void*);
static DWORD (WINAPI *pRegGetValueA)(HKEY,LPCSTR,LPCSTR,DWORD,LPDWORD,PVOID,LPDWORD);
-static DWORD (WINAPI *pRegDeleteTreeA)(HKEY,LPCSTR);
+static LONG (WINAPI *pRegDeleteTreeA)(HKEY,const char *);
static DWORD (WINAPI *pRegDeleteKeyExA)(HKEY,LPCSTR,REGSAM,DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE);
@@ -2083,6 +2083,7 @@ static void test_reg_delete_tree(void)
{
CHAR buffer[MAX_PATH];
HKEY subkey, subkey2;
+ DWORD dwsize, type;
LONG size, ret;
if(!pRegDeleteTreeA) {
@@ -2128,7 +2129,9 @@ static void test_reg_delete_tree(void)
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = RegCloseKey(subkey2);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
- ret = RegSetValueA(subkey, "value", REG_SZ, "data2", 5);
+ ret = RegSetValueA(subkey, NULL, REG_SZ, "data", 4);
+ ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
+ ret = RegSetValueExA(subkey, "value", 0, REG_SZ, (const BYTE *)"data2", 5);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
ret = pRegDeleteTreeA(subkey, NULL);
ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret);
@@ -2143,8 +2146,8 @@ static void test_reg_delete_tree(void)
ok(ret == ERROR_SUCCESS,
"Default value of subkey is not present\n");
ok(!buffer[0], "Expected length 0 got length %u(%s)\n", lstrlenA(buffer), buffer);
- size = MAX_PATH;
- ok(RegQueryValueA(subkey, "value", buffer, &size),
+ dwsize = MAX_PATH;
+ ok(RegQueryValueExA(subkey, "value", NULL, &type, (BYTE *)buffer, &dwsize),
"Value is still present\n");
ret = pRegDeleteTreeA(hkey_main, "not-here");
--
2.7.1