oleaut32: Reformat test_safearray such that a tab is 8 spaces.
Gerald Pfeifer
gerald at pfeifer.com
Sun Nov 22 18:07:22 CST 2020
I never got a response this, apart from the following from Marvin a
month later. :-)
This is an automated notification to let you know that your
patch has been reviewed and its status set to "Formatting".
That said, a few months later the following then addressed the issue
original making me look into this:
commit 00c591a947919cf67a01c86d2d5da4ee32c46dcc
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Aug 15 09:58:02 2016 +0300
oleaut32/tests: Fix indentation warning on GCC 6.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
Case closed.
Gerald
On Sun, 10 Jan 2016, Gerald Pfeifer wrote:
> When I was young (some 25 years younger, think Borland C++) for a
> while I wanted to treat tabs in source files configurable, representing
> anywhere from 2 to 8 blanks.
>
> In the meantime I have realized that for a tab to mean anything but
> 8 blanks is bound to cause troubles. And GCC's -Wmisleading-indentation
> is one such case.
>
> Luckily this was only one for-loop that's been affected here, and the
> patch looks larger than it is -- only whitespace changes.
>
> Gerald
>
>
> Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
> ---
> dlls/oleaut32/tests/safearray.c | 98 ++++++++++++++++++++---------------------
> 1 file changed, 49 insertions(+), 49 deletions(-)
>
> diff --git a/dlls/oleaut32/tests/safearray.c b/dlls/oleaut32/tests/safearray.c
> index f57b886..979e2a3 100644
> --- a/dlls/oleaut32/tests/safearray.c
> +++ b/dlls/oleaut32/tests/safearray.c
> @@ -708,61 +708,61 @@ static void test_safearray(void)
> if (!pSafeArrayAllocDescriptorEx)
> return;
>
> - for (i=0;i<sizeof(vttypes)/sizeof(vttypes[0]);i++) {
> - a = NULL;
> - hres = pSafeArrayAllocDescriptorEx(vttypes[i].vt,1,&a);
> - ok(hres == S_OK, "SafeArrayAllocDescriptorEx gave hres 0x%x\n", hres);
> - ok(a->fFeatures == vttypes[i].expflags,"SAADE(%d) resulted with flags %x, expected %x\n", vttypes[i].vt, a->fFeatures, vttypes[i].expflags);
> - if (a->fFeatures & FADF_HAVEIID) {
> - hres = pSafeArrayGetIID(a, &iid);
> - ok(hres == S_OK,"SAGIID failed for vt %d with hres %x\n", vttypes[i].vt,hres);
> - switch (vttypes[i].vt) {
> - case VT_UNKNOWN:
> - ok(IsEqualGUID(((GUID*)a)-1,&IID_IUnknown),"guid for VT_UNKNOWN is not IID_IUnknown\n");
> - ok(IsEqualGUID(&iid, &IID_IUnknown),"SAGIID returned wrong GUID for IUnknown\n");
> - break;
> - case VT_DISPATCH:
> - ok(IsEqualGUID(((GUID*)a)-1,&IID_IDispatch),"guid for VT_UNKNOWN is not IID_IDispatch\n");
> - ok(IsEqualGUID(&iid, &IID_IDispatch),"SAGIID returned wrong GUID for IDispatch\n");
> - break;
> - default:
> - ok(FALSE,"unknown vt %d with FADF_HAVEIID\n",vttypes[i].vt);
> - break;
> - }
> - } else {
> - hres = pSafeArrayGetIID(a, &iid);
> - ok(hres == E_INVALIDARG,"SAGIID did not fail for vt %d with hres %x\n", vttypes[i].vt,hres);
> - }
> - if (a->fFeatures & FADF_RECORD) {
> - ok(vttypes[i].vt == VT_RECORD,"FADF_RECORD for non record %d\n",vttypes[i].vt);
> - }
> - if (a->fFeatures & FADF_HAVEVARTYPE) {
> - ok(vttypes[i].vt == ((DWORD*)a)[-1], "FADF_HAVEVARTYPE set, but vt %d mismatch stored %d\n",vttypes[i].vt,((DWORD*)a)[-1]);
> + for (i=0;i<sizeof(vttypes)/sizeof(vttypes[0]);i++) {
> + a = NULL;
> + hres = pSafeArrayAllocDescriptorEx(vttypes[i].vt,1,&a);
> + ok(hres == S_OK, "SafeArrayAllocDescriptorEx gave hres 0x%x\n", hres);
> + ok(a->fFeatures == vttypes[i].expflags,"SAADE(%d) resulted with flags %x, expected %x\n", vttypes[i].vt, a->fFeatures, vttypes[i].expflags);
> + if (a->fFeatures & FADF_HAVEIID) {
> + hres = pSafeArrayGetIID(a, &iid);
> + ok(hres == S_OK,"SAGIID failed for vt %d with hres %x\n", vttypes[i].vt,hres);
> + switch (vttypes[i].vt) {
> + case VT_UNKNOWN:
> + ok(IsEqualGUID(((GUID*)a)-1,&IID_IUnknown),"guid for VT_UNKNOWN is not IID_IUnknown\n");
> + ok(IsEqualGUID(&iid, &IID_IUnknown),"SAGIID returned wrong GUID for IUnknown\n");
> + break;
> + case VT_DISPATCH:
> + ok(IsEqualGUID(((GUID*)a)-1,&IID_IDispatch),"guid for VT_UNKNOWN is not IID_IDispatch\n");
> + ok(IsEqualGUID(&iid, &IID_IDispatch),"SAGIID returned wrong GUID for IDispatch\n");
> + break;
> + default:
> + ok(FALSE,"unknown vt %d with FADF_HAVEIID\n",vttypes[i].vt);
> + break;
> }
> + } else {
> + hres = pSafeArrayGetIID(a, &iid);
> + ok(hres == E_INVALIDARG,"SAGIID did not fail for vt %d with hres %x\n", vttypes[i].vt,hres);
> + }
> + if (a->fFeatures & FADF_RECORD) {
> + ok(vttypes[i].vt == VT_RECORD,"FADF_RECORD for non record %d\n",vttypes[i].vt);
> + }
> + if (a->fFeatures & FADF_HAVEVARTYPE) {
> + ok(vttypes[i].vt == ((DWORD*)a)[-1], "FADF_HAVEVARTYPE set, but vt %d mismatch stored %d\n",vttypes[i].vt,((DWORD*)a)[-1]);
> + }
>
> - hres = pSafeArrayGetVartype(a, &vt);
> - ok(hres == S_OK, "SAGVT of array with vt %d failed with %x\n", vttypes[i].vt, hres);
> + hres = pSafeArrayGetVartype(a, &vt);
> + ok(hres == S_OK, "SAGVT of array with vt %d failed with %x\n", vttypes[i].vt, hres);
>
> - if (vttypes[i].vt == VT_DISPATCH) {
> - /* Special case. Checked against Windows. */
> - ok(vt == VT_UNKNOWN, "SAGVT of array with VT_DISPATCH returned not VT_UNKNOWN, but %d\n", vt);
> - } else {
> - ok(vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
> - }
> + if (vttypes[i].vt == VT_DISPATCH) {
> + /* Special case. Checked against Windows. */
> + ok(vt == VT_UNKNOWN, "SAGVT of array with VT_DISPATCH returned not VT_UNKNOWN, but %d\n", vt);
> + } else {
> + ok(vt == vttypes[i].vt, "SAGVT of array with vt %d returned %d\n", vttypes[i].vt, vt);
> + }
>
> - if (a->fFeatures & FADF_HAVEIID) {
> - hres = pSafeArraySetIID(a, &IID_IStorage); /* random IID */
> - ok(hres == S_OK,"SASIID failed with FADF_HAVEIID set for vt %d with %x\n", vttypes[i].vt, hres);
> - hres = pSafeArrayGetIID(a, &iid);
> - ok(hres == S_OK,"SAGIID failed with FADF_HAVEIID set for vt %d with %x\n", vttypes[i].vt, hres);
> - ok(IsEqualGUID(&iid, &IID_IStorage),"returned iid is not IID_IStorage\n");
> - } else {
> - hres = pSafeArraySetIID(a, &IID_IStorage); /* random IID */
> + if (a->fFeatures & FADF_HAVEIID) {
> + hres = pSafeArraySetIID(a, &IID_IStorage); /* random IID */
> + ok(hres == S_OK,"SASIID failed with FADF_HAVEIID set for vt %d with %x\n", vttypes[i].vt, hres);
> + hres = pSafeArrayGetIID(a, &iid);
> + ok(hres == S_OK,"SAGIID failed with FADF_HAVEIID set for vt %d with %x\n", vttypes[i].vt, hres);
> + ok(IsEqualGUID(&iid, &IID_IStorage),"returned iid is not IID_IStorage\n");
> + } else {
> + hres = pSafeArraySetIID(a, &IID_IStorage); /* random IID */
> ok(hres == E_INVALIDARG,"SASIID did not failed with !FADF_HAVEIID set for vt %d with %x\n", vttypes[i].vt, hres);
> - }
> - hres = SafeArrayDestroyDescriptor(a);
> - ok(hres == S_OK,"SADD failed with hres %x\n",hres);
> }
> + hres = SafeArrayDestroyDescriptor(a);
> + ok(hres == S_OK,"SADD failed with hres %x\n",hres);
> + }
> }
>
> static void test_SafeArrayAllocDestroyDescriptor(void)
More information about the wine-devel
mailing list