test_Cleanup(p, tctx, &handle, TEST_KEY3);
test_Cleanup(p, tctx, &handle, TEST_KEY_BASE);
+ if (!test_CreateKey(p, tctx, &handle, TEST_KEY_BASE, NULL)) {
+ torture_comment(tctx,
+ "CreateKey (TEST_KEY_BASE) failed\n");
+ }
+
if (!test_CreateKey(p, tctx, &handle, TEST_KEY1, NULL)) {
torture_comment(tctx,
"CreateKey failed - not considering a failure\n");
}
if (created && deleted &&
- test_OpenKey(p, tctx, &handle, TEST_KEY1, &newhandle)) {
+ !_test_OpenKey(p, tctx, &handle, TEST_KEY1,
+ SEC_FLAG_MAXIMUM_ALLOWED, &newhandle,
+ WERR_BADFILE, NULL)) {
torture_comment(tctx,
- "DeleteKey failed (OpenKey after Delete worked)\n");
+ "DeleteKey failed (OpenKey after Delete "
+ "did not return WERR_BADFILE)\n");
ret = false;
}
created4 = true;
}
- if (!created4 && !test_CloseKey(p, tctx, &newhandle)) {
+ if (created4 && !test_CloseKey(p, tctx, &newhandle)) {
printf("CloseKey failed\n");
ret = false;
}
}
- if (created && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) {
+ if (created2 && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) {
printf("DeleteKey failed\n");
ret = false;
}
if(!test_key(p, tctx, &handle, MAX_DEPTH - 1)) {
ret = false;
}
- }
-
- if (!test_key(p, tctx, &handle, 0)) {
- ret = false;
+ } else {
+ if (!test_key(p, tctx, &handle, 0)) {
+ ret = false;
+ }
}
test_Cleanup(p, tctx, &handle, TEST_KEY_BASE);