aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-06-02 19:32:34 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-06-02 19:32:34 +0400
commit7bae787900fea17ca82393886217c6287d7e8cea (patch)
tree4f358b3624d7b2ba6c86a25057d4ba7db10965ae /test
parent4eb2985d1ef3631fca82cbf18cc2e8d7aab9b096 (diff)
downloadrspamd-7bae787900fea17ca82393886217c6287d7e8cea.tar.gz
rspamd-7bae787900fea17ca82393886217c6287d7e8cea.zip
* Rework url parsing algorithms
* Adopt all parts of rspamd for new url parser * Improve url-extracter utility by avoiding cut&paste of mime parsing * Small fixes to rspamc client * Bump version to 0.1.3
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_url_test.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/test/rspamd_url_test.c b/test/rspamd_url_test.c
index 36c9e439b..f716c1ab0 100644
--- a/test/rspamd_url_test.c
+++ b/test/rspamd_url_test.c
@@ -70,51 +70,5 @@ const char *test_html = "<some_tag>This is test file with <a href=\"http://micro
void
rspamd_url_test_func ()
{
- GByteArray *text, *html;
- struct worker_task task;
- struct uri *url;
- int i = 0;
-
- text = g_byte_array_new();
- text->data = (gchar *)test_text;
- text->len = strlen (test_text);
- html = g_byte_array_new();
- html->data = (gchar *)test_html;
- html->len = strlen (test_html);
- bzero (&task, sizeof (task));
- TAILQ_INIT (&task.urls);
- task.task_pool = memory_pool_new (8192);
-
- g_test_timer_start ();
- g_test_message ("Testing text URL regexp parser");
- url_parse_text (&task, text, FALSE);
-
- TAILQ_FOREACH (url, &task.urls, next) {
- msg_debug ("Found url: %s, hostname: %s, data: %s", struri (url), url->host, url->data);
- i ++;
- }
-
- while (!TAILQ_EMPTY (&task.urls)) {
- url = TAILQ_FIRST (&task.urls);
- TAILQ_REMOVE (&task.urls, url, next);
- }
- /* g_assert (i == 39); */
-
- msg_debug ("Time elapsed: %.2f", g_test_timer_elapsed ());
- i = 0;
- g_test_timer_start ();
- g_test_message ("Testing html URL regexp parser");
- url_parse_text (&task, html, TRUE);
-
- TAILQ_FOREACH (url, &task.urls, next) {
- msg_debug ("Found url: %s, hostname: %s, data: %s", struri (url), url->host, url->data);
- i ++;
- }
-
- while (!TAILQ_EMPTY (&task.urls)) {
- url = TAILQ_FIRST (&task.urls);
- TAILQ_REMOVE (&task.urls, url, next);
- }
- g_assert (i == 1);
- msg_debug ("Time elapsed: %.2f", g_test_timer_elapsed ());
+ /* XXX: maybe write test for this */
}