Vladimir Pankratov wrote:
Hello all.
Fixed Lingvo 9.0 crashes on startup.
Changed files:
comctl32/toolbar.c
Thanks.
The very first one was better (when you fixed only division by zero). Now you're changing path earlier: --- + if(rows <= 0) rows = 1; --- There's no tests currently for that (<=0 isn't tested), could you add them (to test_setrows() I suppose)?
Nikolay Sivov wrote:
The very first one was better (when you fixed only division by zero). Now you're changing path earlier:
- if(rows <= 0) rows = 1;
There's no tests currently for that (<=0 isn't tested), could you add them (to test_setrows() I suppose)?
What's write in this test?
Maybe something like this:
RECT rc; int rows;
memset(&rc, 0xCC, sizeof(rc)); SendMessageA(hToolbar, TB_SETROWS, MAKEWPARAM(0, TRUE), (LPARAM) &rc);
rows = SendMessageA(hToolbar, TB_GETROWS, 0, 0);
ok(rows == 1, "Unexpected number of rows %d (expected %d)\n", rows, 1);
memset(&rc, 0xCC, sizeof(rc)); SendMessageA(hToolbar, TB_SETROWS, MAKEWPARAM(-1, TRUE), (LPARAM) &rc);
rows = SendMessageA(hToolbar, TB_GETROWS, 0, 0);
ok(rows == 1, "Unexpected number of rows %d (expected %d)\n", rows, 1);
Vladimir Pankratov wrote:
Nikolay Sivov wrote:
The very first one was better (when you fixed only division by zero). Now you're changing path earlier:
- if(rows <= 0) rows = 1;
There's no tests currently for that (<=0 isn't tested), could you add them (to test_setrows() I suppose)?
What's write in this test?
Maybe something like this:
RECT rc; int rows;
memset(&rc, 0xCC, sizeof(rc)); SendMessageA(hToolbar, TB_SETROWS, MAKEWPARAM(0, TRUE), (LPARAM) &rc);
rows = SendMessageA(hToolbar, TB_GETROWS, 0, 0);
ok(rows == 1, "Unexpected number of rows %d (expected %d)\n", rows, 1);
memset(&rc, 0xCC, sizeof(rc)); SendMessageA(hToolbar, TB_SETROWS, MAKEWPARAM(-1, TRUE), (LPARAM) &rc);
rows = SendMessageA(hToolbar, TB_GETROWS, 0, 0);
ok(rows == 1, "Unexpected number of rows %d (expected %d)\n", rows, 1);
Yeah, just add 3 new lines here for -2 (to be sure, sometimes -1 has special meaning), -1 and 0: --- static tbrows_result_t tbrows_results[] = { {1, TRUE, 1}, /* 0: Simple case 9 in a row */ {2, TRUE, 2}, /* 1: Another simple case 5 on one row, 4 on another*/ {3, FALSE, 3}, /* 2: 3 lines - should be 3 lines of 3 buttons */ {8, FALSE, 5}, /* 3: 8 lines - should be 5 lines of 2 buttons */ {8, TRUE, 9}, /* 4: 8 lines but grow - should be 9 lines */ {1, TRUE, 1} /* 5: Back to simple case */ }; ---