[PATCH 1/2] comctl32/tests: test toolbar separator with uninitialized iString

Mikołaj Zalewski mikolaj at zalewski.pl
Thu Apr 23 02:24:42 CDT 2009


  Hi,
  I think it would be interesting to test what TB_GETBUTTONINFO returns 
as iString for such a separator. That way we will know if the value is 
simply ignored, or it's something more complicated.

>+static void test_deadbeef(void)
>  
>
  I think you should find a better name. Maybe test_addbuttons would be 
better - some more tests for this message could be added later?

>+#if 0
>+    /* It is also possible that a poorly written program doesn't initialize the
>+     * iString field of an actual button. Different versions of Windows seem to
>+     * operate differently in this case.
>+     *    + Windows XP doesn't seem to be bothered in the least
>+     *    + Windows 2008 crashes
>+     *    + Windows Vista does not crash, but the subsequent TB_ADDBUTTONS
>+     *      call fails
>+     * Since I know of no program that suffers from this particular issue, I'm
>+     * commenting out this part of the test for the time being. If it gets
>+     * uncommented, the subsequent TB_ADDBUTTONS should be adjusted
>+     * appropriately. */
>  
>
  Tests with #if 0 are discouraged - usually after some time and changes 
in the surrounding, the code doesn't compile anymore. Probably leaving 
only the comment would be appropriate in this case. It's interesting 
that the behaviour changed with the version of Windows. You were testing 
with a program without a manifest? (i.e. using comctl32 v5.82. But it's 
hard to make a mistake, as if you used a manifest, you would have a lot 
of failures in check_sizes)

Mikołaj



More information about the wine-devel mailing list