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

Diff of /lbbs/src/test_article_view_log.c

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

Revision 1.1 by sysadm, Sat Jun 7 07:59:38 2025 UTC Revision 1.7 by sysadm, Sat Jan 3 10:27:14 2026 UTC
# Line 1  Line 1 
1  /***************************************************************************  /* SPDX-License-Identifier: GPL-3.0-or-later */
2                                    test_article_view_log.c  -  description  /*
3                                                           -------------------   * test_article_view_log
4          Copyright            : (C) 2004-2025 by Leaflet   *   - tester for data persistence and query of article view log
5          Email                : leaflet@leafok.com   *
6   ***************************************************************************/   * Copyright (C) 2004-2026  Leaflet <leaflet@leafok.com>
7     */
8  /***************************************************************************  
9   *                                                                         *  #ifdef HAVE_CONFIG_H
10   *   This program is free software; you can redistribute it and/or modify  *  #include "config.h"
11   *   it under the terms of the GNU General Public License as published by  *  #endif
  *   the Free Software Foundation; either version 3 of the License, or     *  
  *   (at your option) any later version.                                   *  
  *                                                                         *  
  ***************************************************************************/  
12    
13  #include "article_view_log.h"  #include "article_view_log.h"
14  #include <stdio.h>  #include <stdio.h>
# Line 23  int main(int argc, char *argv[]) Line 19  int main(int argc, char *argv[])
19          int32_t aid;          int32_t aid;
20          int i;          int i;
21    
22          view_log.aid_base = NULL;          article_view_log_load(0, &view_log, 0);
         view_log.aid_base_cnt = 0;  
         view_log.aid_inc_cnt = 0;  
23    
24          for (i = MAX_AID_INC_CNT * 3; i > 0; i--)          for (i = MAX_VIEWED_AID_INC_CNT * 3; i > 0; i--)
25          {          {
26                  if (i % MAX_AID_INC_CNT == 0 || i % MAX_AID_INC_CNT == MAX_AID_INC_CNT / 2)                  if (i % MAX_VIEWED_AID_INC_CNT == 0 || i % MAX_VIEWED_AID_INC_CNT == MAX_VIEWED_AID_INC_CNT / 2)
27                  {                  {
28                          printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);                          printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);
29                  }                  }
# Line 49  int main(int argc, char *argv[]) Line 43  int main(int argc, char *argv[])
43    
44          printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);          printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);
45    
46            article_view_log_unload(&view_log);
47    
48          return 0;          return 0;
49  }  }


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

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