| 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-2025 by Leaflet <leaflet@leafok.com> |
| 7 |
|
*/ |
|
/*************************************************************************** |
|
|
* * |
|
|
* This program is free software; you can redistribute it and/or modify * |
|
|
* it under the terms of the GNU General Public License as published by * |
|
|
* the Free Software Foundation; either version 3 of the License, or * |
|
|
* (at your option) any later version. * |
|
|
* * |
|
|
***************************************************************************/ |
|
| 8 |
|
|
| 9 |
#include "article_view_log.h" |
#include "article_view_log.h" |
| 10 |
#include <stdio.h> |
#include <stdio.h> |
| 17 |
|
|
| 18 |
article_view_log_load(0, &view_log, 0); |
article_view_log_load(0, &view_log, 0); |
| 19 |
|
|
| 20 |
for (i = MAX_AID_INC_CNT * 3; i > 0; i--) |
for (i = MAX_VIEWED_AID_INC_CNT * 3; i > 0; i--) |
| 21 |
{ |
{ |
| 22 |
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) |
| 23 |
{ |
{ |
| 24 |
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); |
| 25 |
} |
} |
| 40 |
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); |
| 41 |
|
|
| 42 |
article_view_log_unload(&view_log); |
article_view_log_unload(&view_log); |
| 43 |
|
|
| 44 |
return 0; |
return 0; |
| 45 |
} |
} |