]> source.dussan.org Git - rspamd.git/commitdiff
Remove deprecated test.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 13:51:46 +0000 (13:51 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 13:51:46 +0000 (13:51 +0000)
test/CMakeLists.txt
test/rspamd_expression_test.c [deleted file]
test/rspamd_test_suite.c
test/tests.h

index 5d1f0aaab6d68443479c37c2fd5cdea69f94e8cb..d7392683f36ece53c3c6baf21697d373cdeb7050 100644 (file)
@@ -1,5 +1,4 @@
-SET(TESTSRC            rspamd_expression_test.c
-                               rspamd_mem_pool_test.c
+SET(TESTSRC            rspamd_mem_pool_test.c
                                rspamd_statfile_test.c
                                rspamd_fuzzy_test.c
                                rspamd_url_test.c
diff --git a/test/rspamd_expression_test.c b/test/rspamd_expression_test.c
deleted file mode 100644 (file)
index f7939bd..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "config.h"
-#include "main.h"
-#include "cfg_file.h"
-#include "expressions.h"
-#include "tests.h"
-
-/* Vector of test expressions */
-char *test_expressions[] = {
-       "(A&B|!C)&!(D|E)",
-       "/test&!/&!/\\/|/",
-       "header_exists(f(b(aaa)))|header=/bbb/",
-       "!(header_exists(X-Mailer, /aaa,/) | header_exists(User-Agent)) & Received=/cp-out\\d+\\.libero\\.it/H & Message-Id=/<[\\da-f]{12}\\.[\\da-f]{16}@/H",
-       NULL
-}; 
-
-void 
-rspamd_expression_test_func ()
-{
-       rspamd_mempool_t *pool;
-       struct expression *cur;
-       struct expression_argument *arg;
-       char **line, *outstr;
-       int r, s;
-       GList *cur_arg;
-
-       pool = rspamd_mempool_new (1024);
-       
-       line = test_expressions;
-       while (*line) {
-               r = 0;
-               cur = parse_expression (pool, *line);
-               s = strlen (*line) * 4;
-               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);
-                       } else if (cur->type == EXPR_STR) {
-                               r += rspamd_snprintf (outstr + r, s - r, "S:%s ", (char *)cur->content.operand);
-
-                       } else if (cur->type == EXPR_FUNCTION) {
-                               r += rspamd_snprintf (outstr + r, s - r, "F:%s ", ((struct expression_function *)cur->content.operand)->name);
-                               cur_arg = ((struct expression_function *)cur->content.operand)->args;
-                               while (cur_arg) {
-                                       arg = cur_arg->data;
-                                       if (arg->type == EXPRESSION_ARGUMENT_NORMAL) {
-                                               r += rspamd_snprintf (outstr + r, s - r, "A:%s ", (char *)arg->data);
-                                       }
-                                       else {
-                                               r += rspamd_snprintf (outstr + r, s - r, "AF:%p ", arg->data);
-                                       }
-                                       cur_arg = g_list_next (cur_arg);
-                               }
-                       }
-                       else {
-                               r += rspamd_snprintf (outstr + r, s - r, "O:%c ", cur->content.operation);
-                       }
-                       cur = cur->next;
-               }
-               msg_debug ("Parsed expression: '%s' -> '%s'", *line, outstr);
-               line ++;
-       }
-
-       rspamd_mempool_delete (pool);
-}
index 8df36be558b8008ac83cc05c5e9d060bb0f249de..0da1d3839f28fdd9454eb62e163236352ec8e4a7 100644 (file)
@@ -49,7 +49,6 @@ main (int argc, char **argv)
        g_test_add_func ("/rspamd/mem_pool", rspamd_mem_pool_test_func);
        g_test_add_func ("/rspamd/fuzzy", rspamd_fuzzy_test_func);
        g_test_add_func ("/rspamd/url", rspamd_url_test_func);
-       g_test_add_func ("/rspamd/expression", rspamd_expression_test_func);
        g_test_add_func ("/rspamd/statfile", rspamd_statfile_test_func);
        g_test_add_func ("/rspamd/radix", rspamd_radix_test_func);
        g_test_add_func ("/rspamd/dns", rspamd_dns_test_func);
index 1d14bde4bb689e8462e2af9e70e9610886d56bc7..5f304d42cea8348666bb2fd5ce24ee924a7949ac 100644 (file)
@@ -11,9 +11,6 @@ void rspamd_url_test_func (void);
 /* Memory pools */
 void rspamd_mem_pool_test_func (void);
 
-/* Expressions */
-void rspamd_expression_test_func (void);
-
 /* Fuzzy hashes */
 void rspamd_fuzzy_test_func (void);