mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[WINESYNC] reg/tests: Test whether overwriting a registry key modifies existing keys and values.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 89251073c7b7a919ca7c3450d53744921ac2979c by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
26226dc572
commit
6d2c3a08bb
2 changed files with 19 additions and 2 deletions
|
@ -210,7 +210,7 @@ void delete_value_(const char *file, unsigned line, const HKEY hkey, const char
|
|||
|
||||
static void test_add(void)
|
||||
{
|
||||
HKEY hkey;
|
||||
HKEY hkey, hsubkey;
|
||||
LONG err;
|
||||
DWORD r, dword, type, size;
|
||||
char buffer[22];
|
||||
|
@ -606,6 +606,7 @@ static void test_add(void)
|
|||
verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
|
||||
|
||||
close_key(hkey);
|
||||
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
|
||||
|
||||
/* Test duplicate switches */
|
||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v Wine /t REG_DWORD /d 0x1 /v Test /f", &r);
|
||||
|
@ -642,6 +643,22 @@ static void test_add(void)
|
|||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v invalid4 -", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r);
|
||||
|
||||
/* Test whether overwriting a registry key modifies existing keys and values */
|
||||
add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey);
|
||||
add_key(hkey, "Subkey", &hsubkey);
|
||||
close_key(hsubkey);
|
||||
add_value(hkey, "Test1", REG_SZ, "Value1", 7);
|
||||
dword = 0x123;
|
||||
add_value(hkey, "Test2", REG_DWORD, &dword, sizeof(dword));
|
||||
|
||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /f", &r);
|
||||
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
|
||||
|
||||
verify_key(HKEY_CURRENT_USER, KEY_BASE);
|
||||
verify_key(hkey, "Subkey");
|
||||
verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0);
|
||||
verify_reg(hkey, "Test2", REG_DWORD, &dword, sizeof(dword), 0);
|
||||
|
||||
delete_tree(HKEY_CURRENT_USER, KEY_BASE);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,4 +4,4 @@ directories:
|
|||
files:
|
||||
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
||||
tags:
|
||||
wine: a87a380a75723e0aa0e257c7efcc3024b56fb49d
|
||||
wine: 89251073c7b7a919ca7c3450d53744921ac2979c
|
||||
|
|
Loading…
Reference in a new issue