| 346 |
|
|
| 347 |
printf("Testing #4 ...\n"); |
printf("Testing #4 ...\n"); |
| 348 |
|
|
| 349 |
for (i = 0; i < BBS_max_section; i++) |
for (i = 0; i < section_count; i++) |
| 350 |
{ |
{ |
| 351 |
step = i % 10 + 1; |
step = i % 10 + 1; |
| 352 |
for (j = group_count; j < BBS_article_limit_per_section; j += step) |
for (j = group_count; j < BBS_article_limit_per_section; j += step) |
| 367 |
break; |
break; |
| 368 |
} |
} |
| 369 |
|
|
|
if (page * BBS_article_limit_per_page + offset != j) |
|
|
{ |
|
|
printf("Inconsistent article offset %d in section %d page %d offset %d\n", j, i, page, offset); |
|
|
break; |
|
|
} |
|
|
|
|
| 370 |
if (section_list_set_article_visible(p_section[i], last_aid, 0) != 1) |
if (section_list_set_article_visible(p_section[i], last_aid, 0) != 1) |
| 371 |
{ |
{ |
| 372 |
printf("Error set article %d invisible in section %d offset %d\n", last_aid, i, j); |
printf("Error set article %d invisible in section %d offset %d\n", last_aid, i, j); |
| 374 |
} |
} |
| 375 |
} |
} |
| 376 |
|
|
| 377 |
|
last_aid = p_section[i]->p_article_head->aid; |
| 378 |
|
if (section_list_calculate_page(p_section[i], last_aid) < 0) |
| 379 |
|
{ |
| 380 |
|
printf("section_list_calculate_page(aid = %d) error in section %d offset %d\n", last_aid, i, j); |
| 381 |
|
break; |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
if (p_section[i]->visible_article_count / BBS_article_limit_per_page + |
| 385 |
|
(p_section[i]->visible_article_count % BBS_article_limit_per_page ? 1 : 0) != |
| 386 |
|
p_section[i]->page_count) |
| 387 |
|
{ |
| 388 |
|
printf("Inconsistent page count in section %d offset %d, %d != %d, " |
| 389 |
|
"visible_article_count = %d, last_page_visible_count = %d\n", |
| 390 |
|
i, j, |
| 391 |
|
p_section[i]->visible_article_count / BBS_article_limit_per_page + |
| 392 |
|
(p_section[i]->visible_article_count % BBS_article_limit_per_page ? 1 : 0), |
| 393 |
|
p_section[i]->page_count, p_section[i]->visible_article_count, |
| 394 |
|
p_section[i]->last_page_visible_article_count); |
| 395 |
|
break; |
| 396 |
|
} |
| 397 |
|
|
| 398 |
affected_count = (BBS_article_limit_per_section - group_count) / step + ((BBS_article_limit_per_section - group_count) % step ? 1 : 0); |
affected_count = (BBS_article_limit_per_section - group_count) / step + ((BBS_article_limit_per_section - group_count) % step ? 1 : 0); |
| 399 |
if (p_section[i]->article_count - p_section[i]->visible_article_count != affected_count) |
if (p_section[i]->article_count - p_section[i]->visible_article_count != affected_count) |
| 400 |
{ |
{ |