Fix registry test for Win9x by skipping a section that fails, but
succeeds on NT.
This commit is contained in:
parent
22be9fbcef
commit
44246e47ec
@ -267,48 +267,53 @@ static void test_reg_open_key()
|
|||||||
ok(hkResult != NULL, "expected hkResult != NULL\n");
|
ok(hkResult != NULL, "expected hkResult != NULL\n");
|
||||||
hkPreserve = hkResult;
|
hkPreserve = hkResult;
|
||||||
|
|
||||||
/* open same key twice */
|
/* these tests fail on Win9x, but we want to be compatible with NT, so
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkResult);
|
* run them if we can */
|
||||||
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
if (!(GetVersion() & 0x80000000))
|
||||||
ok(hkResult != hkPreserve, "epxected hkResult != hkPreserve\n");
|
{
|
||||||
ok(hkResult != NULL, "hkResult != NULL\n");
|
/* open same key twice */
|
||||||
RegCloseKey(hkResult);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkResult);
|
||||||
|
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
||||||
|
ok(hkResult != hkPreserve, "epxected hkResult != hkPreserve\n");
|
||||||
|
ok(hkResult != NULL, "hkResult != NULL\n");
|
||||||
|
RegCloseKey(hkResult);
|
||||||
|
|
||||||
/* open nonexistent key
|
/* open nonexistent key
|
||||||
* check that hkResult is set to NULL
|
* check that hkResult is set to NULL
|
||||||
*/
|
*/
|
||||||
hkResult = hkPreserve;
|
hkResult = hkPreserve;
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Nonexistent", &hkResult);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Nonexistent", &hkResult);
|
||||||
ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", ret);
|
ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", ret);
|
||||||
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
||||||
|
|
||||||
/* open the same nonexistent key again to make sure the key wasn't created */
|
/* open the same nonexistent key again to make sure the key wasn't created */
|
||||||
hkResult = hkPreserve;
|
hkResult = hkPreserve;
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Nonexistent", &hkResult);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Nonexistent", &hkResult);
|
||||||
ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", ret);
|
ok(ret == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %ld\n", ret);
|
||||||
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
||||||
|
|
||||||
/* send in NULL lpSubKey
|
/* send in NULL lpSubKey
|
||||||
* check that hkResult receives the value of hKey
|
* check that hkResult receives the value of hKey
|
||||||
*/
|
*/
|
||||||
hkResult = hkPreserve;
|
hkResult = hkPreserve;
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, NULL, &hkResult);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, NULL, &hkResult);
|
||||||
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
||||||
ok(hkResult == HKEY_CURRENT_USER, "expected hkResult == HKEY_CURRENT_USER\n");
|
ok(hkResult == HKEY_CURRENT_USER, "expected hkResult == HKEY_CURRENT_USER\n");
|
||||||
|
|
||||||
/* send empty-string in lpSubKey */
|
/* send empty-string in lpSubKey */
|
||||||
hkResult = hkPreserve;
|
hkResult = hkPreserve;
|
||||||
ret = RegOpenKeyA(HKEY_CURRENT_USER, "", &hkResult);
|
ret = RegOpenKeyA(HKEY_CURRENT_USER, "", &hkResult);
|
||||||
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
||||||
ok(hkResult == HKEY_CURRENT_USER, "expected hkResult == HKEY_CURRENT_USER\n");
|
ok(hkResult == HKEY_CURRENT_USER, "expected hkResult == HKEY_CURRENT_USER\n");
|
||||||
|
|
||||||
/* send in NULL lpSubKey and NULL hKey
|
/* send in NULL lpSubKey and NULL hKey
|
||||||
* hkResult is set to NULL
|
* hkResult is set to NULL
|
||||||
*/
|
*/
|
||||||
hkResult = hkPreserve;
|
hkResult = hkPreserve;
|
||||||
ret = RegOpenKeyA(NULL, NULL, &hkResult);
|
ret = RegOpenKeyA(NULL, NULL, &hkResult);
|
||||||
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", ret);
|
||||||
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
ok(hkResult == NULL, "expected hkResult == NULL\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* only send NULL hKey
|
/* only send NULL hKey
|
||||||
* the value of hkResult remains unchanged
|
* the value of hkResult remains unchanged
|
||||||
|
Loading…
x
Reference in New Issue
Block a user