Re-enable tests on x86.

This commit is contained in:
Susi Lehtola 2016-08-02 21:51:00 +02:00
parent fb95062c58
commit b938d9b7db
2 changed files with 45 additions and 4 deletions

38
cppcheck-1.74-test.patch Normal file
View File

@ -0,0 +1,38 @@
Index: lib/checkcondition.cpp
===================================================================
--- lib/checkcondition.cpp (revision a5cfa2b12c034e59b5805ac51b53e893c8bc2d1b)
+++ lib/checkcondition.cpp (revision 9bda97975aeec2c18198946e72524f13b4308d8e)
@@ -569,14 +569,6 @@
// 5 => return value that is larger than both value1 and value2
switch (test) {
- case 1: {
- const T ret = std::min(value1, value2);
- if ((ret - (T)1) < ret)
- return ret - (T)1;
- else if ((ret / (T)2) < ret)
- return ret / (T)2;
- else if ((ret * (T)2) < ret)
- return ret * (T)2;
- return ret;
- }
+ case 1:
+ return std::numeric_limits<T>::lowest();
case 2:
return value1;
@@ -585,14 +577,6 @@
case 4:
return value2;
- case 5: {
- const T ret = std::max(value1, value2);
- if ((ret + (T)1) > ret)
- return ret + (T)1;
- else if ((ret / (T)2) > ret)
- return ret / (T)2;
- else if ((ret * (T)2) > ret)
- return ret * (T)2;
- return ret;
- }
+ case 5:
+ return std::numeric_limits<T>::max();
};
return 0;

View File

@ -1,6 +1,6 @@
Name: cppcheck
Version: 1.74
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Tool for static C/C++ code analysis
Group: Development/Languages
License: GPLv3+
@ -13,6 +13,8 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Patch0: cppcheck-1.73-tinyxml.patch
# Fix location of translations
Patch1: cppcheck-1.73-translations.patch
# Fix tests on x86
Patch2: cppcheck-1.74-test.patch
BuildRequires: pcre-devel
BuildRequires: tinyxml2-devel >= 2.1.0
@ -42,6 +44,7 @@ This package contains the graphical user interface for cppcheck.
%setup -q
%patch0 -p1 -b .tinyxml
%patch1 -p1 -b .translations
%patch2 -p0 -b .test
# Make sure bundled tinyxml is not used
rm -r externals/tinyxml
@ -72,10 +75,7 @@ install -D -p -m 644 gui/icon.png %{buildroot}%{_datadir}/pixmaps/cppcheck.png
%check
cd objdir-%{_target_platform}/bin
# A test currently fails on 32-bit archs, see http://trac.cppcheck.net/ticket/7037
%if 0%{?__isa_bits} == 64
./testrunner -g -q
%endif
%clean
rm -rf %{buildroot}
@ -93,6 +93,9 @@ rm -rf %{buildroot}
%changelog
* Tue Aug 02 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.74-2
- Re-enable tests on x86.
* Mon Aug 01 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 1.74-1
- Update to 1.74.