[PATCH (try 2) 1/2] dpvoice/tests: Add GetCompressionTypes tests.
Alex Henrie
alexhenrie24 at gmail.com
Thu Jan 15 15:38:41 CST 2015
2015-01-15 5:58 GMT-07:00 Stefan Dösinger <stefandoesinger at gmail.com>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 2015-01-15 um 12:55 schrieb Alex Henrie:
> > + DVCOMPRESSIONINFO data[32];
> I can't really find any documentation about this. Is there a
> documented maximum number of elements returned?
It's not documented, but in practice Windows returns 7 elements plus
their strings, which comes to DVCOMPRESSIONINFO[16] on English systems
and a little less than DVCOMPRESSIONINFO[17] on non-English systems.
DVCOMPRESSIONINFO[32] is more than enough, but the tests check for
overflow just in case.
> > + int i, j;
> Afaics you can make those unsigned.
OK. In try 3 I'll put i and j with the DWORD declarations.
> > + LPWSTR string_loc;
> Is the use of the LPFOO type intentional?
No, I forgot that Wine doesn't like LPFOO. In try 3 I'll change it to WCHAR*.
> > + ok(data_size > sizeof(DVCOMPRESSIONINFO) && data_size < sizeof(data) - 1,
> > + "%s: tests[%i]: expected data_size between %i and %i got data_size=%i\n",
> > + name, i, sizeof(DVCOMPRESSIONINFO), sizeof(data) - 1, data_size);
> data_size is unsigned, you should use %u instead of %i. Same for i and
> j once you change them to unsigned.
Good point. In try 3 I'll use %u instead of %i.
> > + string_loc = (LPWSTR)((char*)data + num_elements * sizeof(DVCOMPRESSIONINFO));
> It's interesting that native places the string in the same data blob,
> but it kinda makes sense. I think (WCHAR *)(data + num_elements) or
> (WCHAR *)&data[num_elements] should work as well.
Good point. In try 3 I'll change this to (WCHAR*)(data + num_elements).
By the way, you can see my work in progress and comment on it at
https://github.com/alexhenrie/wine/commits/master
-Alex
More information about the wine-devel
mailing list