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

Contents of /lbbs/src/test_article_view_log.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Jun 7 08:07:07 2025 UTC (9 months, 1 week ago) by sysadm
Branch: MAIN
Changes since 1.1: +3 -3 lines
Content type: text/x-csrc
Update

1 /***************************************************************************
2 test_article_view_log.c - description
3 -------------------
4 Copyright : (C) 2004-2025 by Leaflet
5 Email : leaflet@leafok.com
6 ***************************************************************************/
7
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 3 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17 #include "article_view_log.h"
18 #include <stdio.h>
19
20 int main(int argc, char *argv[])
21 {
22 ARTICLE_VIEW_LOG view_log;
23 int32_t aid;
24 int i;
25
26 article_view_log_load(0, &view_log, 0);
27
28 for (i = MAX_AID_INC_CNT * 3; i > 0; i--)
29 {
30 if (i % MAX_AID_INC_CNT == 0 || i % MAX_AID_INC_CNT == MAX_AID_INC_CNT / 2)
31 {
32 printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);
33 }
34
35 aid = i * 5 + 7;
36 if (article_view_log_is_viewed(aid, &view_log) != 0)
37 {
38 printf("article_view_log_is_viewed(%d) != 0\n", aid);
39 break;
40 }
41 if (article_view_log_set_viewed(aid, &view_log) != 1)
42 {
43 printf("article_view_log_set_viewed(%d) != 1\n", aid);
44 break;
45 }
46 }
47
48 printf("Base cnt = %d, Inc cnt = %d\n", view_log.aid_base_cnt, view_log.aid_inc_cnt);
49
50 article_view_log_unload(&view_log);
51
52 return 0;
53 }

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