From b938d9b7db75ad9925010830157127cf7640a5cf Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Tue, 2 Aug 2016 21:51:00 +0200 Subject: [PATCH] Re-enable tests on x86. --- cppcheck-1.74-test.patch | 38 ++++++++++++++++++++++++++++++++++++++ cppcheck.spec | 11 +++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 cppcheck-1.74-test.patch diff --git a/cppcheck-1.74-test.patch b/cppcheck-1.74-test.patch new file mode 100644 index 0000000..8a03166 --- /dev/null +++ b/cppcheck-1.74-test.patch @@ -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::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::max(); + }; + return 0; diff --git a/cppcheck.spec b/cppcheck.spec index e5e5af3..3ece53d 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -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 - 1.74-2 +- Re-enable tests on x86. + * Mon Aug 01 2016 Susi Lehtola - 1.74-1 - Update to 1.74.