Need help writing test

Igor Tarasov tarasov.igor at gmail.com
Fri Apr 24 19:20:49 CDT 2009


Hi!

I've found few visual glitches in comctl32/toolbar, and now try to
write this all down as conformance tests, but I have some problems. I
see that there is bug, when I test it with control spy. But when I
repeat it in testcase, it won't work. Here is how you can reproduce
it:

TB_SETBITMAPSIZE 20,20
TB_SETBUTTONSIZE 30,30
TB_SETBITMAPSIZE 10,10

Now, if you do TB_SETBUTTONSIZE, you'll see the difference. builtin
comctl will return 17,16. Native - 30,16. But when I write something
like this:

    rebuild_toolbar_with_buttons(&hToolbar);
    himl = ImageList_LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDB_BITMAP_80x15), 20, 2, CLR_NONE, IMAGE_BITMAP,
LR_DEFAULTCOLOR);
    ok(SendMessageA(hToolbar, TB_SETIMAGELIST, 0, (LRESULT)himl) == 0,
"TB_SETIMAGELIST failed\n");
    SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(20, 20));
    SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(30, 30));
    ok(SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0) == MAKELONG(30,
30), "Unexpected button size\n");
    SendMessageA(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(10, 10));
    compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0),
MAKELONG(30, 16), "%x");

This test fails, when I test it with native comctl32 (the size is
17,16). Why could this happen or what am I doing wrong?

-- 
Igor



More information about the wine-devel mailing list