diff options
author | Dodji Seketeli <dodji@seketeli.org> | 2003-06-19 20:55:30 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@src.gnome.org> | 2003-06-19 20:55:30 +0000 |
commit | 97f56f0bfd289fdd3bd586ea13ed93517f8a6d9e (patch) | |
tree | 8c95b3d8e86fa6f3861ba779ad4349e8063196d3 /tests | |
parent | 127628a4ae11a60cbf609ae1396345190f9d1129 (diff) | |
download | libcroco-97f56f0bfd289fdd3bd586ea13ed93517f8a6d9e.tar.gz |
updated this to test cr_statement_parse_from_buf(). It seems to work now.
2003-06-19 Dodji Seketeli <dodji@seketeli.org>
* tests/test4-main.[ch]: updated this to test
cr_statement_parse_from_buf(). It seems to work now.
Still some memleaks to fix.
* src/parser/cr-statement.[ch]:
some bug fixes in cr_statement_parse_from_buf() +
added a new cr_statement_at_import_rule_parse_from_buf() method.
Dodji.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test4-main.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/tests/test4-main.c b/tests/test4-main.c index 414455a..4dc7ca4 100644 --- a/tests/test4-main.c +++ b/tests/test4-main.c @@ -63,6 +63,10 @@ const guchar *gv_at_font_face_buf= "}" ; +const guchar *gv_at_import_buf= +"@import \"subs.css\";" +; + static void display_help (char *prg_name) ; @@ -257,6 +261,92 @@ test_cr_statement_font_face_rule_parse_from_buf (void) return CR_OK ; } +static enum CRStatus +test_cr_statement_at_import_rule_parse_from_buf (void) +{ + CRStatement *stmt = NULL ; + + stmt = cr_statement_at_import_rule_parse_from_buf (gv_at_import_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_parse_from_buf (void) +{ + CRStatement *stmt = NULL ; + + stmt = cr_statement_parse_from_buf (gv_ruleset_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + stmt = cr_statement_parse_from_buf (gv_at_media_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + stmt = cr_statement_parse_from_buf (gv_at_page_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + stmt = cr_statement_parse_from_buf (gv_at_charset_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + stmt = cr_statement_parse_from_buf (gv_at_font_face_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + stmt = cr_statement_parse_from_buf (gv_at_import_buf, CR_UTF_8) ; + if (stmt) + { + cr_statement_destroy (stmt) ; + stmt = NULL ; + } + else + { + return CR_ERROR ; + } + + return CR_OK ; +} + /** *The entry point of the testing routine. */ @@ -308,6 +398,20 @@ main (int argc, char ** argv) return 0 ; } + test_cr_statement_at_import_rule_parse_from_buf () ; + if (status != CR_OK) + { + g_print ("\nKO\n") ; + return 0 ; + } + + status = test_cr_statement_parse_from_buf () ; + if (status != CR_OK) + { + g_print ("\nKO\n") ; + return 0 ; + } + cr_test_utils_parse_cmd_line (argc, argv, &options) ; if (options.display_help == TRUE) |