[libgda] Remove tests compilation warnings



commit 5e98c315c9d3758f9d0fc644705c0e4d8f2ed3f5
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date:   Fri Feb 22 17:25:24 2019 -0600

    Remove tests compilation warnings

 tests/parser/check_dml_comp.c      | 8 ++++----
 tests/parser/check_normalization.c | 4 ++--
 tests/parser/check_script.c        | 2 +-
 tests/parser/check_validation.c    | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/tests/parser/check_dml_comp.c b/tests/parser/check_dml_comp.c
index 34c551177..0b9d16e72 100644
--- a/tests/parser/check_dml_comp.c
+++ b/tests/parser/check_dml_comp.c
@@ -92,14 +92,14 @@ main (int argc, char** argv)
                                xmlChar *prop;
                                gboolean require_pk = TRUE;
                                comp_exp = xmlNodeGetContent (snode);
-                               prop = xmlGetProp (snode, "need_pk");
+                               prop = xmlGetProp (snode, (const xmlChar*) "need_pk");
                                if (prop) {
                                        if ((*prop == 'f') || (*prop == 'F') || (*prop == '0'))
                                                require_pk = FALSE;
                                        xmlFree (prop);
                                }
                                if (sql) {
-                                       if (!do_test (id, sql, snode->name, comp_exp, require_pk))
+                                       if (!do_test (id, sql, (const gchar*) snode->name, comp_exp, 
require_pk))
                                                failures++;
                                        ntests++;
                                }
@@ -140,7 +140,7 @@ do_test (const xmlChar *id, const xmlChar *sql,
                 require_pk ? "PK fields" : "All fields", sql);
 #endif
 
-       stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+       stmt = gda_sql_parser_parse_string (parser, (const gchar*) sql, NULL, NULL);
        if (!stmt) {
                g_print ("ERROR for test '%s': could not parse statement\n", id);
                return FALSE;
@@ -189,7 +189,7 @@ do_test (const xmlChar *id, const xmlChar *sql,
                if (*computed_exp && cstmt) {
                        gchar *serial;
                        serial = gda_statement_serialize (cstmt);
-                       if (strcmp (serial, computed_exp)) {
+                       if (g_strcmp0 (serial, (const gchar*) computed_exp)) {
                                gchar *rend;
                                rend = gda_statement_to_sql (cstmt, NULL, NULL);
                                g_print ("ERROR for test '%s': computed %s statement is incorrect:\n"
diff --git a/tests/parser/check_normalization.c b/tests/parser/check_normalization.c
index 1d6e966b4..9963f1a1e 100644
--- a/tests/parser/check_normalization.c
+++ b/tests/parser/check_normalization.c
@@ -128,7 +128,7 @@ do_test (const xmlChar *id, const xmlChar *sql, const xmlChar *norm)
        g_print ("===== TEST %s SQL: @%s@\n", id, sql);
 #endif
 
-       stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+       stmt = gda_sql_parser_parse_string (parser, (const gchar*) sql, NULL, NULL);
        if (!stmt) {
                g_print ("ERROR for test '%s': could not parse statement\n", id);
                return FALSE;
@@ -141,7 +141,7 @@ do_test (const xmlChar *id, const xmlChar *sql, const xmlChar *norm)
        }
 
        str = gda_statement_serialize (stmt);
-       if (strcmp (str, norm)) {
+       if (g_strcmp0 (str, (const gchar*) norm)) {
                gchar *sql;
                sql = gda_statement_to_sql (stmt, NULL, NULL);
                g_print ("ERROR for test '%s': \n\tEXP: %s\n\tGOT: %s\n\tSQL: %s\n", id, norm, str, sql);
diff --git a/tests/parser/check_script.c b/tests/parser/check_script.c
index 95c470849..335fb1ea2 100644
--- a/tests/parser/check_script.c
+++ b/tests/parser/check_script.c
@@ -199,7 +199,7 @@ do_test (GdaSqlParser *parser, const xmlChar *id, const xmlChar *file, xmlNodePt
                                }
                                g_strstrip (sql);
                                if (expected) {
-                                       if (strcmp (sql, expected)) {
+                                       if (g_strcmp0 (sql, (const gchar*) expected)) {
                                                g_print ("ERROR for test '%s', statement at position %d:\n   
*exp:%s\n   *got:%s\n", id,
                                                         g_slist_position ((GSList*) stmt_list, list), 
expected, sql);   
                                                failures ++;
diff --git a/tests/parser/check_validation.c b/tests/parser/check_validation.c
index ef395c549..605cb096f 100644
--- a/tests/parser/check_validation.c
+++ b/tests/parser/check_validation.c
@@ -86,7 +86,7 @@ main (int argc, char** argv)
                        if (!strcmp ((gchar*) snode->name, "sql")) {
                                sql = xmlNodeGetContent (snode);
                                xmlChar *prop;
-                               prop = xmlGetProp (snode, "valid");
+                               prop = xmlGetProp (snode, (const xmlChar*) "valid");
                                if (prop) {
                                        if ((*prop == 't') || (*prop == 'T') || (*prop == '1'))
                                                valid = TRUE;
@@ -133,7 +133,7 @@ do_test (const xmlChar *id, const xmlChar *sql, gboolean valid_expected)
        g_print ("===== TEST %s SQL: @%s@\n", id, sql);
 #endif
 
-       stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+       stmt = gda_sql_parser_parse_string (parser, (const gchar*) sql, NULL, NULL);
        if (!stmt) {
                g_print ("ERROR for test '%s': could not parse statement\n", id);
                return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]