control: tags -1 +patch

Hi,

I came to look into this, because one of my packages dropped out from
testing...

Please consider applying the attached patch.

With best regards,
b.
Description: Fix build with gcc-14
 Fix type errors in the cgreen with constraints facility.
 Remove bogus test from test_dbi.c
Author: Florian Weimer <fwei...@redhat.com>, <Boian Bonev <bbo...@ipacct.com>
Origin: other
Forwarded: https://sourceforge.net/p/libdbi-drivers/bugs/28/
Last-Update: 2024-08-25

--- a/tests/cgreen/src/constraint.c
+++ b/tests/cgreen/src/constraint.c
@@ -22,8 +22,7 @@ static double unbox_double(intptr_t box)
 static double as_double(intptr_t box);
 
 static int compare_using_matcher(Constraint *constraint, intptr_t actual);
-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t actual, const char *test_file, int test_line, TestReporter *reporter);
-
+static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter);
 
 void destroy_constraint(void *abstract) {
     Constraint *constraint = (Constraint *)abstract;
@@ -164,11 +163,11 @@ static void test_want_double(Constraint
 }
 
 static int compare_using_matcher(Constraint *constraint, intptr_t actual) {
-	int (*matches)(const void*) = constraint->expected;
-    return matches(actual);
+	int (*matches)(const void*) = (int (*)(const void*)) constraint->expected;
+    return matches((const void *)actual);
 }
 
-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) {
+static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) {
     (*reporter->assert_true)(
             reporter,
             test_file,
@@ -176,7 +175,7 @@ static void test_with_matcher(Constraint
             (*constraint->compare)(constraint, matcher_function),
             "Wanted parameter [%s] to match [%s] in function [%s]",
             constraint->parameter,
-            matcher_name,
+            constraint->name,
             function);
 }
 
--- a/tests/test_dbi.c
+++ b/tests/test_dbi.c
@@ -4599,11 +4599,12 @@ Ensure test_dbi_result_get_datetime() {
       assert_equal( the_datetime, expect_longlong_from_name("the_datetime", cinfo.drivername));
 
       if(!strcmp(cinfo.drivername, "msql")) {
-         the_date = dbi_result_get_string(result, "the_date");
-         assert_string_equal(the_date, "11-jul-1977");
+         // comparing time_t to string does not make any sense
+         //the_date = dbi_result_get_string(result, "the_date");
+         //assert_string_equal(the_date, "11-jul-1977");
 
-         the_time = dbi_result_get_string(result, "the_time");
-         assert_string_equal(the_time, "23:59:59");
+         //the_time = dbi_result_get_string(result, "the_time");
+         //assert_string_equal(the_time, "23:59:59");
       }
       else {
          the_date = dbi_result_get_datetime(result, "the_date");

Reply via email to