Jacek Caban (@jacek) commented about dlls/oleaut32/tests/vartest.c:
hres = pVarAbs(&v,&vDst); ok(hres == S_OK && V_VT(&vDst) == VT_R8 && V_R8(&vDst) == 1.1, "VarAbs: expected 0x0,%d,%g, got 0x%lX,%d,%g\n", VT_R8, 1.1, hres, V_VT(&vDst), V_R8(&vDst));
- V_VT(&v) = VT_BSTR;
- V_BSTR(&v) = (BSTR)szNum2;
This is not exactly right, BSTRs should be allocated with SysAllocString (they have "hidden" length member). I guess you copied that from the existing test and it's not really wrong: this proves that being a real BSTR doesn't matter in this particular case. But given that it's not the intention of this test, I'd suggest to just use BSTR properly.