diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-18 00:10:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-18 00:10:56 +0100 |
commit | ab15b9a3c95d6c0d37330c96d8827ac59b2fee78 (patch) | |
tree | 70a9faf4dc79456cfa4aa804a5ce3dbe5c695024 /test | |
parent | af127078a26a41e6254d97f760c2afcfea2110ef (diff) | |
download | rspamd-ab15b9a3c95d6c0d37330c96d8827ac59b2fee78.tar.gz rspamd-ab15b9a3c95d6c0d37330c96d8827ac59b2fee78.zip |
Remove legacy fuzzy code completely.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/rspamd_fuzzy_test.c | 76 | ||||
-rw-r--r-- | test/rspamd_test_suite.c | 1 | ||||
-rw-r--r-- | test/tests.h | 3 |
4 files changed, 0 insertions, 81 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7c3312634..584bbbd4d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,5 @@ SET(TESTSRC rspamd_mem_pool_test.c rspamd_statfile_test.c - rspamd_fuzzy_test.c rspamd_url_test.c rspamd_dns_test.c rspamd_async_test.c diff --git a/test/rspamd_fuzzy_test.c b/test/rspamd_fuzzy_test.c deleted file mode 100644 index b1f1f5dcd..000000000 --- a/test/rspamd_fuzzy_test.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "config.h" -#include "main.h" -#include "fuzzy.h" -#include "tests.h" - -static char *s1 = "This is sample test text.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n"; -static char *s2 = "This is sample test text.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopzrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n"; -static char *s3 = ""; -static char *s4 = "abcdefghijklmn\r\n"; -static char *s5 = "This is sample test text.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopzrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n" - "abcdefghijklmnopqrstuvwx.\r\n"; - -void -rspamd_fuzzy_test_func () -{ - rspamd_mempool_t *pool; - rspamd_fuzzy_t *h1, *h2, *h3, *h4, *h5; - rspamd_fstring_t f1, f2, f3, f4, f5; - int diff2; - - pool = rspamd_mempool_new (1024); - f1.begin = s1; - f1.len = strlen (s1); - f2.begin = s2; - f2.len = strlen (s2); - f3.begin = s3; - f3.len = strlen (s3); - f4.begin = s4; - f4.len = strlen (s4); - f5.begin = s5; - f5.len = strlen (s5); - - h1 = rspamd_fuzzy_init (&f1, pool); - h2 = rspamd_fuzzy_init (&f2, pool); - h3 = rspamd_fuzzy_init (&f3, pool); - h4 = rspamd_fuzzy_init (&f4, pool); - h5 = rspamd_fuzzy_init (&f5, pool); - - diff2 = rspamd_fuzzy_compare (h2, h5); - msg_debug ("rspamd_fuzzy_test_func: s1, s2 difference between strings is %d", rspamd_fuzzy_compare (h1, h2)); - msg_debug ("rspamd_fuzzy_test_func: s1, s3 difference between strings is %d", rspamd_fuzzy_compare (h1, h3)); - msg_debug ("rspamd_fuzzy_test_func: s3, s4 difference between strings is %d", rspamd_fuzzy_compare (h3, h4)); - msg_debug ("rspamd_fuzzy_test_func: s2, s4 difference between strings is %d", rspamd_fuzzy_compare (h2, h4)); - msg_debug ("rspamd_fuzzy_test_func: s2, s5 difference between strings is %d", diff2); - - /* Identical strings */ - if (diff2 != 100) { - msg_err ("hash difference is %d", diff2); - g_assert (diff2 == 100); - } - - rspamd_mempool_delete (pool); -} diff --git a/test/rspamd_test_suite.c b/test/rspamd_test_suite.c index 5dc854560..c1a2e27f5 100644 --- a/test/rspamd_test_suite.c +++ b/test/rspamd_test_suite.c @@ -45,7 +45,6 @@ main (int argc, char **argv) g_log_set_default_handler (rspamd_glib_log_function, rspamd_main->logger); 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/statfile", rspamd_statfile_test_func); g_test_add_func ("/rspamd/radix", rspamd_radix_test_func); diff --git a/test/tests.h b/test/tests.h index f0dab9c02..a2ba05b84 100644 --- a/test/tests.h +++ b/test/tests.h @@ -11,9 +11,6 @@ void rspamd_url_test_func (void); /* Memory pools */ void rspamd_mem_pool_test_func (void); -/* Fuzzy hashes */ -void rspamd_fuzzy_test_func (void); - /* Stat file */ void rspamd_statfile_test_func (void); |