diff options
author | Dodji Seketeli <dodji@src.gnome.org> | 2003-03-02 18:58:59 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@src.gnome.org> | 2003-03-02 18:58:59 +0000 |
commit | 1217c1902e50ad1b7de22d43d1e2c0f0a652ec1f (patch) | |
tree | 0c0e1058b760186a1a2bda3a80189adab90480e1 /tests | |
parent | 2e07149b250230b8415a09cd2bddbfbad3f098f7 (diff) | |
download | libcroco-1217c1902e50ad1b7de22d43d1e2c0f0a652ec1f.tar.gz |
Turned on compilation with goddamit warning options.
So I killed an awfully great number of warnings messages.
Also fixed some small regressions that occured during
the rewrite of cr_tknzr_get_next_toke().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test0-main.c | 34 | ||||
-rw-r--r-- | tests/test1-main.c | 36 | ||||
-rw-r--r-- | tests/test2-main.c | 38 | ||||
-rw-r--r-- | tests/test3-main.c | 33 | ||||
-rw-r--r-- | tests/test4-main.c | 31 |
5 files changed, 113 insertions, 59 deletions
diff --git a/tests/test0-main.c b/tests/test0-main.c index ee6cf72..26d5124 100644 --- a/tests/test0-main.c +++ b/tests/test0-main.c @@ -50,6 +50,18 @@ struct Options gchar ** files_list ; }; +static void +display_help (char *prg_name) ; + +static void +display_about (char *prg_name) ; + +static void +parse_command_line (int a_argc, char **a_argv, + struct Options *a_options) ; + +static enum CRStatus +test_cr_input_read_byte (guchar * a_file_uri) ; /** *Displays the usage of the test @@ -57,11 +69,11 @@ struct Options *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_help (int a_argc, char ** a_argv) +static void +display_help (char *prg_name) { g_print ("\n\n") ; - g_print ("usage: %s <file-to-parse>\n", a_argv[0]) ; + g_print ("usage: %s <file-to-parse>\n", prg_name) ; g_print ("\t <file-to-parse>: the file to parse\n") ; g_print ("\n\n") ; g_print ("This test just reads the file byte per byte\nand sends each byte to stdout\n") ; @@ -73,11 +85,11 @@ display_help (int a_argc, char ** a_argv) *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_about (int a_argc, char ** a_argv) +static void +display_about (char *prg_name) { g_print ("\n\n") ; - g_print ("%s is a libcroco CRInput class test program.\n", a_argv[0]) ; + g_print ("%s is a libcroco CRInput class test program.\n", prg_name) ; g_print ("It should run on GNU compliants systems.\n") ; g_print ("\n\n") ; g_print ("Initial author: Dodji Seketeli <dodji@seketeli.org>.\n") ; @@ -90,7 +102,7 @@ display_about (int a_argc, char ** a_argv) *@param a_argv the argv variable passed to the main function by the OS. *@param a_options out parameter. The abstraction of the parsed the options. */ -void +static void parse_command_line (int a_argc, char **a_argv, struct Options *a_options) { @@ -135,7 +147,7 @@ parse_command_line (int a_argc, char **a_argv, *@return CR_OK upon successfull completion of the *function, an error code otherwise. */ -enum CRStatus +static enum CRStatus test_cr_input_read_byte (guchar * a_file_uri) { enum CRStatus status = CR_OK ; @@ -193,19 +205,19 @@ main (int argc, char ** argv) if (options.display_help == TRUE) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } if (options.display_about == TRUE) { - display_about (argc, argv) ; + display_about (argv[0]) ; return 0 ; } if (options.files_list == NULL) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } diff --git a/tests/test1-main.c b/tests/test1-main.c index 6f8c92b..fad46c2 100644 --- a/tests/test1-main.c +++ b/tests/test1-main.c @@ -10,7 +10,7 @@ *or (at your option) any later version. * *The Croco Library is distributed in the hope - *that it will be useful, but WITHOUT ANY WARRANTY; +n *that it will be useful, but WITHOUT ANY WARRANTY; *without even the implied warranty of *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *See the GNU General Public License for more details. @@ -51,17 +51,31 @@ struct Options }; +static void +display_help (char *prg_name) ; + +static void +display_about (char *prg_name) ; + +static void +parse_command_line (int a_argc, char **a_argv, + struct Options *a_options) ; + +static enum CRStatus +test_cr_input_read_char (guchar * a_file_uri) ; + + /** *Displays the usage of the test *facility. *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_help (int a_argc, char ** a_argv) +static void +display_help (char *prg_name) { g_print ("\n\n") ; - g_print ("usage: %s <file-to-parse>\n", a_argv[0]) ; + g_print ("usage: %s <file-to-parse>\n", prg_name) ; g_print ("\t <file-to-parse>: the file to parse\n") ; g_print ("\n\n") ; g_print ("This test just reads the file character per character\nand sends each character to stdout\n") ; @@ -73,11 +87,11 @@ display_help (int a_argc, char ** a_argv) *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_about (int a_argc, char ** a_argv) +static void +display_about (char *prg_name) { g_print ("\n\n") ; - g_print ("%s is a libcroco CRInput class test program.\n", a_argv[0]) ; + g_print ("%s is a libcroco CRInput class test program.\n", prg_name) ; g_print ("It should run on GNU compliants systems.\n") ; g_print ("\n\n") ; g_print ("Initial author: Dodji Seketeli <dodji@seketeli.org>.\n") ; @@ -90,7 +104,7 @@ display_about (int a_argc, char ** a_argv) *@param a_argv the argv variable passed to the main function by the OS. *@param a_options out parameter. The abstraction of the parsed the options. */ -void +static void parse_command_line (int a_argc, char **a_argv, struct Options *a_options) { @@ -189,19 +203,19 @@ main (int argc, char ** argv) if (options.display_help == TRUE) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } if (options.display_about == TRUE) { - display_about (argc, argv) ; + display_about (argv[0]) ; return 0 ; } if (options.files_list == NULL) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } diff --git a/tests/test2-main.c b/tests/test2-main.c index 50a7d0a..6b25ab4 100644 --- a/tests/test2-main.c +++ b/tests/test2-main.c @@ -41,17 +41,26 @@ CRDocHandler * gv_test_handler = {0} ; +static void +display_help (char *prg_name) ; + +static void +display_about (char *prg_name) ; + +static enum CRStatus +test_cr_parser_parse (guchar * a_file_uri) ; + /** *Displays the usage of the test *facility. *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_help (int a_argc, char ** a_argv) +static void +display_help (char *prg_name) { fprintf (stdout,"\n\n") ; - fprintf (stdout,"usage: %s <file-to-parse>\n", a_argv[0]) ; + fprintf (stdout,"usage: %s <file-to-parse>\n", prg_name) ; fprintf (stdout,"\t <file-to-parse>: the file to parse\n") ; fprintf (stdout,"\n\n") ; fprintf (stdout,"Tests the cr_parser_parse () method.\n") ; @@ -64,11 +73,11 @@ display_help (int a_argc, char ** a_argv) *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_about (int a_argc, char ** a_argv) +static void +display_about (char *prg_name) { fprintf (stdout,"\n\n") ; - fprintf (stdout,"%s is a libcroco CRParser class test program.\n", a_argv[0]) ; + fprintf (stdout,"%s is a libcroco CRParser class test program.\n", prg_name) ; fprintf (stdout,"It should run on GNU compliants systems.\n") ; fprintf (stdout,"\n\n") ; fprintf (stdout,"Initial author: Dodji Seketeli <dodji@seketeli.org>.\n") ; @@ -129,7 +138,8 @@ test_import_style (CRDocHandler *a_handler, if (str) { - fprintf (stdout,str) ; fprintf (stdout,"\n") ; + fprintf (stdout,str) ; + fprintf (stdout,"\n") ; g_free (str) ; str = NULL ; } @@ -146,7 +156,8 @@ test_import_style (CRDocHandler *a_handler, a_uri_default_ns->len) ; if (str) { - fprintf (stdout,str) ; fprintf (stdout,"\n") ; + fprintf (stdout,str) ; + fprintf (stdout,"\n") ; g_free (str) ; str = NULL ; } @@ -154,8 +165,7 @@ test_import_style (CRDocHandler *a_handler, } fprintf (stdout,"******************\n\n") ; - - + a_uri = NULL; /*keep compiler happy*/ } @@ -565,7 +575,7 @@ init_test_sac_handler (CRDocHandler *a_handler) *@return CR_OK upon successfull completion of the *function, an error code otherwise. */ -enum CRStatus +static enum CRStatus test_cr_parser_parse (guchar * a_file_uri) { enum CRStatus status = CR_OK ; @@ -609,19 +619,19 @@ main (int argc, char ** argv) if (options.display_help == TRUE) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } if (options.display_about == TRUE) { - display_about (argc, argv) ; + display_about (argv[0]) ; return 0 ; } if (options.files_list == NULL) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } diff --git a/tests/test3-main.c b/tests/test3-main.c index 19425f3..dbadf0c 100644 --- a/tests/test3-main.c +++ b/tests/test3-main.c @@ -41,17 +41,26 @@ CRDocHandler * gv_test_handler = {0} ; +static void +display_help (char *prg_name) ; + +static void +display_about (char *prg_name) ; + +static enum CRStatus +test_cr_parser_parse (guchar * a_file_uri) ; + /** *Displays the usage of the test *facility. *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_help (int a_argc, char ** a_argv) +static void +display_help (char *prg_name) { fprintf (stdout,"\n\n") ; - fprintf (stdout,"usage: %s <file-to-parse>\n", a_argv[0]) ; + fprintf (stdout,"usage: %s <file-to-parse>\n", prg_name) ; fprintf (stdout,"\t <file-to-parse>: the file to parse\n") ; fprintf (stdout,"\n\n") ; fprintf (stdout,"Tests the cr_parser_parse () method.\n") ; @@ -65,11 +74,12 @@ display_help (int a_argc, char ** a_argv) *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_about (int a_argc, char ** a_argv) +static void +display_about (char *prg_name) { fprintf (stdout,"\n\n") ; - fprintf (stdout,"%s is a libcroco CRParser class test program.\n", a_argv[0]) ; + fprintf (stdout,"%s is a libcroco CRParser class test program.\n", + prg_name) ; fprintf (stdout,"It should run on GNU compliants systems.\n") ; fprintf (stdout,"\n\n") ; fprintf (stdout,"Initial author: Dodji Seketeli <dodji@seketeli.org>.\n") ; @@ -155,8 +165,7 @@ test_import_style (CRDocHandler *a_handler, } fprintf (stdout,"******************\n\n") ; - - + a_uri = NULL ; /*keep compiler happy*/ } @@ -567,7 +576,7 @@ init_test_sac_handler (CRDocHandler *a_handler) *@return CR_OK upon successfull completion of the *function, an error code otherwise. */ -enum CRStatus +static enum CRStatus test_cr_parser_parse (guchar * a_file_uri) { enum CRStatus status = CR_OK ; @@ -612,19 +621,19 @@ main (int argc, char ** argv) if (options.display_help == TRUE) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } if (options.display_about == TRUE) { - display_about (argc, argv) ; + display_about (argv[0]) ; return 0 ; } if (options.files_list == NULL) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } diff --git a/tests/test4-main.c b/tests/test4-main.c index 66df6dc..13e4a4f 100644 --- a/tests/test4-main.c +++ b/tests/test4-main.c @@ -39,17 +39,26 @@ CRDocHandler * gv_test_handler = {0} ; +static void +display_help (char *prg_name) ; + +static void +display_about (char *prg_name) ; + +static enum CRStatus +test_cr_parser_parse (guchar * a_file_uri) ; + /** *Displays the usage of the test *facility. *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_help (int a_argc, char ** a_argv) +static void +display_help (char *prg_name) { g_print ("\n\n") ; - g_print ("usage: %s <file-to-parse>\n", a_argv[0]) ; + g_print ("usage: %s <file-to-parse>\n", prg_name) ; g_print ("\t <file-to-parse>: the file to parse\n") ; g_print ("\n\n") ; g_print ("Tests the cr_parser_parse () method.\n") ; @@ -63,14 +72,14 @@ display_help (int a_argc, char ** a_argv) *@param a_argc the argc variable passed to the main function. *@param a_argv the argv variable passed to the main function. */ -void -display_about (int a_argc, char ** a_argv) +static void +display_about (char *prg_name) { g_print ("\n\n") ; g_print ("%s is a libcroco CROMParser class test program.\n", - a_argv[0]) ; + prg_name) ; g_print ("%s Parses a file and builds a CSS object model", - a_argv[0]) ; + prg_name) ; g_print ("It should run on GNU compliants systems.\n") ; g_print ("\n\n") ; g_print ("Initial author: Dodji Seketeli <dodji@seketeli.org>.\n") ; @@ -87,7 +96,7 @@ display_about (int a_argc, char ** a_argv) *@return CR_OK upon successfull completion of the *function, an error code otherwise. */ -enum CRStatus +static enum CRStatus test_cr_parser_parse (guchar * a_file_uri) { enum CRStatus status = CR_OK ; @@ -123,19 +132,19 @@ main (int argc, char ** argv) if (options.display_help == TRUE) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } if (options.display_about == TRUE) { - display_about (argc, argv) ; + display_about (argv[0]) ; return 0 ; } if (options.files_list == NULL) { - display_help (argc, argv) ; + display_help (argv[0]) ; return 0 ; } |