rpm-software-management / librepo

A library providing C and Python (libcURL like) API for downloading packages and linux repository metadata in rpm-md format
http://rpm-software-management.github.io/librepo/
GNU Lesser General Public License v2.1
74 stars 91 forks source link

`fail_if` and `fail_unless` are deprecated #249

Closed kontura closed 3 years ago

kontura commented 3 years ago

https://libcheck.github.io/check/doc/check_html/check_4.html#Convenience-Test-Functions

It also fixes a couple of covscan warnings of the following type:

Error: COMPILER_WARNING (CWE-685):
librepo-1.12.1/tests/fixtures.h:5: included_from: Included from here.
librepo-1.12.1/tests/test_checksum.c:15: included_from: Included from here.
librepo-1.12.1/tests/test_checksum.c: scope_hint: In function 'test_checksum'
librepo-1.12.1/tests/test_checksum.c:58:9: warning[-Wformat-extra-args]: too many arguments for format
\#   58 |         "Checksum is %s instead of %s", checksum, expected);
\#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\#   56|       fail_if(tmp_err);
\#   57|       fail_if(strcmp(checksum, expected),
\#   58|->         "Checksum is %s instead of %s", checksum, expected);
\#   59|       lr_free(checksum);
\#   60|       close(fd);
lukash commented 3 years ago

Thanks!