Add -fail-macros patch.

This commit is contained in:
Jerry James 2020-08-03 11:48:57 -06:00
parent 91a78d3cbd
commit dcf59af98a
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,32 @@
--- check-0.15.1/src/check.h.in.orig 2020-07-22 08:19:48.000000000 -0600
+++ check-0.15.1/src/check.h.in 2020-08-03 11:41:08.131406149 -0600
@@ -466,7 +466,10 @@ static void __testname ## _fn (int _i CK
*
* This call is deprecated.
*/
-#define fail_unless ck_assert_msg
+#define fail_unless(expr, ...) \
+ (expr) ? \
+ _mark_point(__FILE__, __LINE__) : \
+ _ck_assert_failed(__FILE__, __LINE__, "Assertion '"#expr"' failed" , ## __VA_ARGS__, NULL)
/*
* Fail the test case if expr is false
@@ -480,7 +483,7 @@ static void __testname ## _fn (int _i CK
*/
#define fail_if(expr, ...)\
(expr) ? \
- _ck_assert_failed(__FILE__, __LINE__, "Failure '"#expr"' occurred" , ## __VA_ARGS__) \
+ _ck_assert_failed(__FILE__, __LINE__, "Failure '"#expr"' occurred" , ## __VA_ARGS__, NULL) \
: _mark_point(__FILE__, __LINE__)
/*
@@ -488,7 +491,7 @@ static void __testname ## _fn (int _i CK
*
* This call is deprecated.
*/
-#define fail ck_abort_msg
+#define fail(...) _ck_assert_failed(__FILE__, __LINE__, "Failed" , ## __VA_ARGS__, NULL)
/*
* This is called whenever an assertion fails.

View File

@ -1,6 +1,6 @@
Name: check
Version: 0.15.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A unit test framework for C
Source0: https://github.com/libcheck/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
License: LGPLv2+
@ -9,6 +9,9 @@ URL: http://libcheck.github.io/check/
Patch0: %{name}-0.11.0-info-in-builddir.patch
# Fix test failures due to varying floating point behavior across platforms
Patch1: %{name}-0.11.0-fp.patch
# Add an extra NULL argument to the deprecated fail* macros
# https://github.com/libcheck/check/commit/82540c5428d3818b64d6a8aefb601e722520651f
Patch2: %{name}-0.15.1-fail-macros.patch
BuildRequires: cmake
BuildRequires: gcc
@ -54,6 +57,7 @@ programs suitable for use with the Check unit test framework.
%patch0 -p1 -b .info-in-builddir
%endif
%patch1 -p1
%patch2 -p1
# Fix detection of various time-related function declarations
sed -e '/DECLS(\[a/s|)|,,,[AC_INCLUDES_DEFAULT\n[#include <time.h>\n #include <sys/time.h>]]&|' \
@ -139,6 +143,9 @@ cd -
%{_mandir}/man1/checkmk.1*
%changelog
* Mon Aug 3 2020 Jerry James <loganjerry@gmail.com> - 0.15.1-3
- Add -fail-macros patch
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild