reg/tests: Add more tests for all supported data types.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8d4ac88a6b
commit
9af841ea39
|
@ -149,6 +149,10 @@ static void test_add(void)
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
verify_reg(hkey, "none1", REG_NONE, "\0", 2, TODO_REG_SIZE);
|
verify_reg(hkey, "none1", REG_NONE, "\0", 2, TODO_REG_SIZE);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_NONE /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
todo_wine verify_reg(hkey, NULL, REG_NONE, "\0", 2, TODO_REG_SIZE|TODO_REG_TYPE|TODO_REG_DATA);
|
||||||
|
|
||||||
/* REG_SZ */
|
/* REG_SZ */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /d WineTest /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /d WineTest /f", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
|
ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
|
||||||
|
@ -181,6 +185,14 @@ static void test_add(void)
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
|
||||||
verify_reg(hkey, "test3", REG_SZ, "", 1, 0);
|
verify_reg(hkey, "test3", REG_SZ, "", 1, 0);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
verify_reg(hkey, NULL, REG_SZ, "", 1, TODO_REG_SIZE|TODO_REG_DATA);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_SZ /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
verify_reg(hkey, NULL, REG_SZ, "", 1, TODO_REG_SIZE|TODO_REG_DATA);
|
||||||
|
|
||||||
/* REG_EXPAND_SZ */
|
/* REG_EXPAND_SZ */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand0 /t REG_EXpand_sz /d \"dead%PATH%beef\" /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand0 /t REG_EXpand_sz /d \"dead%PATH%beef\" /f", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
||||||
|
@ -202,6 +214,10 @@ static void test_add(void)
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
||||||
verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0);
|
verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_EXPAND_SZ /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
verify_reg(hkey, NULL, REG_EXPAND_SZ, "", 1, TODO_REG_SIZE|TODO_REG_DATA);
|
||||||
|
|
||||||
/* REG_BINARY */
|
/* REG_BINARY */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0 /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0 /f", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
|
||||||
|
@ -242,6 +258,10 @@ static void test_add(void)
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v bin6 /t REG_BINARY /f /d", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v bin6 /t REG_BINARY /f /d", &r);
|
||||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_BINARY /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
verify_reg(hkey, NULL, REG_BINARY, buffer, 0, TODO_REG_DATA|TODO_REG_SIZE);
|
||||||
|
|
||||||
/* REG_DWORD */
|
/* REG_DWORD */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /f /d 12345678", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /f /d 12345678", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
|
ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
|
||||||
|
@ -310,6 +330,10 @@ static void test_add(void)
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword15 /t REG_DWORD /d 4294967296 /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword15 /t REG_DWORD /d 4294967296 /f", &r);
|
||||||
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u\n", r);
|
ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u\n", r);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_DWORD /f", &r);
|
||||||
|
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
|
||||||
|
"got exit code %u\n", r);
|
||||||
|
|
||||||
/* REG_DWORD_LITTLE_ENDIAN */
|
/* REG_DWORD_LITTLE_ENDIAN */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_LE /t REG_DWORD_LITTLE_ENDIAN /d 456 /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_LE /t REG_DWORD_LITTLE_ENDIAN /d 456 /f", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
|
||||||
|
@ -324,6 +348,17 @@ static void test_add(void)
|
||||||
/* REG_DWORD_BIG_ENDIAN is broken in every version of windows. It behaves like
|
/* REG_DWORD_BIG_ENDIAN is broken in every version of windows. It behaves like
|
||||||
* an ordinary REG_DWORD - that is little endian. GG */
|
* an ordinary REG_DWORD - that is little endian. GG */
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_BE2 /t REG_DWORD_BIG_ENDIAN /f /d", &r);
|
||||||
|
ok(r == REG_EXIT_FAILURE, "got exit code %u, expected 1\n", r);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_BE3 /t REG_DWORD_BIG_ENDIAN /f", &r);
|
||||||
|
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
|
||||||
|
"got exit code %u\n", r);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_DWORD_BIG_ENDIAN /f", &r);
|
||||||
|
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
|
||||||
|
"got exit code %u\n", r);
|
||||||
|
|
||||||
/* REG_MULTI_SZ */
|
/* REG_MULTI_SZ */
|
||||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi0 /t REG_MULTI_SZ /d \"three\\0little\\0strings\" /f", &r);
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi0 /t REG_MULTI_SZ /d \"three\\0little\\0strings\" /f", &r);
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
@ -401,6 +436,10 @@ static void test_add(void)
|
||||||
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, 0);
|
verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, 0);
|
||||||
|
|
||||||
|
run_reg_exe("reg add HKCU\\" KEY_BASE " /ve /t REG_MULTI_SZ /f", &r);
|
||||||
|
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
|
||||||
|
verify_reg(hkey, NULL, REG_MULTI_SZ, buffer, 1, TODO_REG_SIZE|TODO_REG_DATA|TODO_REG_TYPE);
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
|
||||||
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
|
err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE);
|
||||||
|
|
Loading…
Reference in New Issue