summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2014-08-05 08:17:17 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2014-08-05 11:57:59 +0000
commitd27114ca3442cffda04950b054d74f0f6cb19130 (patch)
treedd79c02f0df4a12c2c809d55248276f67474f78b /tests
parenta7df9d26a96bb48ccff06f4543c134e545b90c40 (diff)
downloadlibcroco-d27114ca3442cffda04950b054d74f0f6cb19130.tar.gz
gchar/guchar types and casting
https://bugzilla.gnome.org/show_bug.cgi?id=710076
Diffstat (limited to 'tests')
-rw-r--r--tests/test0-main.c4
-rw-r--r--tests/test1-main.c4
-rw-r--r--tests/test2-main.c24
-rw-r--r--tests/test3-main.c24
-rw-r--r--tests/test4-main.c24
-rw-r--r--tests/test5-main.c4
-rw-r--r--tests/test6-main.c2
7 files changed, 43 insertions, 43 deletions
diff --git a/tests/test0-main.c b/tests/test0-main.c
index a991abf..d1fd584 100644
--- a/tests/test0-main.c
+++ b/tests/test0-main.c
@@ -145,7 +145,7 @@ test_cr_input_read_byte (guchar * a_file_uri)
g_return_val_if_fail (a_file_uri, CR_BAD_PARAM_ERROR);
- input = cr_input_new_from_uri (a_file_uri, CR_UTF_8);
+ input = cr_input_new_from_uri ((const gchar *) a_file_uri, CR_UTF_8);
if (!input) {
cr_utils_trace_debug ("Input Stream creation failed.");
@@ -197,7 +197,7 @@ main (int argc, char **argv)
return 0;
}
- test_cr_input_read_byte (options.files_list[0]);
+ test_cr_input_read_byte ((guchar *) options.files_list[0]);
return 0;
}
diff --git a/tests/test1-main.c b/tests/test1-main.c
index 3346025..e01913c 100644
--- a/tests/test1-main.c
+++ b/tests/test1-main.c
@@ -140,7 +140,7 @@ test_cr_input_read_char (guchar * a_file_uri)
g_return_val_if_fail (a_file_uri, CR_BAD_PARAM_ERROR);
- input = cr_input_new_from_uri (a_file_uri, CR_UTF_8);
+ input = cr_input_new_from_uri ((const gchar *) a_file_uri, CR_UTF_8);
if (!input) {
cr_utils_trace_debug ("Input Stream creation failed.");
@@ -191,7 +191,7 @@ main (int argc, char **argv)
return 0;
}
- test_cr_input_read_char (options.files_list[0]);
+ test_cr_input_read_char ((guchar *) options.files_list[0]);
return 0;
}
diff --git a/tests/test2-main.c b/tests/test2-main.c
index be1d545..7d94a80 100644
--- a/tests/test2-main.c
+++ b/tests/test2-main.c
@@ -124,7 +124,7 @@ test_import_style (CRDocHandler * a_handler,
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data) {
- guchar *str =
+ gchar *str =
g_strndup
(((CRString *) cur->data)->stryng->str,
((CRString *) cur->data)->stryng->len);
@@ -141,7 +141,7 @@ test_import_style (CRDocHandler * a_handler,
fprintf (stdout, "--------------------\n");
if (a_uri_default_ns) {
- guchar *str = cr_string_dup2
+ guchar *str = (guchar *) cr_string_dup2
(a_uri_default_ns) ;
if (str) {
fprintf (stdout, "%s\n", str);
@@ -166,7 +166,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
fprintf (stdout, "namespace_declaration:\n");
if (a_prefix) {
- guchar *prefix = NULL;
+ gchar *prefix = NULL;
prefix = cr_string_dup2 (a_prefix) ;
if (prefix) {
@@ -176,7 +176,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
}
}
if (a_uri) {
- guchar *uri = NULL;
+ gchar *uri = NULL;
uri = cr_string_dup2 (a_uri) ;
if (uri) {
@@ -200,7 +200,7 @@ test_comment (CRDocHandler * a_handler,
fprintf (stdout, "***************\n");
fprintf (stdout, "comment:\n");
if (a_comment) {
- guchar *comment = NULL;
+ gchar *comment = NULL;
comment = cr_string_dup2 (a_comment);
@@ -263,7 +263,7 @@ test_property (CRDocHandler * a_handler,
if (a_name
&& a_name->stryng
&& a_name->stryng->str) {
- guchar *name = g_strndup
+ gchar *name = g_strndup
(a_name->stryng->str,
a_name->stryng->len);
@@ -317,7 +317,7 @@ test_start_media (CRDocHandler * a_handler,
if (a_media_list) {
GList *cur = NULL;
- guchar *medium = NULL;
+ gchar *medium = NULL;
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data == NULL)
@@ -347,7 +347,7 @@ test_end_media (CRDocHandler * a_handler,
if (a_media_list) {
GList *cur = NULL;
- guchar *medium = NULL;
+ gchar *medium = NULL;
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data == NULL)
@@ -374,7 +374,7 @@ test_start_page (CRDocHandler * a_handler,
CRString * a_pseudo_page,
CRParsingLocation *a_location)
{
- guchar *name = NULL,
+ gchar *name = NULL,
*pseudo_page = NULL;
g_return_if_fail (a_handler);
@@ -410,7 +410,7 @@ test_end_page (CRDocHandler * a_handler,
CRString * a_name,
CRString * a_pseudo_page)
{
- guchar *name = NULL,
+ gchar *name = NULL,
*pseudo_page = NULL;
g_return_if_fail (a_handler);
@@ -446,7 +446,7 @@ static void
test_ignorable_at_rule (CRDocHandler * a_handler,
CRString * a_name)
{
- guchar *name = NULL;
+ gchar *name = NULL;
g_return_if_fail (a_handler);
@@ -551,7 +551,7 @@ main (int argc, char **argv)
return 0;
}
- status = test_cr_parser_parse (options.files_list[0]);
+ status = test_cr_parser_parse ((guchar *) options.files_list[0]);
if (status != CR_OK) {
fprintf (stdout, "KO\n");
diff --git a/tests/test3-main.c b/tests/test3-main.c
index 33e1a9a..1dd5d07 100644
--- a/tests/test3-main.c
+++ b/tests/test3-main.c
@@ -120,7 +120,7 @@ test_import_style (CRDocHandler * a_handler,
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data) {
- guchar *str =
+ gchar *str =
cr_string_dup2 ((CRString *) cur->data);
if (str) {
fprintf (stdout, "%s\n", str);
@@ -133,7 +133,7 @@ test_import_style (CRDocHandler * a_handler,
fprintf (stdout, "--------------------\n");
if (a_uri_default_ns) {
- guchar *str = cr_string_dup2 (a_uri_default_ns) ;
+ gchar *str = cr_string_dup2 (a_uri_default_ns) ;
if (str) {
fprintf (stdout, "%s\n", str);
g_free (str);
@@ -157,7 +157,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
fprintf (stdout, "namespace_declaration:\n");
if (a_prefix) {
- guchar *prefix = NULL;
+ gchar *prefix = NULL;
prefix = cr_string_dup2 (a_prefix);
if (prefix) {
@@ -168,7 +168,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
}
if (a_uri) {
- guchar *uri = NULL;
+ gchar *uri = NULL;
uri = cr_string_dup2 (a_uri) ;
if (uri) {
fprintf (stdout, "uri: %s\n", uri);
@@ -192,7 +192,7 @@ test_comment (CRDocHandler * a_handler,
fprintf (stdout, "comment:\n");
if (a_comment) {
- guchar *comment = NULL;
+ gchar *comment = NULL;
comment = cr_string_dup2 (a_comment);
@@ -251,7 +251,7 @@ test_property (CRDocHandler * a_handler, CRString * a_name,
fprintf (stdout, "property\n");
if (a_name) {
- guchar *name = cr_string_dup2 (a_name);
+ gchar *name = cr_string_dup2 (a_name);
if (name) {
fprintf (stdout, "%s", name);
}
@@ -302,7 +302,7 @@ test_start_media (CRDocHandler * a_handler,
if (a_media_list) {
GList *cur = NULL;
- guchar *medium = NULL;
+ gchar *medium = NULL;
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data == NULL)
@@ -331,7 +331,7 @@ test_end_media (CRDocHandler * a_handler,
if (a_media_list) {
GList *cur = NULL;
- guchar *medium = NULL;
+ gchar *medium = NULL;
for (cur = a_media_list; cur; cur = cur->next) {
if (cur->data == NULL)
@@ -355,7 +355,7 @@ test_start_page (CRDocHandler * a_handler,
CRString * a_pseudo_page,
CRParsingLocation *a_location)
{
- guchar *name = NULL,
+ gchar *name = NULL,
*pseudo_page = NULL;
g_return_if_fail (a_handler);
@@ -391,7 +391,7 @@ test_end_page (CRDocHandler * a_handler,
CRString * a_name,
CRString * a_pseudo_page)
{
- guchar *name = NULL,
+ gchar *name = NULL,
*pseudo_page = NULL;
g_return_if_fail (a_handler);
@@ -426,7 +426,7 @@ static void
test_ignorable_at_rule (CRDocHandler * a_handler,
CRString * a_name)
{
- guchar *name = NULL;
+ gchar *name = NULL;
g_return_if_fail (a_handler);
@@ -532,7 +532,7 @@ main (int argc, char **argv)
return 0;
}
- status = test_cr_parser_parse (options.files_list[0]);
+ status = test_cr_parser_parse ((guchar *) options.files_list[0]);
if (status != CR_OK) {
fprintf (stdout, "KO\n");
diff --git a/tests/test4-main.c b/tests/test4-main.c
index 1d80022..3f76497 100644
--- a/tests/test4-main.c
+++ b/tests/test4-main.c
@@ -32,27 +32,27 @@
CRDocHandler *gv_test_handler = { 0 };
-const guchar *gv_term_buf = "106";
+const guchar *gv_term_buf = (const guchar *) "106";
-const guchar *gv_decl_buf = "toto: tutu, tata";
+const guchar *gv_decl_buf = (const guchar *) "toto: tutu, tata";
-const guchar *gv_decl_list_buf = "toto: titi; prop1:val1 ; prop2:val2;";
+const guchar *gv_decl_list_buf = (const guchar *) "toto: titi; prop1:val1 ; prop2:val2;";
-const guchar *gv_ruleset_buf = "s1 > s2 {toto: tutu, tata} ";
+const guchar *gv_ruleset_buf = (const guchar *) "s1 > s2 {toto: tutu, tata} ";
const guchar *gv_at_media_buf =
- "@media print, toto {" " BODY { font-size: 10pt }" " }";
+ (const guchar *) "@media print, toto {" " BODY { font-size: 10pt }" " }";
-const guchar *gv_at_page_buf = "@page { size :8.5in 11in; margin: 2cm }";
+const guchar *gv_at_page_buf = (const guchar *) "@page { size :8.5in 11in; margin: 2cm }";
-const guchar *gv_at_charset_buf = "@charset \"ISO-8859-1\" ; ";
+const guchar *gv_at_charset_buf = (const guchar *) "@charset \"ISO-8859-1\" ; ";
const guchar *gv_at_font_face_buf =
- "@font-face {"
+ (const guchar *) "@font-face {"
" font-family: \"Robson Celtic\";"
" src: url(\"http://site/fonts/rob-celt\")" "}";
-const guchar *gv_at_import_buf = "@import \"subs.css\";";
+const guchar *gv_at_import_buf = (const guchar *) "@import \"subs.css\";";
static void display_help (char *prg_name);
@@ -166,7 +166,7 @@ test_cr_term_parse_expression_from_buf (void)
static enum CRStatus
test_cr_declaration_parse (void)
{
- guchar *tmp_str = NULL;
+ gchar *tmp_str = NULL;
CRDeclaration *decl = NULL;
decl = cr_declaration_parse_from_buf (NULL, gv_decl_buf, CR_UTF_8);
@@ -190,7 +190,7 @@ static enum CRStatus
test_cr_declaration_parse_list (void)
{
GString *str = NULL;
- guchar *tmp_str = NULL;
+ gchar *tmp_str = NULL;
CRDeclaration *decl = NULL,
*cur_decl = NULL;
@@ -426,7 +426,7 @@ main (int argc, char **argv)
return 0;
}
- status = test_cr_parser_parse (options.files_list[0]);
+ status = test_cr_parser_parse ((guchar *) options.files_list[0]);
if (status != CR_OK) {
g_print ("\nKO\n");
}
diff --git a/tests/test5-main.c b/tests/test5-main.c
index 034da23..2b7c9c7 100644
--- a/tests/test5-main.c
+++ b/tests/test5-main.c
@@ -32,7 +32,7 @@
CRDocHandler *gv_test_handler = { 0 };
const guchar *xml_content =
- "<document>"
+ (const guchar *) "<document>"
"<E0>text0</E0> "
"<E1><E1-1>text1</E1-1></E1>"
"<E2 attr2=\"val2\">text2</E2>"
@@ -242,7 +242,7 @@ main (int argc, char **argv)
return 0;
}
- status = test_sel_eng (options.files_list[0]);
+ status = test_sel_eng ((guchar *) options.files_list[0]);
if (status != CR_OK) {
g_print ("\nKO\n");
diff --git a/tests/test6-main.c b/tests/test6-main.c
index f9dd1c3..e2cfc94 100644
--- a/tests/test6-main.c
+++ b/tests/test6-main.c
@@ -31,7 +31,7 @@
#include "cr-test-utils.h"
const guchar *gv_cssbuf =
- ".str0 {stroke:#007844;stroke-width:44}" ".fil0 {fill:url(#id0)}";
+ (const guchar *) ".str0 {stroke:#007844;stroke-width:44}" ".fil0 {fill:url(#id0)}";
static enum CRStatus
test_cr_parser_parse (void);