aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-14 19:11:19 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-09-14 19:11:19 +0400
commita0f41f7c5712e73e8aa521f2064bc53be3315d0a (patch)
tree147e4d8956a5a3b85e0ecc15b9fcbe29742e4e5c /test
parenta90c7d7a12561845e3371efc6803b1ecf6ad7d89 (diff)
downloadrspamd-a0f41f7c5712e73e8aa521f2064bc53be3315d0a.tar.gz
rspamd-a0f41f7c5712e73e8aa521f2064bc53be3315d0a.zip
* New system of classifiers interface and statfiles processing
* Fix sample config * Fix compile warnings * Fix building without lua support * Fix bugs with nrcpt header parsing and symbols cache loading (by Anton Nekhoroshikh)
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_statfile_test.c11
-rw-r--r--test/rspamd_test_suite.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/test/rspamd_statfile_test.c b/test/rspamd_statfile_test.c
index 19a6cf7ab..282d4dc1c 100644
--- a/test/rspamd_statfile_test.c
+++ b/test/rspamd_statfile_test.c
@@ -25,6 +25,7 @@ void
rspamd_statfile_test_func ()
{
statfile_pool_t *pool;
+ stat_file_t *st;
uint32_t random_hashes[HASHES_NUM], i, v;
time_t now;
@@ -40,17 +41,17 @@ rspamd_statfile_test_func ()
/* Create new file */
g_assert (statfile_pool_create (pool, TEST_FILENAME, 65535) != -1);
- g_assert (statfile_pool_open (pool, TEST_FILENAME) != -1);
+ g_assert ((st = statfile_pool_open (pool, TEST_FILENAME)) != NULL);
/* Get and set random blocks */
- statfile_pool_lock_file (pool, TEST_FILENAME);
+ statfile_pool_lock_file (pool, st);
for (i = 0; i < HASHES_NUM; i ++) {
- statfile_pool_set_block (pool, TEST_FILENAME, random_hashes[i], random_hashes[i], now, 1.0);
+ statfile_pool_set_block (pool, st, random_hashes[i], random_hashes[i], now, 1.0);
}
- statfile_pool_unlock_file (pool, TEST_FILENAME);
+ statfile_pool_unlock_file (pool, st);
for (i = 0; i < HASHES_NUM; i ++) {
- v = statfile_pool_get_block (pool, TEST_FILENAME, random_hashes[i], random_hashes[i], now);
+ v = statfile_pool_get_block (pool, st, random_hashes[i], random_hashes[i], now);
g_assert(v == 1.0);
}
diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c
index 0f4768e73..24d8e0289 100644
--- a/test/rspamd_test_suite.c
+++ b/test/rspamd_test_suite.c
@@ -30,4 +30,6 @@ main (int argc, char **argv)
g_test_add_func ("/rspamd/statfile", rspamd_statfile_test_func);
g_test_run ();
+
+ return 0;
}