| 1 |
/*************************************************************************** |
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
| 2 |
test_bbs.c - description |
/* |
| 3 |
------------------- |
* test_bbs |
| 4 |
Copyright : (C) 2004-2025 by Leaflet |
* - tester for BBS related common functions |
| 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 "bbs.h" |
#include "bbs.h" |
| 14 |
#include <stdio.h> |
#include <stdio.h> |
| 16 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
| 17 |
{ |
{ |
| 18 |
int i; |
int i; |
| 19 |
|
int user_level; |
| 20 |
|
|
| 21 |
const int user_points[] = { |
const int user_points[] = { |
| 22 |
-50, -1, 0, 1, 49, 50, 51, 499, 500, 501, 99999, 100000, 100001}; |
-50, -1, 0, 1, 49, 50, 51, 499, 500, 501, 99999, 100000, 100001}; |
| 25 |
|
|
| 26 |
for (i = 0; i < user_cnt; i++) |
for (i = 0; i < user_cnt; i++) |
| 27 |
{ |
{ |
| 28 |
printf("%10d\t\t%s\n", user_points[i], get_user_level_name(user_points[i])); |
user_level = get_user_level(user_points[i]); |
| 29 |
|
printf("%10d\t%d\t%s\n", user_points[i], user_level, get_user_level_name(user_level)); |
| 30 |
} |
} |
| 31 |
|
|
| 32 |
return 0; |
return 0; |