aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_statfile_test.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-12 11:56:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-12 11:56:42 +0100
commit491e42b434921ed3d102956bb7ad1fe3697fef46 (patch)
tree45986c3764c82d50f4fded5e7c05a25c875adfa9 /test/rspamd_statfile_test.c
parentad29a3dd73648b23f818d7a62c6424a14a884e10 (diff)
downloadrspamd-491e42b434921ed3d102956bb7ad1fe3697fef46.tar.gz
rspamd-491e42b434921ed3d102956bb7ad1fe3697fef46.zip
Restore testing framework.
Diffstat (limited to 'test/rspamd_statfile_test.c')
-rw-r--r--test/rspamd_statfile_test.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/rspamd_statfile_test.c b/test/rspamd_statfile_test.c
index 870a827fa..753782c9c 100644
--- a/test/rspamd_statfile_test.c
+++ b/test/rspamd_statfile_test.c
@@ -1,7 +1,8 @@
-#include "../src/config.h"
-#include "../src/main.h"
-#include "../src/statfile.h"
+#include "config.h"
+#include "main.h"
+#include "statfile.h"
#include "tests.h"
+#include "ottery.h"
#define TEST_FILENAME "/tmp/rspamd_test.stat"
#define HASHES_NUM 256
@@ -13,17 +14,14 @@ rspamd_statfile_test_func ()
rspamd_mempool_t *p;
stat_file_t *st;
uint32_t random_hashes[HASHES_NUM], i, v;
- time_t now;
+ time_t now = time (NULL);
p = rspamd_mempool_new (rspamd_mempool_suggest_size ());
umask (S_IWGRP | S_IWOTH);
- pool = statfile_pool_new (p, 10 * 1024 * 1024, TRUE);
+ pool = statfile_pool_new (p, TRUE);
- now = time (NULL);
- /* Fill random array */
- srand (now);
for (i = 0; i < HASHES_NUM; i ++) {
- random_hashes[i] = rand ();
+ random_hashes[i] = ottery_rand_uint32 ();
}
/* Create new file */