diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rspamd_dkim_test.c | 6 | ||||
-rw-r--r-- | test/rspamd_dns_test.c | 6 | ||||
-rw-r--r-- | test/rspamd_expression_test.c | 8 | ||||
-rw-r--r-- | test/rspamd_fuzzy_test.c | 6 | ||||
-rw-r--r-- | test/rspamd_mem_pool_test.c | 24 | ||||
-rw-r--r-- | test/rspamd_statfile_test.c | 4 | ||||
-rw-r--r-- | test/rspamd_test_suite.c | 4 |
7 files changed, 29 insertions, 29 deletions
diff --git a/test/rspamd_dkim_test.c b/test/rspamd_dkim_test.c index b6a613e48..a0c6332e4 100644 --- a/test/rspamd_dkim_test.c +++ b/test/rspamd_dkim_test.c @@ -63,7 +63,7 @@ rspamd_dkim_test_func () { rspamd_dkim_context_t *ctx; rspamd_dkim_key_t *key; - memory_pool_t *pool; + rspamd_mempool_t *pool; struct rspamd_dns_resolver *resolver; struct config_file *cfg; GError *err = NULL; @@ -71,11 +71,11 @@ rspamd_dkim_test_func () cfg = (struct config_file *)g_malloc (sizeof (struct config_file)); bzero (cfg, sizeof (struct config_file)); - cfg->cfg_pool = memory_pool_new (memory_pool_get_size ()); + cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); cfg->dns_retransmits = 10; cfg->dns_timeout = 1000; - pool = memory_pool_new (memory_pool_get_size ()); + pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); resolver = dns_resolver_init (base, cfg); diff --git a/test/rspamd_dns_test.c b/test/rspamd_dns_test.c index 9fa1d4901..897ed4253 100644 --- a/test/rspamd_dns_test.c +++ b/test/rspamd_dns_test.c @@ -67,17 +67,17 @@ rspamd_dns_test_func () { struct rspamd_dns_resolver *resolver; struct config_file *cfg; - memory_pool_t *pool; + rspamd_mempool_t *pool; struct rspamd_async_session *s; struct in_addr ina; cfg = (struct config_file *)g_malloc (sizeof (struct config_file)); bzero (cfg, sizeof (struct config_file)); - cfg->cfg_pool = memory_pool_new (memory_pool_get_size ()); + cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); cfg->dns_retransmits = 10; cfg->dns_timeout = 1000; - pool = memory_pool_new (memory_pool_get_size ()); + pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); s = new_async_session (pool, session_fin, NULL, NULL, NULL); diff --git a/test/rspamd_expression_test.c b/test/rspamd_expression_test.c index 7cf4bb123..2ce9e4f87 100644 --- a/test/rspamd_expression_test.c +++ b/test/rspamd_expression_test.c @@ -16,21 +16,21 @@ char *test_expressions[] = { void rspamd_expression_test_func () { - memory_pool_t *pool; + rspamd_mempool_t *pool; struct expression *cur; struct expression_argument *arg; char **line, *outstr; int r, s; GList *cur_arg; - pool = memory_pool_new (1024); + pool = rspamd_mempool_new (1024); line = test_expressions; while (*line) { r = 0; cur = parse_expression (pool, *line); s = strlen (*line) * 4; - outstr = memory_pool_alloc (pool, s); + outstr = rspamd_mempool_alloc (pool, s); while (cur) { if (cur->type == EXPR_REGEXP) { r += rspamd_snprintf (outstr + r, s - r, "OP:%s ", (char *)cur->content.operand); @@ -60,5 +60,5 @@ rspamd_expression_test_func () line ++; } - memory_pool_delete (pool); + rspamd_mempool_delete (pool); } diff --git a/test/rspamd_fuzzy_test.c b/test/rspamd_fuzzy_test.c index 7805e4f42..a5c76cb34 100644 --- a/test/rspamd_fuzzy_test.c +++ b/test/rspamd_fuzzy_test.c @@ -36,12 +36,12 @@ static char *s5 = "This is sample test text.\r\n" void rspamd_fuzzy_test_func () { - memory_pool_t *pool; + rspamd_mempool_t *pool; fuzzy_hash_t *h1, *h2, *h3, *h4, *h5; f_str_t f1, f2, f3, f4, f5; int diff2; - pool = memory_pool_new (1024); + pool = rspamd_mempool_new (1024); f1.begin = s1; f1.len = strlen (s1); f2.begin = s2; @@ -72,5 +72,5 @@ rspamd_fuzzy_test_func () g_assert (diff2 == 100); } - memory_pool_delete (pool); + rspamd_mempool_delete (pool); } diff --git a/test/rspamd_mem_pool_test.c b/test/rspamd_mem_pool_test.c index 51a32c47f..228644799 100644 --- a/test/rspamd_mem_pool_test.c +++ b/test/rspamd_mem_pool_test.c @@ -10,16 +10,16 @@ void rspamd_mem_pool_test_func () { - memory_pool_t *pool; - memory_pool_stat_t st; + rspamd_mempool_t *pool; + rspamd_mempool_stat_t st; char *tmp, *tmp2, *tmp3; pid_t pid; int ret; - pool = memory_pool_new (sizeof (TEST_BUF)); - tmp = memory_pool_alloc (pool, sizeof (TEST_BUF)); - tmp2 = memory_pool_alloc (pool, sizeof (TEST_BUF) * 2); - tmp3 = memory_pool_alloc_shared (pool, sizeof (TEST_BUF)); + pool = rspamd_mempool_new (sizeof (TEST_BUF)); + tmp = rspamd_mempool_alloc (pool, sizeof (TEST_BUF)); + tmp2 = rspamd_mempool_alloc (pool, sizeof (TEST_BUF) * 2); + tmp3 = rspamd_mempool_alloc_shared (pool, sizeof (TEST_BUF)); snprintf (tmp, sizeof (TEST_BUF), "%s", TEST_BUF); snprintf (tmp2, sizeof (TEST_BUF) * 2, "%s", TEST2_BUF); @@ -28,22 +28,22 @@ rspamd_mem_pool_test_func () g_assert (strncmp (tmp, TEST_BUF, sizeof (TEST_BUF)) == 0); g_assert (strncmp (tmp2, TEST2_BUF, sizeof (TEST2_BUF)) == 0); g_assert (strncmp (tmp3, TEST_BUF, sizeof (TEST_BUF)) == 0); - memory_pool_lock_shared (pool, tmp3); + rspamd_mempool_lock_shared (pool, tmp3); if ((pid = fork ()) == 0) { - memory_pool_lock_shared (pool, tmp3); + rspamd_mempool_lock_shared (pool, tmp3); g_assert (*tmp3 == 's'); *tmp3 = 't'; - memory_pool_unlock_shared (pool, tmp3); + rspamd_mempool_unlock_shared (pool, tmp3); exit (EXIT_SUCCESS); } else { *tmp3 = 's'; - memory_pool_unlock_shared (pool, tmp3); + rspamd_mempool_unlock_shared (pool, tmp3); } wait (&ret); g_assert (*tmp3 == 't'); - memory_pool_delete (pool); - memory_pool_stat (&st); + rspamd_mempool_delete (pool); + rspamd_mempool_stat (&st); } diff --git a/test/rspamd_statfile_test.c b/test/rspamd_statfile_test.c index f8e8a5294..870a827fa 100644 --- a/test/rspamd_statfile_test.c +++ b/test/rspamd_statfile_test.c @@ -10,12 +10,12 @@ void rspamd_statfile_test_func () { statfile_pool_t *pool; - memory_pool_t *p; + rspamd_mempool_t *p; stat_file_t *st; uint32_t random_hashes[HASHES_NUM], i, v; time_t now; - p = memory_pool_new (memory_pool_get_size ()); + p = rspamd_mempool_new (rspamd_mempool_suggest_size ()); umask (S_IWGRP | S_IWOTH); pool = statfile_pool_new (p, 10 * 1024 * 1024, TRUE); diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c index 7fb655347..fedcfd3eb 100644 --- a/test/rspamd_test_suite.c +++ b/test/rspamd_test_suite.c @@ -24,11 +24,11 @@ main (int argc, char **argv) #endif memset (rspamd_main, 0, sizeof (struct rspamd_main)); - rspamd_main->server_pool = memory_pool_new (memory_pool_get_size ()); + rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); rspamd_main->cfg = (struct config_file *)g_malloc (sizeof (struct config_file)); cfg = rspamd_main->cfg; bzero (cfg, sizeof (struct config_file)); - cfg->cfg_pool = memory_pool_new (memory_pool_get_size ()); + cfg->cfg_pool = rspamd_mempool_new (rspamd_mempool_suggest_size ()); base = event_init (); |