aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-25 11:03:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-25 11:03:07 +0100
commit1c97bfe34afef6fbe6abffbe85039e4793751819 (patch)
treedf2399391fbaa877d3d9de0f4db97686b6605361 /test
parent231c62a4d17fba802eccb2767ee0c77aa3a8ce9f (diff)
downloadrspamd-1c97bfe34afef6fbe6abffbe85039e4793751819.tar.gz
rspamd-1c97bfe34afef6fbe6abffbe85039e4793751819.zip
Add refcount to rcl objects.
Diffstat (limited to 'test')
-rw-r--r--test/rspamd_rcl_test.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/rspamd_rcl_test.c b/test/rspamd_rcl_test.c
index e5112cd59..cd02a6e2d 100644
--- a/test/rspamd_rcl_test.c
+++ b/test/rspamd_rcl_test.c
@@ -78,7 +78,7 @@ rspamd_rcl_test_func (void)
cur = rcl_test_valid;
while (*cur != NULL) {
- parser = rspamd_cl_parser_new ();
+ parser = rspamd_cl_parser_new (RSPAMD_CL_FLAG_KEY_LOWERCASE);
rspamd_cl_pubkey_add (parser, test_pubkey, sizeof (test_pubkey) - 1, &err);
g_assert_no_error (err);
g_assert (parser != NULL);
@@ -90,7 +90,7 @@ rspamd_rcl_test_func (void)
emitted = rspamd_cl_object_emit (obj, RSPAMD_CL_EMIT_CONFIG);
g_assert (emitted != NULL);
msg_debug ("got config output: %s", emitted);
- parser2 = rspamd_cl_parser_new ();
+ parser2 = rspamd_cl_parser_new (RSPAMD_CL_FLAG_KEY_LOWERCASE);
g_assert (parser2 != NULL);
rspamd_cl_parser_add_chunk (parser2, emitted, strlen (emitted), &err);
g_assert_no_error (err);
@@ -100,7 +100,7 @@ rspamd_rcl_test_func (void)
emitted = rspamd_cl_object_emit (obj, RSPAMD_CL_EMIT_JSON);
g_assert (emitted != NULL);
msg_debug ("got json output: %s", emitted);
- parser2 = rspamd_cl_parser_new ();
+ parser2 = rspamd_cl_parser_new (RSPAMD_CL_FLAG_KEY_LOWERCASE);
g_assert (parser2 != NULL);
rspamd_cl_parser_add_chunk (parser2, emitted, strlen (emitted), &err);
g_assert_no_error (err);
@@ -110,7 +110,7 @@ rspamd_rcl_test_func (void)
emitted = rspamd_cl_object_emit (obj, RSPAMD_CL_EMIT_JSON_COMPACT);
g_assert (emitted != NULL);
msg_debug ("got json compacted output: %s", emitted);
- parser2 = rspamd_cl_parser_new ();
+ parser2 = rspamd_cl_parser_new (RSPAMD_CL_FLAG_KEY_LOWERCASE);
g_assert (parser2 != NULL);
rspamd_cl_parser_add_chunk (parser2, emitted, strlen (emitted), &err);
g_assert_no_error (err);
@@ -119,7 +119,13 @@ rspamd_rcl_test_func (void)
/* Cleanup */
rspamd_cl_parser_free (parser);
+ rspamd_cl_obj_unref (obj);
cur ++;
}
+ /* Load a big json */
+ parser = rspamd_cl_parser_new (RSPAMD_CL_FLAG_KEY_LOWERCASE);
+ rspamd_cl_parser_add_file (parser, "./rcl_test.json", &err);
+ g_assert_no_error (err);
+ rspamd_cl_parser_free (parser);
}