| 59 |
log_std_redirect(STDOUT_FILENO); |
log_std_redirect(STDOUT_FILENO); |
| 60 |
log_err_redirect(STDERR_FILENO); |
log_err_redirect(STDERR_FILENO); |
| 61 |
|
|
| 62 |
|
// block_count = BBS_article_block_limit_per_section * BBS_max_section; // This statement is correct |
| 63 |
|
// - 1 to make blocks allocated is less than required |
| 64 |
|
// Some error will be triggered while invoking section_data_append_article() |
| 65 |
block_count = BBS_article_block_limit_per_section * BBS_max_section - 1; |
block_count = BBS_article_block_limit_per_section * BBS_max_section - 1; |
| 66 |
|
|
| 67 |
if (section_data_pool_init("../conf/menu.conf", block_count) < 0) |
if (section_data_pool_init("../conf/menu.conf", block_count) < 0) |
| 127 |
{ |
{ |
| 128 |
printf("Inconsistent aid at index %d != %d\n", j, last_aid); |
printf("Inconsistent aid at index %d != %d\n", j, last_aid); |
| 129 |
} |
} |
| 130 |
|
|
| 131 |
|
if (section_data_mark_del_article(p_section[i], p_article->aid) != 1) |
| 132 |
|
{ |
| 133 |
|
printf("section_data_mark_del_article(aid = %d) error\n", p_article->aid); |
| 134 |
|
} |
| 135 |
} |
} |
| 136 |
|
|
| 137 |
printf("Verify %d articles in section %d\n", p_section[i]->article_count, i); |
printf("Verify %d articles in section %d\n", p_section[i]->article_count, i); |
| 138 |
|
printf("Delete %d articles in section %d\n", p_section[i]->delete_count, i); |
| 139 |
} |
} |
| 140 |
|
|
| 141 |
printf("Testing #2 ...\n"); |
printf("Testing #2 ...\n"); |
| 236 |
printf("Verify %d topics in section %d\n", group_count, i); |
printf("Verify %d topics in section %d\n", group_count, i); |
| 237 |
} |
} |
| 238 |
|
|
| 239 |
|
printf("Testing #3 ...\n"); |
| 240 |
|
|
| 241 |
|
for (i = 0; i < section_conf_count; i++) |
| 242 |
|
{ |
| 243 |
|
if (section_data_find_section_by_name(sname[i]) == NULL) |
| 244 |
|
{ |
| 245 |
|
printf("section_data_find_section_by_name(%s) error\n", sname[i]); |
| 246 |
|
} |
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
printf("Press ENTER to exit..."); |
| 250 |
|
getchar(); |
| 251 |
|
|
| 252 |
section_data_pool_cleanup(); |
section_data_pool_cleanup(); |
| 253 |
|
|
| 254 |
log_end(); |
log_end(); |