Nikolay Sivov bunglehead@gmail.com wrote:
For other tests when it returns NULL bstr it would be cleaner to set pointer to some non-zero value to test that each method actually resets it to NULL.
That's a matter of taste.
Not really. You don't know if it's changed or not after the call if you don't know what initial value was. For series of calls like these:
- hr = IRegistrationInfo_get_Documentation(reginfo, &bstr);
+todo_wine
- ok(hr == S_OK, "get_Documentation error %#x\n", hr);
+if (hr == S_OK)
- ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr));
- hr = IRegistrationInfo_get_URI(reginfo, &bstr);
+todo_wine
- ok(hr == S_OK, "get_URI error %#x\n", hr);
+if (hr == S_OK)
- ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr));
there's no way to tell did get_URI set it to NULL or not.
In the case of error I agree, but if the method returned S_OK that means that it really returned something.