On 3/3/07, Vitaliy Margolen <[EMAIL PROTECTED]> wrote:
The_Hagop wrote:
> +static void test_getters_setters(INT nTabs)
> +{
> +    RECT rTab;
> +    INT nTabsRetrieved;
> +    INT rowCount;
> +
> +    hTab = createFilledTabControl(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, 
nTabs);
> +    ok(hTab != NULL, "Failed to create tab control\n");
> +
> +    SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1);
> +
> +    /* Testing GetItemCount */
> +    nTabsRetrieved = SendMessage(hTab, TCM_GETITEMCOUNT, 0, 0);
> +    expect(nTabs, nTabsRetrieved);
> +
> +    /* Testing GetRowCount */
> +    rowCount = SendMessage(hTab, TCM_GETROWCOUNT, 0, 0);
> +    expect(1, rowCount);
> +
> +    /* Testing GetItemRect */
> +    SendMessage(hTab, TCM_GETITEMRECT, 0 , (LPARAM) &rTab );
> +    CheckSize(hTab, TAB_DEFAULT_WIDTH, -1 , "Default Width");
> +
> +    test_getset_curFocus(hTab, nTabs);
> +    test_getset_curSel(hTab, nTabs);
> +
> +    test_getset_extendedStyle(hTab);
> +    test_getset_unicodeFormat(hTab);
> +    test_getset_item(hTab);
> +    test_getset_tooltip(hTab);
> +
> +    DestroyWindow(hTab);
> +}
All your small functions should go inside this function. There is no
need to create 100 small functions that do 1-3 tests.

I suggested breaking up the test into smaller functions to help
improve readability. If he rolls all the code into this function,
after applying part 2 of this patch, it would have created a 200 line
function that's harder to understand and maintain.

- Lei


Reply via email to