| 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 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> |
| 21 |
|
|
| 22 |
article_view_log_load(0, &view_log, 0); |
article_view_log_load(0, &view_log, 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 |
} |
} |
| 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); |
article_view_log_unload(&view_log); |
| 47 |
|
|
| 48 |
return 0; |
return 0; |
| 49 |
} |
} |