/[LeafOK_CVS]/lbbs/src/test_section_list.c
ViewVC logotype

Diff of /lbbs/src/test_section_list.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.12 by sysadm, Thu May 22 14:17:50 2025 UTC Revision 1.13 by sysadm, Fri May 23 00:12:59 2025 UTC
# Line 447  int main(int argc, char *argv[]) Line 447  int main(int argc, char *argv[])
447    
448                  if (p_section[i]->visible_article_count > 0)                  if (p_section[i]->visible_article_count > 0)
449                  {                  {
450                          printf("Inconsistent invisible count in section %d, %d > 0\n", i, p_section[i]->visible_article_count);                          printf("Inconsistent invisible article count in section %d, %d > 0\n", i, p_section[i]->visible_article_count);
451                            break;
452                    }
453    
454                    if (p_section[i]->visible_topic_count > 0)
455                    {
456                            printf("Inconsistent invisible topic count in section %d, %d > 0\n", i, p_section[i]->visible_topic_count);
457                            break;
458                    }
459    
460                    last_aid = p_section[i]->p_article_head->aid;
461                    if (section_list_calculate_page(p_section[i], last_aid) < 0)
462                    {
463                            printf("section_list_calculate_page(aid = %d) error in section %d offset %d\n", last_aid, i, j);
464                            break;
465                    }
466    
467                    if (p_section[i]->visible_article_count / BBS_article_limit_per_page +
468                                    (p_section[i]->visible_article_count % BBS_article_limit_per_page ? 1 : 0) !=
469                            p_section[i]->page_count)
470                    {
471                            printf("Inconsistent page count in section %d offset %d, %d != %d, "
472                                       "visible_article_count = %d, last_page_visible_count = %d\n",
473                                       i, j,
474                                       p_section[i]->visible_article_count / BBS_article_limit_per_page +
475                                               (p_section[i]->visible_article_count % BBS_article_limit_per_page ? 1 : 0),
476                                       p_section[i]->page_count, p_section[i]->visible_article_count,
477                                       p_section[i]->last_page_visible_article_count);
478                            break;
479                    }
480            }
481    
482            for (i = 0; i < BBS_max_section; i++)
483            {
484                    affected_count = 0;
485    
486                    for (j = 0; j < BBS_article_limit_per_section; j += 1)
487                    {
488                            last_aid = i * BBS_article_limit_per_section + j + 1;
489    
490                            if (section_list_set_article_visible(p_section[i], last_aid, 1) <= 0)
491                            {
492                                    printf("Error set article %d visible in section %d offset %d\n", last_aid, i, j);
493                                    break;
494                            }
495    
496                            affected_count++;
497                    }
498    
499                    if (affected_count != p_section[i]->article_count)
500                    {
501                            printf("Inconsistent total set visible article count in section %d, %d != %d\n", i, affected_count, p_section[i]->article_count);
502                            break;
503                    }
504    
505                    if (p_section[i]->visible_article_count != p_section[i]->article_count)
506                    {
507                            printf("Inconsistent visible article count in section %d, %d != %d\n", i, p_section[i]->visible_article_count, p_section[i]->article_count);
508                            break;
509                    }
510    
511                    if (p_section[i]->visible_topic_count != group_count)
512                    {
513                            printf("Inconsistent visible topic count in section %d, %d != %d\n", i, p_section[i]->visible_topic_count, group_count);
514                          break;                          break;
515                  }                  }
516    


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1