summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@gnome.org>2004-03-07 17:24:52 +0000
committerDodji Seketeli <dodji@src.gnome.org>2004-03-07 17:24:52 +0000
commitac4bea1c6d6ec8f63a43a2547a82406b3670ac90 (patch)
treeb024fbcf29ef8e72907aeccad343f1062ffc07c7 /tests
parent94f1a410a3d257124c3131b41ccaa883ccabb9c3 (diff)
downloadlibcroco-ac4bea1c6d6ec8f63a43a2547a82406b3670ac90.tar.gz
fixed a memory management bug reported by Rob BUIS.INITIAL_GNU_ARCH_IMPORTGNOME_2_6_ANCHOR
2004-03-07 Dodji Seketeli <dodji@gnome.org> * src/cr-statement.c: (parse_page_start_page_cb) fixed a memory management bug reported by Rob BUIS. (cr_statement_at_page_rule_to_string): added this new helper function. (cr_statement_dump_page): make this use cr_statement_at_page_rule_to_string(). * tests/test4-main.c: (test_cr_statement_at_page_rule_parse_from_buf): added this to start debugging a problem related to @page rule parsing.
Diffstat (limited to 'tests')
-rw-r--r--tests/test4-main.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/tests/test4-main.c b/tests/test4-main.c
index ea51d68..5880cc5 100644
--- a/tests/test4-main.c
+++ b/tests/test4-main.c
@@ -133,6 +133,20 @@ test_cr_parser_parse (guchar * a_file_uri)
}
static enum CRStatus
+test_cr_statement_at_page_rule_parse_from_buf (void)
+{
+ CRStatement *stmt = NULL ;
+
+ stmt = cr_statement_at_page_rule_parse_from_buf
+ (gv_at_page_buf, CR_UTF_8) ;
+ if (!stmt) {
+ return CR_ERROR ;
+
+ }
+ return CR_OK ;
+}
+
+static enum CRStatus
test_cr_term_parse_expression_from_buf (void)
{
guchar *tmp_str = NULL;
@@ -244,23 +258,6 @@ test_cr_statement_at_media_rule_parse (void)
return CR_OK;
}
-static enum CRStatus
-test_cr_statement_at_page_rule_parse (void)
-{
- CRStatement *stmt = NULL;
-
- stmt = cr_statement_at_page_rule_parse_from_buf (gv_at_page_buf,
- CR_UTF_8);
-
- g_return_val_if_fail (stmt, CR_ERROR);
-
- if (stmt) {
- cr_statement_destroy (stmt);
- stmt = NULL;
- }
-
- return CR_OK;
-}
static enum CRStatus
test_cr_statement_at_charset_rule_parse (void)
@@ -392,8 +389,7 @@ main (int argc, char **argv)
if (status != CR_OK) {
g_print ("\ntest cr_statement_at_media_rule_parse() failed\n");
}
-
- test_cr_statement_at_page_rule_parse ();
+ test_cr_statement_at_page_rule_parse_from_buf ();
if (status != CR_OK) {
g_print ("\ntest cr_statement_at_page_rule_parse() failed\n");
return 0;