Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f0686919
Commit
f0686919
authored
Jun 16, 2021
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg/tests: Modify delete_key() to support use of RegDeleteKeyEx().
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
612c1b66
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
58 deletions
+65
-58
add.c
programs/reg/tests/add.c
+21
-14
copy.c
programs/reg/tests/copy.c
+16
-16
export.c
programs/reg/tests/export.c
+7
-7
import.c
programs/reg/tests/import.c
+19
-19
reg_test.h
programs/reg/tests/reg_test.h
+2
-2
No files found.
programs/reg/tests/add.c
View file @
f0686919
...
...
@@ -138,15 +138,22 @@ void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path
RegCloseKey
(
new_key
);
}
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
)
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
)
{
if
(
path
&&
*
path
)
{
LONG
err
;
LONG
err
;
err
=
RegDeleteKeyA
(
hkey
,
path
);
if
(
!
path
)
return
;
if
(
!
sam
)
{
err
=
RegDeleteKeyA
(
root
,
path
);
lok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKeyA failed: got error %d
\n
"
,
err
);
}
else
{
err
=
RegDeleteKeyExA
(
root
,
path
,
sam
,
0
);
lok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKeyExA failed: got error %d
\n
"
,
err
);
}
}
LONG
delete_tree
(
const
HKEY
key
,
const
char
*
subkey
)
...
...
@@ -345,7 +352,7 @@ static void test_add(void)
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
""
,
1
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Specifying a value name doesn't initialize the Default value in a new key */
run_reg_exe
(
"reg add HKCU
\\
"
KEY_BASE
" /v Test /t REG_SZ /d
\"
Just me here
\"
/f"
,
&
r
);
...
...
@@ -357,7 +364,7 @@ static void test_add(void)
verify_reg_nonexist
(
hkey
,
NULL
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Adding a registry key via WinAPI doesn't initialize the Default value... */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
...
...
@@ -423,7 +430,7 @@ static void test_reg_none(void)
verify_reg
(
hkey
,
"none1"
,
REG_NONE
,
"
\0
"
,
2
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_reg_sz
(
void
)
...
...
@@ -501,7 +508,7 @@ static void test_reg_sz(void)
verify_reg
(
hkey
,
"
\\
foo
\\
bar"
,
REG_SZ
,
""
,
1
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_reg_expand_sz
(
void
)
...
...
@@ -542,7 +549,7 @@ static void test_reg_expand_sz(void)
verify_reg
(
hkey
,
"expand3"
,
REG_EXPAND_SZ
,
""
,
1
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_reg_binary
(
void
)
...
...
@@ -606,7 +613,7 @@ static void test_reg_binary(void)
ok
(
r
==
REG_EXIT_FAILURE
,
"got exit code %d, expected 1
\n
"
,
r
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_reg_dword
(
void
)
...
...
@@ -709,7 +716,7 @@ static void test_reg_dword(void)
verify_reg
(
hkey
,
"DWORD_LE"
,
REG_DWORD_LITTLE_ENDIAN
,
&
dword
,
sizeof
(
dword
),
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
/* REG_DWORD_BIG_ENDIAN is broken in every version of Windows. It behaves
...
...
@@ -742,7 +749,7 @@ static void test_reg_dword_big_endian(void)
verify_reg
(
hkey
,
"Test4"
,
REG_DWORD_BIG_ENDIAN
,
&
dword
,
sizeof
(
dword
),
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_reg_multi_sz
(
void
)
...
...
@@ -841,7 +848,7 @@ static void test_reg_multi_sz(void)
verify_reg
(
hkey
,
"multi21"
,
REG_MULTI_SZ
,
"two
\\
0
\\
0strings
\0
"
,
16
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
START_TEST
(
add
)
...
...
programs/reg/tests/copy.c
View file @
f0686919
...
...
@@ -143,7 +143,7 @@ static void test_copy_empty_key(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_key_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
...
...
@@ -154,7 +154,7 @@ static void test_copy_empty_key(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_key_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
...
...
@@ -165,7 +165,7 @@ static void test_copy_empty_key(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_key_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
...
...
@@ -213,7 +213,7 @@ static void test_copy_simple_data(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
simple_data_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
" /f"
,
&
r
);
...
...
@@ -224,7 +224,7 @@ static void test_copy_simple_data(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
simple_data_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
" HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
...
...
@@ -235,7 +235,7 @@ static void test_copy_simple_data(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
simple_data_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
run_reg_exe
(
"reg copy HKCU
\\
"
COPY_SRC
"
\\
HKCU
\\
"
KEY_BASE
"
\\
/f"
,
&
r
);
...
...
@@ -406,8 +406,8 @@ static void test_copy_hex_data(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Try copying after importing alternative registry data types */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -425,8 +425,8 @@ static void test_copy_hex_data(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test2
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Try copying more complex hex data */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -531,8 +531,8 @@ static void test_copy_escaped_null_values(void)
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
escaped_null_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_copy_key_class
(
void
)
...
...
@@ -573,8 +573,8 @@ static void test_copy_key_class(void)
RegCloseKey
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_copy_overwrite
(
void
)
...
...
@@ -611,8 +611,8 @@ static void test_copy_overwrite(void)
verify_reg
(
hkey
,
NULL
,
REG_SZ
,
"Constant value"
,
15
,
0
);
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
COPY_SRC
,
0
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
START_TEST
(
copy
)
...
...
programs/reg/tests/export.c
View file @
f0686919
...
...
@@ -297,8 +297,8 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
key_order_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
hkey
,
"Subkey1"
);
delete_key
(
hkey
,
"Subkey2"
);
delete_key
(
hkey
,
"Subkey1"
,
0
);
delete_key
(
hkey
,
"Subkey2"
,
0
);
/* Test the export order of registry values. Windows exports registry values
* in order of creation; Wine uses alphabetical order.
...
...
@@ -310,7 +310,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
value_order_test
,
TODO_REG_COMPARE
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Test registry export with empty hex data */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
...
...
@@ -327,7 +327,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Test registry export after importing alternative registry data types */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -345,7 +345,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
empty_hex_test2
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -364,7 +364,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
hex_types_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Test registry export with embedded null characters */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -401,7 +401,7 @@ static void test_export(void)
run_reg_exe
(
"reg export HKEY_CURRENT_USER
\\
"
KEY_BASE
" file.reg /y"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
ok
(
compare_export
(
"file.reg"
,
embedded_null_test
,
0
),
"compare_export() failed
\n
"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
/* Test registry export with forward and back slashes */
add_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
&
hkey
);
...
...
programs/reg/tests/import.c
View file @
f0686919
...
...
@@ -860,7 +860,7 @@ static void test_import(void)
open_key
(
hkey
,
"Subkey
\"
1"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine
\\
31"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey/2]
\n
"
...
...
@@ -869,7 +869,7 @@ static void test_import(void)
open_key
(
hkey
,
"Subkey/2"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"123/
\"
4;'5"
,
REG_SZ
,
"Random value name"
,
18
,
0
);
close_key
(
subkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
,
0
);
/* Test key creation */
test_import_str
(
"REGEDIT4
\n\n
"
...
...
@@ -896,13 +896,13 @@ static void test_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1c "
);
delete_key
(
hkey
,
"Subkey1c "
);
delete_key
(
hkey
,
"Subkey1c "
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1d
\t
]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1d
\t
"
);
delete_key
(
hkey
,
"Subkey1d
\t
"
);
delete_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1e
\\
]
\n
"
...
...
@@ -913,7 +913,7 @@ static void test_import(void)
open_key
(
hkey
,
"Subkey1e"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1e"
);
delete_key
(
hkey
,
"Subkey1e"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1f
\\\\
]
\n
"
...
...
@@ -925,7 +925,7 @@ static void test_import(void)
open_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1f
\\\\
"
);
delete_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1g
\\\\\\\\
]
\n
"
...
...
@@ -938,7 +938,7 @@ static void test_import(void)
open_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1g
\\\\
"
);
delete_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
);
/* Test key deletion. We start by creating some registry keys. */
test_import_str
(
"REGEDIT4
\n\n
"
...
...
@@ -1183,7 +1183,7 @@ static void test_import(void)
verify_reg_nonexist
(
hkey
,
"Wine54b"
);
verify_key
(
hkey
,
"Subkey2"
);
delete_key
(
hkey
,
"Subkey2"
);
delete_key
(
hkey
,
"Subkey2"
,
0
);
test_import_str
(
"REGEDIT4
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -2399,7 +2399,7 @@ static void test_unicode_import(void)
open_key
(
hkey
,
"Subkey
\"
1"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine
\\
31"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey
\"
1"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey/2]
\n
"
...
...
@@ -2408,7 +2408,7 @@ static void test_unicode_import(void)
open_key
(
hkey
,
"Subkey/2"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"123/
\"
4;'5"
,
REG_SZ
,
"Random value name"
,
18
,
0
);
close_key
(
subkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
"
\\
Subkey/2"
,
0
);
/* Test key creation */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -2435,13 +2435,13 @@ static void test_unicode_import(void)
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1c ]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1c "
);
delete_key
(
hkey
,
"Subkey1c "
);
delete_key
(
hkey
,
"Subkey1c "
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1d
\t
]
\n
"
,
&
r
);
ok
(
r
==
REG_EXIT_SUCCESS
,
"got exit code %d, expected 0
\n
"
,
r
);
verify_key
(
hkey
,
"Subkey1d
\t
"
);
delete_key
(
hkey
,
"Subkey1d
\t
"
);
delete_key
(
hkey
,
"Subkey1d
\t
"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1e
\\
]
\n
"
...
...
@@ -2452,7 +2452,7 @@ static void test_unicode_import(void)
open_key
(
hkey
,
"Subkey1e"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1e"
);
delete_key
(
hkey
,
"Subkey1e"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1f
\\\\
]
\n
"
...
...
@@ -2464,7 +2464,7 @@ static void test_unicode_import(void)
open_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1f
\\\\
"
);
delete_key
(
hkey
,
"Subkey1f
\\\\
"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"
\\
Subkey1g
\\\\\\\\
]
\n
"
...
...
@@ -2477,7 +2477,7 @@ static void test_unicode_import(void)
open_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
,
&
subkey
);
verify_reg
(
subkey
,
"Wine"
,
REG_SZ
,
"Test value"
,
11
,
0
);
close_key
(
subkey
);
delete_key
(
hkey
,
"Subkey1g
\\\\
"
);
delete_key
(
hkey
,
"Subkey1g
\\\\
"
,
0
);
/* Test key deletion. We start by creating some registry keys. */
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
...
...
@@ -2725,7 +2725,7 @@ static void test_unicode_import(void)
verify_reg_nonexist
(
hkey
,
"Wine54b"
);
verify_key
(
hkey
,
"Subkey2"
);
delete_key
(
hkey
,
"Subkey2"
);
delete_key
(
hkey
,
"Subkey2"
,
0
);
test_import_wstr
(
"
\xef\xbb\xbf
Windows Registry Editor Version 5.00
\n\n
"
"[HKEY_CURRENT_USER
\\
"
KEY_BASE
"]
\n
"
...
...
@@ -3315,7 +3315,7 @@ static void test_import_with_whitespace(void)
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_unicode_import_with_whitespace
(
void
)
...
...
@@ -3461,7 +3461,7 @@ static void test_unicode_import_with_whitespace(void)
close_key
(
hkey
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
);
delete_key
(
HKEY_CURRENT_USER
,
KEY_BASE
,
0
);
}
static
void
test_import_win31
(
void
)
...
...
@@ -3585,7 +3585,7 @@ static void test_import_win31(void)
close_key
(
hkey
);
delete_key
(
HKEY_CLASSES_ROOT
,
KEY_BASE
);
delete_key
(
HKEY_CLASSES_ROOT
,
KEY_BASE
,
0
);
}
START_TEST
(
import
)
...
...
programs/reg/tests/reg_test.h
View file @
f0686919
...
...
@@ -62,8 +62,8 @@ void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const
#define add_key(k,p,s) add_key_(__FILE__,__LINE__,k,p,s)
void
add_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
,
HKEY
*
subkey
);
#define delete_key(
k,p) delete_key_(__FILE__,__LINE__,k,p
)
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
const
HKEY
hkey
,
const
char
*
path
);
#define delete_key(
r,p,s) delete_key_(__FILE__,__LINE__,r,p,s
)
void
delete_key_
(
const
char
*
file
,
unsigned
line
,
HKEY
root
,
const
char
*
path
,
REGSAM
sam
);
LONG
delete_tree
(
const
HKEY
key
,
const
char
*
subkey
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment