Author: akhaldi
Date: Sun Feb 28 23:04:29 2016
New Revision: 70806
URL:
http://svn.reactos.org/svn/reactos?rev=70806&view=rev
Log:
[REG_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
Modified:
trunk/rostests/winetests/reg/reg.c
Modified: trunk/rostests/winetests/reg/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/reg/reg.c?rev=7…
==============================================================================
--- trunk/rostests/winetests/reg/reg.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/reg/reg.c [iso-8859-1] Sun Feb 28 23:04:29 2016
@@ -72,17 +72,11 @@
if (err != ERROR_SUCCESS)
return;
- if (todo & TODO_REG_TYPE)
- todo_wine lok(type == exp_type, "got wrong type %d, expected %d\n",
type, exp_type);
- else
+ todo_wine_if (todo & TODO_REG_TYPE)
lok(type == exp_type, "got wrong type %d, expected %d\n", type,
exp_type);
- if (todo & TODO_REG_SIZE)
- todo_wine lok(size == exp_size, "got wrong size %d, expected %d\n",
size, exp_size);
- else
+ todo_wine_if (todo & TODO_REG_SIZE)
lok(size == exp_size, "got wrong size %d, expected %d\n", size,
exp_size);
- if (todo & TODO_REG_DATA)
- todo_wine lok(memcmp(data, exp_data, size) == 0, "got wrong data\n");
- else
+ todo_wine_if (todo & TODO_REG_DATA)
lok(memcmp(data, exp_data, size) == 0, "got wrong data\n");
}
@@ -110,12 +104,7 @@
/* Test empty type */
run_reg_exe("reg add HKCU\\" KEY_BASE " /v emptyType /t \"\"
/d WineTest /f", &r);
- todo_wine ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */),
- "got exit code %u\n", r);
- if (r == REG_EXIT_SUCCESS)
- todo_wine verify_reg(hkey, "emptyType", REG_SZ, "", 1, 0);
- else
- todo_wine win_skip("broken reg.exe detected\n");
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
/* Test input key formats */
run_reg_exe("reg add \\HKCU\\" KEY_BASE "\\keytest0 /f",
&r);
@@ -154,7 +143,7 @@
/* REG_NONE */
run_reg_exe("reg add HKCU\\" KEY_BASE " /v none0 /d deadbeef /t
REG_NONE /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d\n", r);
- verify_reg(hkey, "none0", REG_NONE, "d\0e\0a\0d\0b\0e\0e\0f\0\0",
18, TODO_REG_SIZE);
+ verify_reg(hkey, "none0", REG_NONE, "d\0e\0a\0d\0b\0e\0e\0f\0\0",
18, 0);
/* REG_SZ */
run_reg_exe("reg add HKCU\\" KEY_BASE " /d WineTest /f",
&r);
@@ -173,6 +162,9 @@
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "test", REG_SZ, "", 1, TODO_REG_SIZE);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v test1 /t REG_SZ /f
/d", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /d WineTEST
/f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "", REG_SZ, "WineTEST", 9, 0);
@@ -188,11 +180,11 @@
/* REG_EXPAND_SZ */
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);
- verify_reg(hkey, "expand0", REG_EXPAND_SZ, "dead%PATH%beef", 15,
TODO_REG_SIZE);
+ verify_reg(hkey, "expand0", REG_EXPAND_SZ, "dead%PATH%beef", 15,
0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand1 /t REG_EXpand_sz /d
\"dead^%PATH^%beef\" /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "expand1", REG_EXPAND_SZ, "dead^%PATH^%beef",
17, TODO_REG_SIZE);
+ verify_reg(hkey, "expand1", REG_EXPAND_SZ, "dead^%PATH^%beef",
17, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_EXPAND_SZ /v expand2
/f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
@@ -200,11 +192,11 @@
run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /t
REG_EXPAND_SZ /d WineTEST /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "", REG_EXPAND_SZ, "WineTEST", 9,
TODO_REG_SIZE);
+ verify_reg(hkey, "", REG_EXPAND_SZ, "WineTEST", 9, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_EXPAND_SZ /v expand3 /f
/d \"\"", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1,
TODO_REG_SIZE);
+ verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0);
/* REG_BINARY */
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0
/f", &r);
@@ -217,11 +209,11 @@
verify_reg(hkey, "", REG_BINARY, &dword, sizeof(DWORD), 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin1 /f /d
0xDeAdBeEf", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin2 /f /d
x01", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin3 /f /d
01x", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin4 /f /d
DeAdBeEf0DD", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
@@ -243,6 +235,9 @@
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
verify_reg(hkey, "bin5", REG_BINARY, buffer, 0, 0);
+ 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);
+
/* REG_DWORD */
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 */),
@@ -253,15 +248,17 @@
else
win_skip("broken reg.exe detected\n");
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword0 /t REG_DWORD /f
/d", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword1 /t REG_DWORD
/f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
- "got exit code %d, expected 0\n", r);
+ ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
+ "got exit code %d, expected 1\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword2 /t REG_DWORD /d zzz
/f", &r);
- todo_wine 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 " /v dword3 /t REG_DWORD /d
deadbeef /f", &r);
- todo_wine 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 " /v dword4 /t REG_DWORD /d
123xyz /f", &r);
- todo_wine 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 " /v dword5 /t reg_dword /d
12345678 /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
@@ -275,26 +272,32 @@
ok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err);
ok(type == REG_DWORD, "got wrong type %d, expected %d\n", type,
REG_DWORD);
ok(size == sizeof(DWORD), "got wrong size %d, expected %d\n", size,
(int)sizeof(DWORD));
- todo_wine ok(dword == 123 || broken(dword == 0123 /* WinXP */),
- "got wrong data %d, expected %d\n", dword, 123);
+ ok(dword == 123 || broken(dword == 0123 /* WinXP */), "got wrong data %d,
expected 123\n", dword);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword7 /t reg_dword /d
0xabcdefg /f", &r);
- todo_wine 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 " /v dword8 /t REG_dword /d
0xdeadbeef /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0xdeadbeef;
- verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword),
- (sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
+ verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /v dword9 /f /d
-1", &r);
- todo_wine 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 " /t REG_DWORD /v dword10 /f /d
-0x1", &r);
- todo_wine 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 " /v dword8 /t REG_dword /d
0x01ffffffff /f", &r);
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
"got exit code %d\n", r);
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword12 /t REG_DWORD /d
0xffffffff /f", &r);
+ ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ dword = ~0u;
+ verify_reg(hkey, "dword12", REG_DWORD, &dword, sizeof(dword), 0);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword13 /t REG_DWORD /d
00x123 /f", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
/* REG_DWORD_LITTLE_ENDIAN */
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);
@@ -305,49 +308,55 @@
run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_BE /t
REG_DWORD_BIG_ENDIAN /d 456 /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
dword = 456;
- verify_reg(hkey, "DWORD_BE", REG_DWORD_BIG_ENDIAN, &dword,
sizeof(dword), TODO_REG_SIZE);
+ verify_reg(hkey, "DWORD_BE", REG_DWORD_BIG_ENDIAN, &dword,
sizeof(dword), 0);
/* REG_DWORD_BIG_ENDIAN is broken in every version of windows. It behaves like
* an ordinary REG_DWORD - that is little endian. GG */
/* REG_MULTI_SZ */
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\n", r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
memcpy(buffer, "three\0little\0strings\0", 22);
- verify_reg(hkey, "multi0", REG_MULTI_SZ, buffer, 22, TODO_REG_SIZE);
+ todo_wine verify_reg(hkey, "multi0", REG_MULTI_SZ, buffer, 22,
TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi1 /s
\"#\" /d \"three#little#strings\" /f", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "multi1", REG_MULTI_SZ, buffer, 22, TODO_REG_SIZE);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
+ todo_wine verify_reg(hkey, "multi1", REG_MULTI_SZ, buffer, 22,
TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi2 /d
\"\" /f", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "multi2", REG_MULTI_SZ, &buffer[21], 1,
TODO_REG_SIZE);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
+ todo_wine verify_reg(hkey, "multi2", REG_MULTI_SZ, &buffer[21], 1,
TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi3
/f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
verify_reg(hkey, "multi3", REG_MULTI_SZ, &buffer[21], 1,
TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s
\"#\" /d \"threelittlestrings\" /f", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
- verify_reg(hkey, "multi4", REG_MULTI_SZ, "threelittlestrings\0",
20, TODO_REG_SIZE);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
+ todo_wine verify_reg(hkey, "multi4", REG_MULTI_SZ,
"threelittlestrings\0", 20, TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi5 /s
\"#randomgibberish\" /d \"three#little#strings\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi6 /s
\"\\0\" /d \"three\\0little\\0strings\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi7 /s
\"\" /d \"three#little#strings\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi8 /s
\"#\" /d \"##\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi9 /s
\"#\" /d \"two##strings\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi10 /s
\"#\" /d \"#a\" /f", &r);
- todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi11 /s
\"#\" /d \"a#\" /f", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
+ todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r);
buffer[0]='a'; buffer[1]=0; buffer[2]=0;
- verify_reg(hkey, "multi11", REG_MULTI_SZ, buffer, 3, TODO_REG_SIZE);
+ todo_wine verify_reg(hkey, "multi11", REG_MULTI_SZ, buffer, 3,
TODO_REG_SIZE);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi12 /t REG_MULTI_SZ /f
/d", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi13 /t REG_MULTI_SZ /f
/s", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
RegCloseKey(hkey);
@@ -416,6 +425,23 @@
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
}
+static void test_v_flags(void)
+{
+ DWORD r;
+
+ run_reg_exe("reg add HKCU\\" KEY_BASE " /v Wine /ve", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg delete HKCU\\" KEY_BASE " /v Wine /ve",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg delete HKCU\\" KEY_BASE " /v Wine /va",
&r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+
+ run_reg_exe("reg delete HKCU\\" KEY_BASE " /ve /va", &r);
+ ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+}
+
START_TEST(reg)
{
DWORD r;
@@ -430,4 +456,5 @@
test_add();
test_delete();
test_query();
-}
+ test_v_flags();
+}