[PATCH 1/2] dmime/tests: Added tests for IDirectMusicPerformance.

Austin Lund austin.lund at gmail.com
Thu Aug 12 00:11:11 CDT 2010


On 12 August 2010 14:23, Vitaliy Margolen <wine-devel at kievinfo.com> wrote:
> On 08/11/2010 09:14 PM, Austin Lund wrote:
>>
>> On 11 August 2010 20:12, David Adam<david.adam.cnrs at gmail.com>  wrote:
>> I wasn't sure of the best way to do this.  But basically I want to
>> check that the Vtbl had been set.  I cannot cast to
>> IDirectMusicPortImpl and I'm still confused by the COM macros.
>
> You shouldn't be checking for any vtbl, it's all object's internal stuff. If
> you must check a pointer if it's null or not, then do that explicitly.
> Pointers have different size in 32-bit and 64-bit architectures.
>
> Also you don't need two things pointing to one another. IDirectMusicPort is
> a pointer in a first place. So no need for memset either. And no need for
> all the extra traces that print the same stuff. You already checking if it's
> null or not. The value of the pointer won't be of any use.

The setting (or not) of the Vtbl is exactly why the crash in bug 22598
occurs.  So if I'm not allowed to test for this, then this bug
shouldn't have a test written for it?

The test I wrote for this bug just ensures that the object has
something put into it to avoid the segfault. The sanest way I could
think of doing this is to zero out the memory (hence memset) and check
that the function actually put something at the start of the object.

I got rid of the traces in the second go.  They were left over from
when I was using crosstest to see what was going on.



More information about the wine-devel mailing list